| 327 | 
  | 
  double pos[3]; // position place holders | 
| 328 | 
  | 
  double vel[3]; // velocity placeholders | 
| 329 | 
  | 
  double q[4]; // the quaternions | 
| 330 | 
< | 
  double jx, jy, jz; // angular velocity placeholders; | 
| 330 | 
> | 
  double ji[3]; // angular velocity placeholders; | 
| 331 | 
  | 
  double qSqr, qLength; // needed to normalize the quaternion vector. | 
| 332 | 
  | 
 | 
| 333 | 
  | 
  Atom **atoms = simnfo->atoms; | 
| 490 | 
  | 
               c_in_name, n_atoms, atomIndex ); | 
| 491 | 
  | 
      return strdup( painCave.errMsg ); | 
| 492 | 
  | 
    } | 
| 493 | 
< | 
    jx = atof( foo ); | 
| 493 | 
> | 
    ji[0] = atof( foo ); | 
| 494 | 
  | 
 | 
| 495 | 
  | 
    foo = strtok(NULL, " ,;\t"); | 
| 496 | 
  | 
    if(foo == NULL){ | 
| 500 | 
  | 
               c_in_name, n_atoms, atomIndex ); | 
| 501 | 
  | 
      return strdup( painCave.errMsg ); | 
| 502 | 
  | 
    } | 
| 503 | 
< | 
    jy = atof(foo ); | 
| 503 | 
> | 
    ji[1] = atof(foo ); | 
| 504 | 
  | 
 | 
| 505 | 
  | 
    foo = strtok(NULL, " ,;\t"); | 
| 506 | 
  | 
    if(foo == NULL){ | 
| 510 | 
  | 
               c_in_name, n_atoms, atomIndex ); | 
| 511 | 
  | 
      return strdup( painCave.errMsg ); | 
| 512 | 
  | 
    } | 
| 513 | 
< | 
    jz = atof( foo ); | 
| 513 | 
> | 
    ji[2] = atof( foo ); | 
| 514 | 
  | 
 | 
| 515 | 
  | 
    dAtom = ( DirectionalAtom* )atoms[atomIndex]; | 
| 516 | 
  | 
 | 
| 528 | 
  | 
 | 
| 529 | 
  | 
    // add the angular velocities | 
| 530 | 
  | 
 | 
| 531 | 
< | 
    dAtom->setJx( jx ); | 
| 532 | 
< | 
    dAtom->setJy( jy ); | 
| 533 | 
< | 
    dAtom->setJz( jz ); | 
| 531 | 
> | 
    dAtom->setJ( ji ); | 
| 532 | 
  | 
  } | 
| 533 | 
  | 
 | 
| 534 | 
  | 
  // add the positions and velocities to the atom | 
| 585 | 
  | 
  entry_plug->setBoxM( theBoxMat3 ); | 
| 586 | 
  | 
 | 
| 587 | 
  | 
  //get chi and integralOfChidt, they should appear by pair | 
| 590 | 
– | 
  foo = strtok(NULL, " ,;\t\n"); | 
| 591 | 
– | 
  if(foo != NULL){ | 
| 592 | 
– | 
    chi = atof(foo); | 
| 588 | 
  | 
 | 
| 589 | 
+ | 
  if( entry_plug->useInitXSstate ){ | 
| 590 | 
  | 
    foo = strtok(NULL, " ,;\t\n"); | 
| 591 | 
< | 
    if(foo == NULL){ | 
| 592 | 
< | 
      sprintf( painCave.errMsg, | 
| 593 | 
< | 
               "chi and integralOfChidt should appear by pair in %s\n", c_in_name ); | 
| 594 | 
< | 
      return strdup( painCave.errMsg ); | 
| 591 | 
> | 
    if(foo != NULL){ | 
| 592 | 
> | 
      chi = atof(foo); | 
| 593 | 
> | 
       | 
| 594 | 
> | 
      foo = strtok(NULL, " ,;\t\n"); | 
| 595 | 
> | 
      if(foo == NULL){ | 
| 596 | 
> | 
        sprintf( painCave.errMsg, | 
| 597 | 
> | 
                 "chi and integralOfChidt should appear by pair in %s\n", c_in_name ); | 
| 598 | 
> | 
        return strdup( painCave.errMsg ); | 
| 599 | 
> | 
      } | 
| 600 | 
> | 
      integralOfChidt = atof( foo ); | 
| 601 | 
> | 
       | 
| 602 | 
> | 
      //push chi and integralOfChidt into SimInfo::properties which can be | 
| 603 | 
> | 
      //retrieved by integrator later | 
| 604 | 
> | 
      DoubleData* chiValue = new DoubleData(); | 
| 605 | 
> | 
      chiValue->setID(CHIVALUE_ID); | 
| 606 | 
> | 
      chiValue->setData(chi); | 
| 607 | 
> | 
      entry_plug->addProperty(chiValue); | 
| 608 | 
> | 
       | 
| 609 | 
> | 
      DoubleData* integralOfChidtValue = new DoubleData(); | 
| 610 | 
> | 
      integralOfChidtValue->setID(INTEGRALOFCHIDT_ID); | 
| 611 | 
> | 
      integralOfChidtValue->setData(integralOfChidt); | 
| 612 | 
> | 
      entry_plug->addProperty(integralOfChidtValue); | 
| 613 | 
> | 
       | 
| 614 | 
  | 
    } | 
| 615 | 
< | 
    integralOfChidt = atof( foo ); | 
| 616 | 
< | 
 | 
| 617 | 
< | 
    //push chi and integralOfChidt into SimInfo::properties which can be | 
| 615 | 
> | 
    else | 
| 616 | 
> | 
      return NULL; | 
| 617 | 
> | 
     | 
| 618 | 
> | 
    //get eta | 
| 619 | 
> | 
    foo = strtok(NULL, " ,;\t\n"); | 
| 620 | 
> | 
    if(foo != NULL ){ | 
| 621 | 
> | 
   | 
| 622 | 
> | 
      for(int i = 0 ; i < 9; i++){ | 
| 623 | 
> | 
         | 
| 624 | 
> | 
        if(foo == NULL){ | 
| 625 | 
> | 
          sprintf( painCave.errMsg, | 
| 626 | 
> | 
                   "error in reading eta[%d] from %s\n", i, c_in_name ); | 
| 627 | 
> | 
          return strdup( painCave.errMsg ); | 
| 628 | 
> | 
        } | 
| 629 | 
> | 
        eta[i] = atof( foo ); | 
| 630 | 
> | 
        foo = strtok(NULL, " ,;\t\n"); | 
| 631 | 
> | 
      } | 
| 632 | 
> | 
    } | 
| 633 | 
> | 
    else | 
| 634 | 
> | 
      return NULL; | 
| 635 | 
> | 
     | 
| 636 | 
> | 
    //push eta into SimInfo::properties which can be | 
| 637 | 
  | 
    //retrieved by integrator later | 
| 638 | 
< | 
    DoubleData* chiValue = new DoubleData(); | 
| 639 | 
< | 
    chiValue->setID(CHIVALUE_ID); | 
| 640 | 
< | 
    chiValue->setData(chi); | 
| 641 | 
< | 
    entry_plug->addProperty(chiValue); | 
| 642 | 
< | 
 | 
| 609 | 
< | 
    DoubleData* integralOfChidtValue = new DoubleData(); | 
| 610 | 
< | 
    integralOfChidtValue->setID(INTEGRALOFCHIDT_ID); | 
| 611 | 
< | 
    integralOfChidtValue->setData(integralOfChidt); | 
| 612 | 
< | 
    entry_plug->addProperty(integralOfChidtValue); | 
| 613 | 
< | 
 | 
| 638 | 
> | 
    //entry_plug->setBoxM( theBoxMat3 ); | 
| 639 | 
> | 
    DoubleArrayData* etaValue = new DoubleArrayData(); | 
| 640 | 
> | 
    etaValue->setID(ETAVALUE_ID); | 
| 641 | 
> | 
    etaValue->setData(eta, 9); | 
| 642 | 
> | 
    entry_plug->addProperty(etaValue); | 
| 643 | 
  | 
  } | 
| 615 | 
– | 
  else | 
| 616 | 
– | 
    return NULL; | 
| 644 | 
  | 
 | 
| 618 | 
– | 
  //get eta | 
| 619 | 
– | 
  for(int i = 0 ; i < 9; i++){ | 
| 620 | 
– | 
    foo = strtok(NULL, " ,;\t"); | 
| 621 | 
– | 
    if(foo == NULL){ | 
| 622 | 
– | 
      sprintf( painCave.errMsg, | 
| 623 | 
– | 
               "error in reading eta[%d] from %s\n", i, c_in_name ); | 
| 624 | 
– | 
      return strdup( painCave.errMsg ); | 
| 625 | 
– | 
    } | 
| 626 | 
– | 
    eta[i] = atof( foo ); | 
| 627 | 
– | 
  } | 
| 628 | 
– | 
 | 
| 629 | 
– | 
  //push eta into SimInfo::properties which can be | 
| 630 | 
– | 
  //retrieved by integrator later | 
| 631 | 
– | 
  //entry_plug->setBoxM( theBoxMat3 ); | 
| 632 | 
– | 
  DoubleArrayData* etaValue = new DoubleArrayData(); | 
| 633 | 
– | 
  etaValue->setID(ETAVALUE_ID); | 
| 634 | 
– | 
  etaValue->setData(eta, 9); | 
| 635 | 
– | 
  entry_plug->addProperty(etaValue); | 
| 636 | 
– | 
 | 
| 637 | 
– | 
 | 
| 645 | 
  | 
  return NULL; | 
| 646 | 
  | 
} | 
| 647 | 
  | 
 |