# | 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 686 | Line 678 | void SimSetup::gatherInfo(void){ | |
678 | ||
679 | if (globals->haveThermalTime()){ | |
680 | info[i].thermalTime = globals->getThermalTime(); | |
681 | + | } |
682 | + | |
683 | + | info[i].resetIntegrator = 0; |
684 | + | if( globals->haveResetTime() ){ |
685 | + | info[i].resetTime = globals->getResetTime(); |
686 | + | info[i].resetIntegrator = 1; |
687 | } | |
688 | ||
689 | // check for the temperature set flag | |
# | Line 1342 | 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<RealIntegrator>* myNPTi = NULL; |
1346 | < | NPTf<RealIntegrator>* myNPTf = NULL; |
1348 | < | NPTim<RealIntegrator>* myNPTim = NULL; |
1349 | < | NPTfm<RealIntegrator>* myNPTfm = NULL; |
1345 | > | NPTi<NPT<RealIntegrator> >* myNPTi = 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 1378 | 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: | |
1386 | if (globals->haveZconstraints()){ | |
1387 | setupZConstraint(info[k]); | |
1388 | < | myNPTi = new ZConstraint<NPTi<RealIntegrator> >(&(info[k]), the_ff); |
1388 | > | myNPTi = new ZConstraint<NPTi<NPT <RealIntegrator> > >(&(info[k]), the_ff); |
1389 | } | |
1390 | else | |
1391 | < | myNPTi = new NPTi<RealIntegrator>(&(info[k]), the_ff); |
1391 | > | myNPTi = new NPTi<NPT<RealIntegrator> >(&(info[k]), the_ff); |
1392 | ||
1393 | myNPTi->setTargetTemp(globals->getTargetTemp()); | |
1394 | ||
# | Line 1419 | 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 1453 | Line 1457 | void SimSetup::makeIntegrator(void){ | |
1457 | ||
1458 | if (globals->haveTauBarostat()) | |
1459 | myNPTf->setTauBarostat(globals->getTauBarostat()); | |
1456 | – | else{ |
1457 | – | sprintf(painCave.errMsg, |
1458 | – | "SimSetup error: If you use an NPT\n" |
1459 | – | " ensemble, you must set tauBarostat.\n"); |
1460 | – | painCave.isFatal = 1; |
1461 | – | simError(); |
1462 | – | } |
1463 | – | break; |
1464 | – | |
1465 | – | case NPTim_ENS: |
1466 | – | if (globals->haveZconstraints()){ |
1467 | – | setupZConstraint(info[k]); |
1468 | – | myNPTim = new ZConstraint<NPTim<RealIntegrator> >(&(info[k]), the_ff); |
1469 | – | } |
1470 | – | else |
1471 | – | myNPTim = new NPTim<RealIntegrator>(&(info[k]), the_ff); |
1472 | – | |
1473 | – | myNPTim->setTargetTemp(globals->getTargetTemp()); |
1474 | – | |
1475 | – | if (globals->haveTargetPressure()) |
1476 | – | myNPTim->setTargetPressure(globals->getTargetPressure()); |
1460 | else{ | |
1461 | sprintf(painCave.errMsg, | |
1479 | – | "SimSetup error: If you use a constant pressure\n" |
1480 | – | " ensemble, you must set targetPressure in the BASS file.\n"); |
1481 | – | painCave.isFatal = 1; |
1482 | – | simError(); |
1483 | – | } |
1484 | – | |
1485 | – | if (globals->haveTauThermostat()) |
1486 | – | myNPTim->setTauThermostat(globals->getTauThermostat()); |
1487 | – | else{ |
1488 | – | sprintf(painCave.errMsg, |
1462 | "SimSetup error: If you use an NPT\n" | |
1490 | – | " ensemble, you must set tauThermostat.\n"); |
1491 | – | painCave.isFatal = 1; |
1492 | – | simError(); |
1493 | – | } |
1494 | – | |
1495 | – | if (globals->haveTauBarostat()) |
1496 | – | myNPTim->setTauBarostat(globals->getTauBarostat()); |
1497 | – | else{ |
1498 | – | sprintf(painCave.errMsg, |
1499 | – | "SimSetup error: If you use an NPT\n" |
1463 | " ensemble, you must set tauBarostat.\n"); | |
1464 | painCave.isFatal = 1; | |
1465 | simError(); | |
1466 | } | |
1504 | – | break; |
1467 | ||
1468 | < | case NPTfm_ENS: |
1507 | < | if (globals->haveZconstraints()){ |
1508 | < | setupZConstraint(info[k]); |
1509 | < | myNPTfm = new ZConstraint<NPTfm<RealIntegrator> >(&(info[k]), the_ff); |
1510 | < | } |
1511 | < | else |
1512 | < | myNPTfm = new NPTfm<RealIntegrator>(&(info[k]), the_ff); |
1513 | < | |
1514 | < | myNPTfm->setTargetTemp(globals->getTargetTemp()); |
1515 | < | |
1516 | < | if (globals->haveTargetPressure()) |
1517 | < | myNPTfm->setTargetPressure(globals->getTargetPressure()); |
1518 | < | else{ |
1519 | < | sprintf(painCave.errMsg, |
1520 | < | "SimSetup error: If you use a constant pressure\n" |
1521 | < | " ensemble, you must set targetPressure in the BASS file.\n"); |
1522 | < | painCave.isFatal = 1; |
1523 | < | simError(); |
1524 | < | } |
1525 | < | |
1526 | < | if (globals->haveTauThermostat()) |
1527 | < | myNPTfm->setTauThermostat(globals->getTauThermostat()); |
1528 | < | else{ |
1529 | < | sprintf(painCave.errMsg, |
1530 | < | "SimSetup error: If you use an NPT\n" |
1531 | < | " ensemble, you must set tauThermostat.\n"); |
1532 | < | painCave.isFatal = 1; |
1533 | < | simError(); |
1534 | < | } |
1535 | < | |
1536 | < | if (globals->haveTauBarostat()) |
1537 | < | myNPTfm->setTauBarostat(globals->getTauBarostat()); |
1538 | < | else{ |
1539 | < | sprintf(painCave.errMsg, |
1540 | < | "SimSetup error: If you use an NPT\n" |
1541 | < | " ensemble, you must set tauBarostat.\n"); |
1542 | < | painCave.isFatal = 1; |
1543 | < | simError(); |
1544 | < | } |
1468 | > | info->the_integrator = myNPTf; |
1469 | break; | |
1470 | ||
1471 | default: |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |