| 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, |
| 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 |
| 1341 |
|
int k; |
| 1342 |
|
|
| 1343 |
|
NVT<RealIntegrator>* myNVT = NULL; |
| 1344 |
< |
NPTi<RealIntegrator>* myNPTi = NULL; |
| 1345 |
< |
NPTf<RealIntegrator>* myNPTf = NULL; |
| 1346 |
< |
NPTim<RealIntegrator>* myNPTim = NULL; |
| 1349 |
< |
NPTfm<RealIntegrator>* myNPTfm = NULL; |
| 1350 |
< |
|
| 1344 |
> |
NPTi<NPT<RealIntegrator> >* myNPTi = NULL; |
| 1345 |
> |
NPTf<NPT<RealIntegrator> >* myNPTf = NULL; |
| 1346 |
> |
|
| 1347 |
|
for (k = 0; k < nInfo; k++){ |
| 1348 |
|
switch (ensembleCase){ |
| 1349 |
|
case NVE_ENS: |
| 1379 |
|
case NPTi_ENS: |
| 1380 |
|
if (globals->haveZconstraints()){ |
| 1381 |
|
setupZConstraint(info[k]); |
| 1382 |
< |
myNPTi = new ZConstraint<NPTi<RealIntegrator> >(&(info[k]), the_ff); |
| 1382 |
> |
myNPTi = new ZConstraint<NPTi<NPT <RealIntegrator> > >(&(info[k]), the_ff); |
| 1383 |
|
} |
| 1384 |
|
else |
| 1385 |
< |
myNPTi = new NPTi<RealIntegrator>(&(info[k]), the_ff); |
| 1385 |
> |
myNPTi = new NPTi<NPT<RealIntegrator> >(&(info[k]), the_ff); |
| 1386 |
|
|
| 1387 |
|
myNPTi->setTargetTemp(globals->getTargetTemp()); |
| 1388 |
|
|
| 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()); |
| 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()); |
| 1477 |
– |
else{ |
| 1478 |
– |
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, |
| 1489 |
– |
"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()); |
| 1452 |
|
else{ |
| 1453 |
|
sprintf(painCave.errMsg, |
| 1454 |
|
"SimSetup error: If you use an NPT\n" |
| 1458 |
|
} |
| 1459 |
|
break; |
| 1460 |
|
|
| 1506 |
– |
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 |
– |
} |
| 1545 |
– |
break; |
| 1546 |
– |
|
| 1461 |
|
default: |
| 1462 |
|
sprintf(painCave.errMsg, |
| 1463 |
|
"SimSetup Error. Unrecognized ensemble in case statement.\n"); |
| 1529 |
|
} |
| 1530 |
|
theInfo.addProperty(zconsTol); |
| 1531 |
|
|
| 1532 |
< |
//set Force Substraction Policy |
| 1532 |
> |
//set Force Subtraction Policy |
| 1533 |
|
StringData* zconsForcePolicy = new StringData(); |
| 1534 |
|
zconsForcePolicy->setID(ZCONSFORCEPOLICY_ID); |
| 1535 |
|
|
| 1538 |
|
} |
| 1539 |
|
else{ |
| 1540 |
|
sprintf(painCave.errMsg, |
| 1541 |
< |
"ZConstraint Warning: User does not set force substraction policy, " |
| 1542 |
< |
"average force substraction policy is used\n"); |
| 1541 |
> |
"ZConstraint Warning: User does not set force Subtraction policy, " |
| 1542 |
> |
"PolicyByMass is used\n"); |
| 1543 |
|
painCave.isFatal = 0; |
| 1544 |
|
simError(); |
| 1545 |
< |
zconsForcePolicy->setData("BYNUMBER"); |
| 1545 |
> |
zconsForcePolicy->setData("BYMASS"); |
| 1546 |
|
} |
| 1547 |
|
|
| 1548 |
|
theInfo.addProperty(zconsForcePolicy); |
| 1580 |
|
zconsParaData->addItem(tempParaItem); |
| 1581 |
|
} |
| 1582 |
|
|
| 1583 |
+ |
//check the uniqueness of index |
| 1584 |
+ |
if(!zconsParaData->isIndexUnique()){ |
| 1585 |
+ |
sprintf(painCave.errMsg, |
| 1586 |
+ |
"ZConstraint Error: molIndex is not unique\n"); |
| 1587 |
+ |
painCave.isFatal = 1; |
| 1588 |
+ |
simError(); |
| 1589 |
+ |
} |
| 1590 |
+ |
|
| 1591 |
|
//sort the parameters by index of molecules |
| 1592 |
|
zconsParaData->sortByIndex(); |
| 1593 |
< |
|
| 1593 |
> |
|
| 1594 |
|
//push data into siminfo, therefore, we can retrieve later |
| 1595 |
|
theInfo.addProperty(zconsParaData); |
| 1596 |
|
} |