--- trunk/OOPSE/libmdtools/InitializeFromFile.cpp 2004/01/07 19:26:12 905 +++ trunk/OOPSE/libmdtools/InitializeFromFile.cpp 2004/01/08 15:44:47 906 @@ -587,54 +587,56 @@ char* InitializeFromFile::parseCommentLine(char* readL entry_plug->setBoxM( theBoxMat3 ); //get chi and integralOfChidt, they should appear by pair - foo = strtok(NULL, " ,;\t\n"); - if(foo != NULL){ - chi = atof(foo); + if( entry_plug->useInitXSstate ){ foo = strtok(NULL, " ,;\t\n"); - if(foo == NULL){ - sprintf( painCave.errMsg, - "chi and integralOfChidt should appear by pair in %s\n", c_in_name ); - return strdup( painCave.errMsg ); + if(foo != NULL){ + chi = atof(foo); + + foo = strtok(NULL, " ,;\t\n"); + if(foo == NULL){ + sprintf( painCave.errMsg, + "chi and integralOfChidt should appear by pair in %s\n", c_in_name ); + return strdup( painCave.errMsg ); + } + integralOfChidt = atof( foo ); + + //push chi and integralOfChidt into SimInfo::properties which can be + //retrieved by integrator later + DoubleData* chiValue = new DoubleData(); + chiValue->setID(CHIVALUE_ID); + chiValue->setData(chi); + entry_plug->addProperty(chiValue); + + DoubleData* integralOfChidtValue = new DoubleData(); + integralOfChidtValue->setID(INTEGRALOFCHIDT_ID); + integralOfChidtValue->setData(integralOfChidt); + entry_plug->addProperty(integralOfChidtValue); + } - integralOfChidt = atof( foo ); - - //push chi and integralOfChidt into SimInfo::properties which can be + else + return NULL; + + //get eta + for(int i = 0 ; i < 9; i++){ + foo = strtok(NULL, " ,;\t"); + if(foo == NULL){ + sprintf( painCave.errMsg, + "error in reading eta[%d] from %s\n", i, c_in_name ); + return strdup( painCave.errMsg ); + } + eta[i] = atof( foo ); + } + + //push eta into SimInfo::properties which can be //retrieved by integrator later - DoubleData* chiValue = new DoubleData(); - chiValue->setID(CHIVALUE_ID); - chiValue->setData(chi); - entry_plug->addProperty(chiValue); - - DoubleData* integralOfChidtValue = new DoubleData(); - integralOfChidtValue->setID(INTEGRALOFCHIDT_ID); - integralOfChidtValue->setData(integralOfChidt); - entry_plug->addProperty(integralOfChidtValue); - + //entry_plug->setBoxM( theBoxMat3 ); + DoubleArrayData* etaValue = new DoubleArrayData(); + etaValue->setID(ETAVALUE_ID); + etaValue->setData(eta, 9); + entry_plug->addProperty(etaValue); } - else - return NULL; - //get eta - for(int i = 0 ; i < 9; i++){ - foo = strtok(NULL, " ,;\t"); - if(foo == NULL){ - sprintf( painCave.errMsg, - "error in reading eta[%d] from %s\n", i, c_in_name ); - return strdup( painCave.errMsg ); - } - eta[i] = atof( foo ); - } - - //push eta into SimInfo::properties which can be - //retrieved by integrator later - //entry_plug->setBoxM( theBoxMat3 ); - DoubleArrayData* etaValue = new DoubleArrayData(); - etaValue->setID(ETAVALUE_ID); - etaValue->setData(eta, 9); - entry_plug->addProperty(etaValue); - - return NULL; }