--- trunk/OOPSE/libmdtools/SimSetup.cpp 2003/07/16 02:11:02 621 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2003/07/29 16:32:37 656 @@ -24,12 +24,17 @@ #define FF_DUFF 0 #define FF_LJ 1 +#define FF_EAM 2 - SimSetup::SimSetup(){ + + isInfoArray = 0; + nInfo = 1; + stamps = new MakeStamps(); globals = new Globals(); + #ifdef IS_MPI strcpy( checkPointMsg, "SimSetup creation successful" ); MPIcheckPoint(); @@ -40,7 +45,14 @@ SimSetup::~SimSetup(){ delete stamps; delete globals; } + +void SimSetup::setSimInfo( SimInfo* the_info, int theNinfo ) { + info = the_info; + nInfo = theNinfo; + isInfoArray = 1; + } + void SimSetup::parseFile( char* fileName ){ #ifdef IS_MPI @@ -586,6 +598,7 @@ void SimSetup::gatherInfo( void ){ if( !strcasecmp( force_field, "DUFF" )) ffCase = FF_DUFF; else if( !strcasecmp( force_field, "LJ" )) ffCase = FF_LJ; + else if( !strcasecmp( force_field, "EAM" )) ffCase = FF_EAM; else{ sprintf( painCave.errMsg, "SimSetup Error. Unrecognized force field -> %s\n", @@ -762,6 +775,7 @@ void SimSetup::finalInfoCheck( void ){ MPI_Allreduce( &myUse, &usesDipoles, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD ); #endif //is_mpi + double theEcr, theEst; if (globals->getUseRF() ) { info->useReactionField = 1; @@ -777,9 +791,9 @@ void SimSetup::finalInfoCheck( void ){ smallest = info->boxL[0]; if (info->boxL[1] <= smallest) smallest = info->boxL[1]; if (info->boxL[2] <= smallest) smallest = info->boxL[2]; - info->ecr = 0.5 * smallest; + theEcr = 0.5 * smallest; } else { - info->ecr = globals->getECR(); + theEcr = globals->getECR(); } if( !globals->haveEST() ){ @@ -789,10 +803,12 @@ void SimSetup::finalInfoCheck( void ){ ); painCave.isFatal = 0; simError(); - info->est = 0.05 * info->ecr; + theEst = 0.05 * theEcr; } else { - info->est = globals->getEST(); + theEst= globals->getEST(); } + + info->setEcr( theEcr, theEst ); if(!globals->haveDielectric() ){ sprintf( painCave.errMsg, @@ -808,33 +824,35 @@ void SimSetup::finalInfoCheck( void ){ if (usesDipoles) { if( !globals->haveECR() ){ - sprintf( painCave.errMsg, - "SimSetup Warning: using default value of 1/2 the smallest " - "box length for the electrostaticCutoffRadius.\n" - "I hope you have a very fast processor!\n"); - painCave.isFatal = 0; - simError(); - double smallest; - smallest = info->boxL[0]; - if (info->boxL[1] <= smallest) smallest = info->boxL[1]; - if (info->boxL[2] <= smallest) smallest = info->boxL[2]; - info->ecr = 0.5 * smallest; + sprintf( painCave.errMsg, + "SimSetup Warning: using default value of 1/2 the smallest " + "box length for the electrostaticCutoffRadius.\n" + "I hope you have a very fast processor!\n"); + painCave.isFatal = 0; + simError(); + double smallest; + smallest = info->boxL[0]; + if (info->boxL[1] <= smallest) smallest = info->boxL[1]; + if (info->boxL[2] <= smallest) smallest = info->boxL[2]; + theEcr = 0.5 * smallest; } else { - info->ecr = globals->getECR(); + theEcr = globals->getECR(); } if( !globals->haveEST() ){ - sprintf( painCave.errMsg, - "SimSetup Warning: using default value of 5%% of the " - "electrostaticCutoffRadius for the " - "electrostaticSkinThickness\n" - ); - painCave.isFatal = 0; - simError(); - info->est = 0.05 * info->ecr; + sprintf( painCave.errMsg, + "SimSetup Warning: using default value of 0.05 * the " + "electrostaticCutoffRadius for the " + "electrostaticSkinThickness\n" + ); + painCave.isFatal = 0; + simError(); + theEst = 0.05 * theEcr; } else { - info->est = globals->getEST(); + theEst= globals->getEST(); } + + info->setEcr( theEcr, theEst ); } } @@ -857,7 +875,7 @@ void SimSetup::initSystemCoords( void ){ #ifdef IS_MPI }else fileInit = new InitializeFromFile( NULL ); #endif - fileInit->read_xyz( info ); // default velocities on + fileInit->readInit( info ); // default velocities on delete fileInit; } @@ -1025,6 +1043,10 @@ void SimSetup::createFF( void ){ case FF_LJ: the_ff = new LJFF(); + break; + + case FF_EAM: + the_ff = new EAM_FF(); break; default: @@ -1276,20 +1298,20 @@ void SimSetup::makeIntegrator( void ){ void SimSetup::makeIntegrator( void ){ - NVT* myNVT = NULL; - NPTi* myNPTi = NULL; - NPTf* myNPTf = NULL; - NPTim* myNPTim = NULL; - NPTfm* myNPTfm = NULL; + NVT* myNVT = NULL; + NPTi* myNPTi = NULL; + NPTf* myNPTf = NULL; + NPTim* myNPTim = NULL; + NPTfm* myNPTfm = NULL; switch( ensembleCase ){ case NVE_ENS: - new NVE( info, the_ff ); + new NVE( info, the_ff ); break; case NVT_ENS: - myNVT = new NVT( info, the_ff ); + myNVT = new NVT( info, the_ff ); myNVT->setTargetTemp(globals->getTargetTemp()); if (globals->haveTauThermostat()) @@ -1305,7 +1327,7 @@ void SimSetup::makeIntegrator( void ){ break; case NPTi_ENS: - myNPTi = new NPTi( info, the_ff ); + myNPTi = new NPTi( info, the_ff ); myNPTi->setTargetTemp( globals->getTargetTemp() ); if (globals->haveTargetPressure()) @@ -1340,7 +1362,7 @@ void SimSetup::makeIntegrator( void ){ break; case NPTf_ENS: - myNPTf = new NPTf( info, the_ff ); + myNPTf = new NPTf( info, the_ff ); myNPTf->setTargetTemp( globals->getTargetTemp()); if (globals->haveTargetPressure()) @@ -1375,7 +1397,7 @@ void SimSetup::makeIntegrator( void ){ break; case NPTim_ENS: - myNPTim = new NPTim( info, the_ff ); + myNPTim = new NPTim( info, the_ff ); myNPTim->setTargetTemp( globals->getTargetTemp()); if (globals->haveTargetPressure()) @@ -1410,7 +1432,7 @@ void SimSetup::makeIntegrator( void ){ break; case NPTfm_ENS: - myNPTfm = new NPTfm( info, the_ff ); + myNPTfm = new NPTfm( info, the_ff ); myNPTfm->setTargetTemp( globals->getTargetTemp()); if (globals->haveTargetPressure())