--- trunk/OOPSE/libmdtools/SimSetup.cpp 2003/10/21 19:33:19 811 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2003/10/23 19:57:25 814 @@ -4,7 +4,6 @@ #include #include #include - #include "SimSetup.hpp" #include "ReadWrite.hpp" #include "parse_me.h" @@ -22,6 +21,8 @@ #define NVT_ENS 1 #define NPTi_ENS 2 #define NPTf_ENS 3 +#define NPTxyz_ENS 4 + #define FF_DUFF 0 #define FF_LJ 1 @@ -603,6 +604,9 @@ void SimSetup::gatherInfo(void){ } else if (!strcasecmp(ensemble, "NPTf")){ ensembleCase = NPTf_ENS; + } + else if (!strcasecmp(ensemble, "NPTxyz")){ + ensembleCase = NPTxyz_ENS; } else{ sprintf(painCave.errMsg, @@ -1349,6 +1353,7 @@ void SimSetup::makeIntegrator(void){ NVT* myNVT = NULL; NPTi >* myNPTi = NULL; NPTf >* myNPTf = NULL; + NPTxyz >* myNPTxyz = NULL; for (k = 0; k < nInfo; k++){ switch (ensembleCase){ @@ -1471,6 +1476,49 @@ void SimSetup::makeIntegrator(void){ } info->the_integrator = myNPTf; + break; + + case NPTxyz_ENS: + if (globals->haveZconstraints()){ + setupZConstraint(info[k]); + myNPTxyz = new ZConstraint > >(&(info[k]), the_ff); + } + else + myNPTxyz = new NPTxyz >(&(info[k]), the_ff); + + myNPTxyz->setTargetTemp(globals->getTargetTemp()); + + if (globals->haveTargetPressure()) + myNPTxyz->setTargetPressure(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 (globals->haveTauThermostat()) + myNPTxyz->setTauThermostat(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 (globals->haveTauBarostat()) + myNPTxyz->setTauBarostat(globals->getTauBarostat()); + else{ + sprintf(painCave.errMsg, + "SimSetup error: If you use an NPT\n" + " ensemble, you must set tauBarostat.\n"); + painCave.isFatal = 1; + simError(); + } + + info->the_integrator = myNPTxyz; break; default: