--- trunk/OOPSE/libmdtools/SimSetup.cpp 2003/07/09 15:33:46 582 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2003/07/09 22:14:06 586 @@ -780,7 +780,9 @@ void SimSetup::createSim( void ){ // make the integrator - NVT* myNVT = NULL; + NVT* myNVT = NULL; + NPTi* myNPTi = NULL; + NPTf* myNPTf = NULL; switch( ensembleCase ){ case NVE_ENS: @@ -793,17 +795,87 @@ void SimSetup::createSim( void ){ if (the_globals->haveTauThermostat()) myNVT->setTauThermostat(the_globals->getTauThermostat()); -// else if (the_globals->haveQmass()) -// myNVT->setQmass(the_globals->getQmass()); + else { sprintf( painCave.errMsg, "SimSetup error: If you use the NVT\n" - " ensemble, you must set either tauThermostat or qMass.\n" - " Neither of these was found in the BASS file.\n"); + " ensemble, you must set tauThermostat.\n"); + painCave.isFatal = 1; + simError(); + } + break; + + case NPTi_ENS: + myNPTi = new NPTi( simnfo, the_ff ); + myNPTi->setTargetTemp( the_globals->getTargetTemp()); + + if (the_globals->haveTargetPressure()) + myNPTi->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() ) + myNPTi->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() ) + myNPTi->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; + + case NPTf_ENS: + myNPTf = new NPTf( simnfo, the_ff ); + myNPTf->setTargetTemp( the_globals->getTargetTemp()); + + if (the_globals->haveTargetPressure()) + myNPTf->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() ) + myNPTf->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() ) + myNPTf->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: sprintf( painCave.errMsg,