--- trunk/OOPSE/libmdtools/SimSetup.cpp 2003/06/19 19:21:23 558 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2003/06/20 20:29:36 561 @@ -97,7 +97,7 @@ void SimSetup::createSim( void ){ n_components = the_globals->getNComponents(); strcpy( force_field, the_globals->getForceField() ); - if( !strcasecmp( force_field, "DUFF" )) ffCase = FF_DUFF; + if( !strcasecmp( force_field, "DUFF" )) ffCase = FF_DUFF; else if( !strcasecmp( force_field, "LJ" )) ffCase = FF_LJ; else{ sprintf( painCave.errMsg, @@ -110,9 +110,9 @@ void SimSetup::createSim( void ){ // get the ensemble: strcpy( ensemble, the_globals->getEnsemble() ); - if( !strcasecmp( ensemble, "NVE" )) ffCase = NVE_ENS; - else if( !strcasecmp( ensemble, "NVT" )) ffCase = NVT_ENS; - else if( !strcasecmp( ensemble, "NPT" )) ffCase = NPT_ENS; + if( !strcasecmp( ensemble, "NVE" )) ensembleCase = NVE_ENS; + else if( !strcasecmp( ensemble, "NVT" )) ensembleCase = NVT_ENS; + else if( !strcasecmp( ensemble, "NPT" )) ensembleCase = NPT_ENS; else{ sprintf( painCave.errMsg, "SimSetup Warning. Unrecognized Ensemble -> %s, " @@ -193,7 +193,7 @@ void SimSetup::createSim( void ){ break; case FF_LJ: - the_ff = LJFF(); + the_ff = new LJFF(); break; default: @@ -768,11 +768,31 @@ void SimSetup::createSim( void ){ // make the integrator - + + + NVT* myNVT = NULL; switch( ensembleCase ){ case NVE_ENS: new NVE( simnfo, the_ff ); + break; + + case NVT_ENS: + myNVT = new NVT( simnfo, the_ff ); + myNVT->setTargetTemp(the_globals->getTargetTemp()); + + 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"); + painCave.isFatal = 1; + simError(); + } break; default: