| 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 | 
| 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, | 
| 1342 |  |  | 
| 1343 |  | NVT<RealIntegrator>* myNVT = NULL; | 
| 1344 |  | NPTi<NPT<RealIntegrator> >* myNPTi = NULL; | 
| 1345 | < | NPTf<RealIntegrator>* myNPTf = NULL; | 
| 1354 | < | NPTim<RealIntegrator>* myNPTim = NULL; | 
| 1355 | < | NPTfm<RealIntegrator>* myNPTfm = NULL; | 
| 1345 | > | NPTf<NPT<RealIntegrator> >* myNPTf = NULL; | 
| 1346 |  |  | 
| 1347 |  | for (k = 0; k < nInfo; k++){ | 
| 1348 |  | switch (ensembleCase){ | 
| 1420 |  | case NPTf_ENS: | 
| 1421 |  | if (globals->haveZconstraints()){ | 
| 1422 |  | setupZConstraint(info[k]); | 
| 1423 | < | myNPTf = new ZConstraint<NPTf<RealIntegrator> >(&(info[k]), the_ff); | 
| 1423 | > | myNPTf = new ZConstraint<NPTf<NPT <RealIntegrator> > >(&(info[k]), the_ff); | 
| 1424 |  | } | 
| 1425 |  | else | 
| 1426 | < | myNPTf = new NPTf<RealIntegrator>(&(info[k]), the_ff); | 
| 1426 | > | myNPTf = new NPTf<NPT <RealIntegrator> >(&(info[k]), the_ff); | 
| 1427 |  |  | 
| 1428 |  | myNPTf->setTargetTemp(globals->getTargetTemp()); | 
| 1429 |  |  | 
| 1449 |  |  | 
| 1450 |  | if (globals->haveTauBarostat()) | 
| 1451 |  | 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()); | 
| 1493 | – | else{ | 
| 1494 | – | sprintf(painCave.errMsg, | 
| 1495 | – | "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()); | 
| 1452 |  | else{ | 
| 1453 |  | sprintf(painCave.errMsg, | 
| 1454 |  | "SimSetup error: If you use an NPT\n" | 
| 1458 |  | } | 
| 1459 |  | break; | 
| 1460 |  |  | 
| 1512 | – | 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 | – | } | 
| 1551 | – | break; | 
| 1552 | – |  | 
| 1461 |  | default: | 
| 1462 |  | sprintf(painCave.errMsg, | 
| 1463 |  | "SimSetup Error. Unrecognized ensemble in case statement.\n"); |