--- trunk/OOPSE/libmdtools/SimSetup.cpp 2003/07/14 23:06:48 603 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2003/07/15 03:08:00 604 @@ -14,10 +14,12 @@ // some defines for ensemble and Forcefield cases -#define NVE_ENS 0 -#define NVT_ENS 1 -#define NPTi_ENS 2 -#define NPTf_ENS 3 +#define NVE_ENS 0 +#define NVT_ENS 1 +#define NPTi_ENS 2 +#define NPTf_ENS 3 +#define NPTim_ENS 4 +#define NPTfm_ENS 5 #define FF_DUFF 0 @@ -117,6 +119,8 @@ void SimSetup::createSim( void ){ else if( !strcasecmp( ensemble, "NPTi" ) || !strcasecmp( ensemble, "NPT") ) ensembleCase = NPTi_ENS; else if( !strcasecmp( ensemble, "NPTf" )) ensembleCase = NPTf_ENS; + else if( !strcasecmp( ensemble, "NPTim" )) ensembleCase = NPTim_ENS; + else if( !strcasecmp( ensemble, "NPTfm" )) ensembleCase = NPTfm_ENS; else{ sprintf( painCave.errMsg, "SimSetup Warning. Unrecognized Ensemble -> %s, " @@ -783,6 +787,8 @@ void SimSetup::createSim( void ){ NVT* myNVT = NULL; NPTi* myNPTi = NULL; NPTf* myNPTf = NULL; + NPTim* myNPTim = NULL; + switch( ensembleCase ){ case NVE_ENS: @@ -875,6 +881,41 @@ void SimSetup::createSim( void ){ } break; + case NPTim_ENS: + myNPTim = new NPTim( simnfo, the_ff ); + myNPTim->setTargetTemp( the_globals->getTargetTemp()); + + if (the_globals->haveTargetPressure()) + myNPTim->setTargetPressure(the_globals->getTargetPressure()); + else { + sprintf( painCave.errMsg, + "SimSetup error: If you use a constant pressure\n" + " ensemble, you must set targetPressure in the BASS file.\n"); + painCave.isFatal = 1; + simError(); + } + + if( the_globals->haveTauThermostat() ) + myNPTim->setTauThermostat( the_globals->getTauThermostat() ); + else{ + sprintf( painCave.errMsg, + "SimSetup error: If you use an NPT\n" + " ensemble, you must set tauThermostat.\n"); + painCave.isFatal = 1; + simError(); + } + + if( the_globals->haveTauBarostat() ) + myNPTim->setTauBarostat( the_globals->getTauBarostat() ); + else{ + sprintf( painCave.errMsg, + "SimSetup error: If you use an NPT\n" + " ensemble, you must set tauBarostat.\n"); + painCave.isFatal = 1; + simError(); + } + break; + default: