ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/SimSetup.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/SimSetup.cpp (file contents):
Revision 778 by mmeineke, Fri Sep 19 20:00:27 2003 UTC vs.
Revision 782 by mmeineke, Tue Sep 23 20:34:31 2003 UTC

# Line 22 | Line 22
22   #define NVT_ENS        1
23   #define NPTi_ENS       2
24   #define NPTf_ENS       3
25 #define NPTim_ENS      4
26 #define NPTfm_ENS      5
25  
26   #define FF_DUFF 0
27   #define FF_LJ   1
# Line 603 | Line 601 | void SimSetup::gatherInfo(void){
601    }
602    else if (!strcasecmp(ensemble, "NPTf")){
603      ensembleCase = NPTf_ENS;
606  }
607  else if (!strcasecmp(ensemble, "NPTim")){
608    ensembleCase = NPTim_ENS;
609  }
610  else if (!strcasecmp(ensemble, "NPTfm")){
611    ensembleCase = NPTfm_ENS;
604    }
605    else{
606      sprintf(painCave.errMsg,
# Line 1348 | Line 1340 | void SimSetup::makeIntegrator(void){
1340   void SimSetup::makeIntegrator(void){
1341    int k;
1342  
1343 +  NVE<RealIntegrator>* myNVE = NULL;
1344    NVT<RealIntegrator>* myNVT = NULL;
1345    NPTi<NPT<RealIntegrator> >* myNPTi = NULL;
1346 <  NPTf<RealIntegrator>* myNPTf = NULL;
1354 <  NPTim<RealIntegrator>* myNPTim = NULL;
1355 <  NPTfm<RealIntegrator>* myNPTfm = NULL;
1346 >  NPTf<NPT<RealIntegrator> >* myNPTf = NULL;
1347    
1348    for (k = 0; k < nInfo; k++){
1349      switch (ensembleCase){
1350        case NVE_ENS:
1351          if (globals->haveZconstraints()){
1352            setupZConstraint(info[k]);
1353 <          new ZConstraint<NVE<RealIntegrator> >(&(info[k]), the_ff);
1353 >          myNVE = new ZConstraint<NVE<RealIntegrator> >(&(info[k]), the_ff);
1354          }
1355 <        else
1356 <          new NVE<RealIntegrator>(&(info[k]), the_ff);
1355 >        else{
1356 >          myNVE = new NVE<RealIntegrator>(&(info[k]), the_ff);
1357 >        }
1358 >        
1359 >        info->the_integrator = myNVE;
1360          break;
1361  
1362        case NVT_ENS:
# Line 1384 | Line 1378 | void SimSetup::makeIntegrator(void){
1378            painCave.isFatal = 1;
1379            simError();
1380          }
1381 +
1382 +        info->the_integrator = myNVT;
1383          break;
1384  
1385        case NPTi_ENS:
# Line 1425 | Line 1421 | void SimSetup::makeIntegrator(void){
1421            painCave.isFatal = 1;
1422            simError();
1423          }
1424 +
1425 +        info->the_integrator = myNPTi;
1426          break;
1427  
1428        case NPTf_ENS:
1429          if (globals->haveZconstraints()){
1430            setupZConstraint(info[k]);
1431 <          myNPTf = new ZConstraint<NPTf<RealIntegrator> >(&(info[k]), the_ff);
1431 >          myNPTf = new ZConstraint<NPTf<NPT <RealIntegrator> > >(&(info[k]), the_ff);
1432          }
1433          else
1434 <          myNPTf = new NPTf<RealIntegrator>(&(info[k]), the_ff);
1434 >          myNPTf = new NPTf<NPT <RealIntegrator> >(&(info[k]), the_ff);
1435  
1436          myNPTf->setTargetTemp(globals->getTargetTemp());
1437  
# Line 1459 | Line 1457 | void SimSetup::makeIntegrator(void){
1457  
1458          if (globals->haveTauBarostat())
1459            myNPTf->setTauBarostat(globals->getTauBarostat());
1462        else{
1463          sprintf(painCave.errMsg,
1464                  "SimSetup error: If you use an NPT\n"
1465                  "    ensemble, you must set tauBarostat.\n");
1466          painCave.isFatal = 1;
1467          simError();
1468        }
1469        break;
1470
1471      case NPTim_ENS:
1472        if (globals->haveZconstraints()){
1473          setupZConstraint(info[k]);
1474          myNPTim = new ZConstraint<NPTim<RealIntegrator> >(&(info[k]), the_ff);
1475        }
1476        else
1477          myNPTim = new NPTim<RealIntegrator>(&(info[k]), the_ff);
1478
1479        myNPTim->setTargetTemp(globals->getTargetTemp());
1480
1481        if (globals->haveTargetPressure())
1482          myNPTim->setTargetPressure(globals->getTargetPressure());
1483        else{
1484          sprintf(painCave.errMsg,
1485                  "SimSetup error: If you use a constant pressure\n"
1486                  "    ensemble, you must set targetPressure in the BASS file.\n");
1487          painCave.isFatal = 1;
1488          simError();
1489        }
1490
1491        if (globals->haveTauThermostat())
1492          myNPTim->setTauThermostat(globals->getTauThermostat());
1460          else{
1461            sprintf(painCave.errMsg,
1462                    "SimSetup error: If you use an NPT\n"
1496                  "    ensemble, you must set tauThermostat.\n");
1497          painCave.isFatal = 1;
1498          simError();
1499        }
1500
1501        if (globals->haveTauBarostat())
1502          myNPTim->setTauBarostat(globals->getTauBarostat());
1503        else{
1504          sprintf(painCave.errMsg,
1505                  "SimSetup error: If you use an NPT\n"
1463                    "    ensemble, you must set tauBarostat.\n");
1464            painCave.isFatal = 1;
1465            simError();
1466          }
1510        break;
1467  
1468 <      case NPTfm_ENS:
1513 <        if (globals->haveZconstraints()){
1514 <          setupZConstraint(info[k]);
1515 <          myNPTfm = new ZConstraint<NPTfm<RealIntegrator> >(&(info[k]), the_ff);
1516 <        }
1517 <        else
1518 <          myNPTfm = new NPTfm<RealIntegrator>(&(info[k]), the_ff);
1519 <
1520 <        myNPTfm->setTargetTemp(globals->getTargetTemp());
1521 <
1522 <        if (globals->haveTargetPressure())
1523 <          myNPTfm->setTargetPressure(globals->getTargetPressure());
1524 <        else{
1525 <          sprintf(painCave.errMsg,
1526 <                  "SimSetup error: If you use a constant pressure\n"
1527 <                  "    ensemble, you must set targetPressure in the BASS file.\n");
1528 <          painCave.isFatal = 1;
1529 <          simError();
1530 <        }
1531 <
1532 <        if (globals->haveTauThermostat())
1533 <          myNPTfm->setTauThermostat(globals->getTauThermostat());
1534 <        else{
1535 <          sprintf(painCave.errMsg,
1536 <                  "SimSetup error: If you use an NPT\n"
1537 <                  "    ensemble, you must set tauThermostat.\n");
1538 <          painCave.isFatal = 1;
1539 <          simError();
1540 <        }
1541 <
1542 <        if (globals->haveTauBarostat())
1543 <          myNPTfm->setTauBarostat(globals->getTauBarostat());
1544 <        else{
1545 <          sprintf(painCave.errMsg,
1546 <                  "SimSetup error: If you use an NPT\n"
1547 <                  "    ensemble, you must set tauBarostat.\n");
1548 <          painCave.isFatal = 1;
1549 <          simError();
1550 <        }
1468 >        info->the_integrator = myNPTf;
1469          break;
1470  
1471        default:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines