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 906 by mmeineke, Thu Jan 8 15:44:47 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 583 | Line 587 | char* InitializeFromFile::parseCommentLine(char* readL
587    entry_plug->setBoxM( theBoxMat3 );
588  
589    //get chi and integralOfChidt, they should appear by pair
590 <  foo = strtok(NULL, " ,;\t\n");
591 <  if(foo != NULL){
588 <    chi = atof(foo);
589 <
590 >
591 >  if( entry_plug->useInitXSstate ){
592      foo = strtok(NULL, " ,;\t\n");
593 <    if(foo == NULL){
594 <      sprintf( painCave.errMsg,
595 <               "chi and integralOfChidt should appear by pair in %s\n", c_in_name );
596 <      return strdup( painCave.errMsg );
593 >    if(foo != NULL){
594 >      chi = atof(foo);
595 >      
596 >      foo = strtok(NULL, " ,;\t\n");
597 >      if(foo == NULL){
598 >        sprintf( painCave.errMsg,
599 >                 "chi and integralOfChidt should appear by pair in %s\n", c_in_name );
600 >        return strdup( painCave.errMsg );
601 >      }
602 >      integralOfChidt = atof( foo );
603 >      
604 >      //push chi and integralOfChidt into SimInfo::properties which can be
605 >      //retrieved by integrator later
606 >      DoubleData* chiValue = new DoubleData();
607 >      chiValue->setID(CHIVALUE_ID);
608 >      chiValue->setData(chi);
609 >      entry_plug->addProperty(chiValue);
610 >      
611 >      DoubleData* integralOfChidtValue = new DoubleData();
612 >      integralOfChidtValue->setID(INTEGRALOFCHIDT_ID);
613 >      integralOfChidtValue->setData(integralOfChidt);
614 >      entry_plug->addProperty(integralOfChidtValue);
615 >      
616      }
617 <    integralOfChidt = atof( foo );
618 <
619 <    //push chi and integralOfChidt into SimInfo::properties which can be
617 >    else
618 >      return NULL;
619 >    
620 >    //get eta
621 >    for(int i = 0 ; i < 9; i++){
622 >      foo = strtok(NULL, " ,;\t");
623 >      if(foo == NULL){
624 >        sprintf( painCave.errMsg,
625 >                 "error in reading eta[%d] from %s\n", i, c_in_name );
626 >        return strdup( painCave.errMsg );
627 >      }
628 >      eta[i] = atof( foo );
629 >    }
630 >    
631 >    //push eta into SimInfo::properties which can be
632      //retrieved by integrator later
633 <    DoubleData* chiValue = new DoubleData();
634 <    chiValue->setID(CHIVALUE_ID);
635 <    chiValue->setData(chi);
636 <    entry_plug->addProperty(chiValue);
637 <
605 <    DoubleData* integralOfChidtValue = new DoubleData();
606 <    integralOfChidtValue->setID(INTEGRALOFCHIDT_ID);
607 <    integralOfChidtValue->setData(integralOfChidt);
608 <    entry_plug->addProperty(integralOfChidtValue);
609 <
633 >    //entry_plug->setBoxM( theBoxMat3 );
634 >    DoubleArrayData* etaValue = new DoubleArrayData();
635 >    etaValue->setID(ETAVALUE_ID);
636 >    etaValue->setData(eta, 9);
637 >    entry_plug->addProperty(etaValue);
638    }
611  else
612    return NULL;
639  
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
640    return NULL;
641   }
642  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines