ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/InitializeFromFile.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/InitializeFromFile.cpp (file contents):
Revision 837 by tim, Wed Oct 29 00:19:10 2003 UTC vs.
Revision 1097 by gezelter, Mon Apr 12 20:32:20 2004 UTC

# Line 45 | Line 45 | InitializeFromFile::InitializeFromFile( char *in_name
45    strcpy( c_in_name, in_name);
46   #ifdef IS_MPI
47    }
48 < strcpy( checkPointMsg, "Infile opened for reading successfully." );
48 >  else{
49 >          sprintf( c_in_name, "mpiNodeParser_%d", worldRank );
50 >  }
51 >  
52 >  strcpy( checkPointMsg, "Infile opened for reading successfully." );
53    MPIcheckPoint();
54   #endif
55    return;
# Line 261 | Line 265 | void InitializeFromFile :: readInit( SimInfo* the_simn
265        }
266      }
267      myStatus = -1;
268 <    for (j = 0; j < mpiSim->getNumberProcessors(); j++) {
268 >    for (j = 1; j < mpiSim->getNumberProcessors(); j++) {
269        MPI_Send( &myStatus, 1, MPI_INT, j,
270                  TAKE_THIS_TAG_INT, MPI_COMM_WORLD);
271      }
# Line 323 | Line 327 | char* InitializeFromFile::parseDumpLine(char* readLine
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;
# Line 486 | Line 490 | char* InitializeFromFile::parseDumpLine(char* readLine
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){
# Line 496 | Line 500 | char* InitializeFromFile::parseDumpLine(char* readLine
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){
# Line 506 | Line 510 | char* InitializeFromFile::parseDumpLine(char* readLine
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  
# Line 524 | Line 528 | char* InitializeFromFile::parseDumpLine(char* readLine
528  
529      // add the angular velocities
530  
531 <    dAtom->setJx( jx );
528 <    dAtom->setJy( jy );
529 <    dAtom->setJz( jz );
531 >    dAtom->setJ( ji );
532    }
533  
534    // add the positions and velocities to the atom
# Line 583 | Line 585 | char* InitializeFromFile::parseCommentLine(char* readL
585    entry_plug->setBoxM( theBoxMat3 );
586  
587    //get chi and integralOfChidt, they should appear by pair
586  foo = strtok(NULL, " ,;\t\n");
587  if(foo != NULL){
588    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 <
605 <    DoubleData* integralOfChidtValue = new DoubleData();
606 <    integralOfChidtValue->setID(INTEGRALOFCHIDT_ID);
607 <    integralOfChidtValue->setData(integralOfChidt);
608 <    entry_plug->addProperty(integralOfChidtValue);
609 <
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    }
611  else
612    return NULL;
644  
614  //get eta
615  for(int i = 0 ; i < 9; i++){
616    foo = strtok(NULL, " ,;\t");
617    if(foo == NULL){
618      sprintf( painCave.errMsg,
619               "error in reading eta[%d] from %s\n", i, c_in_name );
620      return strdup( painCave.errMsg );
621    }
622    eta[i] = atof( foo );
623  }
624
625  //push eta into SimInfo::properties which can be
626  //retrieved by integrator later
627  //entry_plug->setBoxM( theBoxMat3 );
628  DoubleArrayData* etaValue = new DoubleArrayData();
629  etaValue->setID(ETAVALUE_ID);
630  etaValue->setData(eta, 9);
631  entry_plug->addProperty(etaValue);
632
633
645    return NULL;
646   }
647  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines