| 1 |
|
#include <algorithm> |
| 2 |
< |
#include <cstdlib> |
| 2 |
> |
#include <stdlib.h> |
| 3 |
|
#include <iostream> |
| 4 |
< |
#include <cmath> |
| 4 |
> |
#include <math.h> |
| 5 |
|
#include <string> |
| 6 |
|
#include <sprng.h> |
| 7 |
+ |
|
| 8 |
|
#include "SimSetup.hpp" |
| 9 |
|
#include "ReadWrite.hpp" |
| 10 |
|
#include "parse_me.h" |
| 32 |
|
using namespace std; |
| 33 |
|
|
| 34 |
|
SimSetup::SimSetup(){ |
| 35 |
+ |
|
| 36 |
+ |
initSuspend = false; |
| 37 |
|
isInfoArray = 0; |
| 38 |
|
nInfo = 1; |
| 39 |
|
|
| 56 |
|
info = the_info; |
| 57 |
|
nInfo = theNinfo; |
| 58 |
|
isInfoArray = 1; |
| 59 |
+ |
initSuspend = true; |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
|
| 103 |
|
// creation of complex system objects |
| 104 |
|
|
| 105 |
|
sysObjectsCreation(); |
| 102 |
– |
|
| 103 |
– |
// check on the post processing info |
| 104 |
– |
|
| 105 |
– |
finalInfoCheck(); |
| 106 |
|
|
| 107 |
|
// initialize the system coordinates |
| 108 |
|
|
| 109 |
< |
if (!isInfoArray){ |
| 109 |
> |
if ( !initSuspend ){ |
| 110 |
|
initSystemCoords(); |
| 111 |
|
|
| 112 |
|
if( !(globals->getUseInitTime()) ) |
| 113 |
|
info[0].currentTime = 0.0; |
| 114 |
|
} |
| 115 |
|
|
| 116 |
+ |
// check on the post processing info |
| 117 |
+ |
|
| 118 |
+ |
finalInfoCheck(); |
| 119 |
+ |
|
| 120 |
|
// make the output filenames |
| 121 |
|
|
| 122 |
|
makeOutNames(); |
| 697 |
|
} |
| 698 |
|
|
| 699 |
|
// check for the temperature set flag |
| 700 |
< |
|
| 700 |
> |
|
| 701 |
|
if (globals->haveTempSet()) |
| 702 |
|
info[i].setTemp = globals->getTempSet(); |
| 703 |
< |
|
| 700 |
< |
// get some of the tricky things that may still be in the globals |
| 701 |
< |
|
| 702 |
< |
double boxVector[3]; |
| 703 |
< |
if (globals->haveBox()){ |
| 704 |
< |
boxVector[0] = globals->getBox(); |
| 705 |
< |
boxVector[1] = globals->getBox(); |
| 706 |
< |
boxVector[2] = globals->getBox(); |
| 707 |
< |
|
| 708 |
< |
info[i].setBox(boxVector); |
| 709 |
< |
} |
| 710 |
< |
else if (globals->haveDensity()){ |
| 711 |
< |
double vol; |
| 712 |
< |
vol = (double) tot_nmol / globals->getDensity(); |
| 713 |
< |
boxVector[0] = pow(vol, (1.0 / 3.0)); |
| 714 |
< |
boxVector[1] = boxVector[0]; |
| 715 |
< |
boxVector[2] = boxVector[0]; |
| 716 |
< |
|
| 717 |
< |
info[i].setBox(boxVector); |
| 718 |
< |
} |
| 719 |
< |
else{ |
| 720 |
< |
if (!globals->haveBoxX()){ |
| 721 |
< |
sprintf(painCave.errMsg, |
| 722 |
< |
"SimSetup error, no periodic BoxX size given.\n"); |
| 723 |
< |
painCave.isFatal = 1; |
| 724 |
< |
simError(); |
| 725 |
< |
} |
| 726 |
< |
boxVector[0] = globals->getBoxX(); |
| 727 |
< |
|
| 728 |
< |
if (!globals->haveBoxY()){ |
| 729 |
< |
sprintf(painCave.errMsg, |
| 730 |
< |
"SimSetup error, no periodic BoxY size given.\n"); |
| 731 |
< |
painCave.isFatal = 1; |
| 732 |
< |
simError(); |
| 733 |
< |
} |
| 734 |
< |
boxVector[1] = globals->getBoxY(); |
| 735 |
< |
|
| 736 |
< |
if (!globals->haveBoxZ()){ |
| 737 |
< |
sprintf(painCave.errMsg, |
| 738 |
< |
"SimSetup error, no periodic BoxZ size given.\n"); |
| 739 |
< |
painCave.isFatal = 1; |
| 740 |
< |
simError(); |
| 741 |
< |
} |
| 742 |
< |
boxVector[2] = globals->getBoxZ(); |
| 743 |
< |
|
| 744 |
< |
info[i].setBox(boxVector); |
| 745 |
< |
} |
| 703 |
> |
|
| 704 |
|
} |
| 705 |
< |
|
| 705 |
> |
|
| 706 |
|
//setup seed for random number generator |
| 707 |
|
int seedValue; |
| 708 |
|
|
| 806 |
|
theEst = globals->getEST(); |
| 807 |
|
} |
| 808 |
|
|
| 809 |
< |
info[i].setEcr(theEcr, theEst); |
| 809 |
> |
info[i].setDefaultEcr(theEcr, theEst); |
| 810 |
|
|
| 811 |
|
if (!globals->haveDielectric()){ |
| 812 |
|
sprintf(painCave.errMsg, |
| 851 |
|
theEst = globals->getEST(); |
| 852 |
|
} |
| 853 |
|
|
| 854 |
< |
info[i].setEcr(theEcr, theEst); |
| 854 |
> |
info[i].setDefaultEcr(theEcr, theEst); |
| 855 |
|
} |
| 856 |
|
} |
| 857 |
+ |
info[i].checkCutOffs(); |
| 858 |
|
} |
| 859 |
|
|
| 860 |
|
#ifdef IS_MPI |
| 1308 |
|
void SimSetup::makeIntegrator(void){ |
| 1309 |
|
int k; |
| 1310 |
|
|
| 1311 |
< |
NVE<RealIntegrator>* myNVE = NULL; |
| 1312 |
< |
NVT<RealIntegrator>* myNVT = NULL; |
| 1313 |
< |
NPTi<NPT<RealIntegrator> >* myNPTi = NULL; |
| 1314 |
< |
NPTf<NPT<RealIntegrator> >* myNPTf = NULL; |
| 1315 |
< |
NPTxyz<NPT<RealIntegrator> >* myNPTxyz = NULL; |
| 1311 |
> |
NVE* myNVE = NULL; |
| 1312 |
> |
NVT* myNVT = NULL; |
| 1313 |
> |
NPTi* myNPTi = NULL; |
| 1314 |
> |
NPTf* myNPTf = NULL; |
| 1315 |
> |
NPTxyz* myNPTxyz = NULL; |
| 1316 |
|
|
| 1317 |
|
for (k = 0; k < nInfo; k++){ |
| 1318 |
|
switch (ensembleCase){ |
| 1319 |
< |
case NVE_ENS: |
| 1320 |
< |
if (globals->haveZconstraints()){ |
| 1362 |
< |
setupZConstraint(info[k]); |
| 1363 |
< |
myNVE = new ZConstraint<NVE<RealIntegrator> >(&(info[k]), the_ff); |
| 1364 |
< |
} |
| 1365 |
< |
else{ |
| 1366 |
< |
myNVE = new NVE<RealIntegrator>(&(info[k]), the_ff); |
| 1367 |
< |
} |
| 1319 |
> |
case NVE_ENS: |
| 1320 |
> |
if (globals->haveZconstraints()){ |
| 1321 |
|
|
| 1322 |
< |
info->the_integrator = myNVE; |
| 1323 |
< |
break; |
| 1324 |
< |
|
| 1325 |
< |
case NVT_ENS: |
| 1326 |
< |
if (globals->haveZconstraints()){ |
| 1327 |
< |
setupZConstraint(info[k]); |
| 1328 |
< |
myNVT = new ZConstraint<NVT<RealIntegrator> >(&(info[k]), the_ff); |
| 1329 |
< |
} |
| 1330 |
< |
else |
| 1331 |
< |
myNVT = new NVT<RealIntegrator>(&(info[k]), the_ff); |
| 1332 |
< |
|
| 1333 |
< |
myNVT->setTargetTemp(globals->getTargetTemp()); |
| 1334 |
< |
|
| 1335 |
< |
if (globals->haveTauThermostat()) |
| 1336 |
< |
myNVT->setTauThermostat(globals->getTauThermostat()); |
| 1337 |
< |
else{ |
| 1338 |
< |
sprintf(painCave.errMsg, |
| 1339 |
< |
"SimSetup error: If you use the NVT\n" |
| 1340 |
< |
" ensemble, you must set tauThermostat.\n"); |
| 1341 |
< |
painCave.isFatal = 1; |
| 1342 |
< |
simError(); |
| 1343 |
< |
} |
| 1344 |
< |
|
| 1345 |
< |
info->the_integrator = myNVT; |
| 1346 |
< |
break; |
| 1347 |
< |
|
| 1348 |
< |
case NPTi_ENS: |
| 1349 |
< |
if (globals->haveZconstraints()){ |
| 1350 |
< |
setupZConstraint(info[k]); |
| 1351 |
< |
myNPTi = new ZConstraint<NPTi<NPT <RealIntegrator> > >(&(info[k]), the_ff); |
| 1352 |
< |
} |
| 1353 |
< |
else |
| 1354 |
< |
myNPTi = new NPTi<NPT<RealIntegrator> >(&(info[k]), the_ff); |
| 1355 |
< |
|
| 1356 |
< |
myNPTi->setTargetTemp(globals->getTargetTemp()); |
| 1357 |
< |
|
| 1358 |
< |
if (globals->haveTargetPressure()) |
| 1359 |
< |
myNPTi->setTargetPressure(globals->getTargetPressure()); |
| 1360 |
< |
else{ |
| 1361 |
< |
sprintf(painCave.errMsg, |
| 1362 |
< |
"SimSetup error: If you use a constant pressure\n" |
| 1363 |
< |
" ensemble, you must set targetPressure in the BASS file.\n"); |
| 1364 |
< |
painCave.isFatal = 1; |
| 1365 |
< |
simError(); |
| 1366 |
< |
} |
| 1367 |
< |
|
| 1368 |
< |
if (globals->haveTauThermostat()) |
| 1369 |
< |
myNPTi->setTauThermostat(globals->getTauThermostat()); |
| 1370 |
< |
else{ |
| 1371 |
< |
sprintf(painCave.errMsg, |
| 1372 |
< |
"SimSetup error: If you use an NPT\n" |
| 1373 |
< |
" ensemble, you must set tauThermostat.\n"); |
| 1374 |
< |
painCave.isFatal = 1; |
| 1375 |
< |
simError(); |
| 1376 |
< |
} |
| 1377 |
< |
|
| 1378 |
< |
if (globals->haveTauBarostat()) |
| 1379 |
< |
myNPTi->setTauBarostat(globals->getTauBarostat()); |
| 1380 |
< |
else{ |
| 1381 |
< |
sprintf(painCave.errMsg, |
| 1382 |
< |
"SimSetup error: If you use an NPT\n" |
| 1383 |
< |
" ensemble, you must set tauBarostat.\n"); |
| 1384 |
< |
painCave.isFatal = 1; |
| 1385 |
< |
simError(); |
| 1386 |
< |
} |
| 1322 |
> |
std::cerr << "ZConstraint is temporarily disabled\n"; |
| 1323 |
> |
|
| 1324 |
> |
// setupZConstraint(info[k]); |
| 1325 |
> |
// myNVE = new ZConstraint<NVE<RealIntegrator> >(&(info[k]), the_ff); |
| 1326 |
> |
} |
| 1327 |
> |
|
| 1328 |
> |
// else{ |
| 1329 |
> |
myNVE = new NVE(&(info[k]), the_ff); |
| 1330 |
> |
// } |
| 1331 |
> |
|
| 1332 |
> |
info->the_integrator = myNVE; |
| 1333 |
> |
break; |
| 1334 |
> |
|
| 1335 |
> |
case NVT_ENS: |
| 1336 |
> |
if (globals->haveZconstraints()){ |
| 1337 |
> |
|
| 1338 |
> |
std::cerr << "ZConstraint is temporarily disabled\n"; |
| 1339 |
> |
|
| 1340 |
> |
// setupZConstraint(info[k]); |
| 1341 |
> |
// myNVT = new ZConstraint<NVT<RealIntegrator> >(&(info[k]), the_ff); |
| 1342 |
> |
} |
| 1343 |
> |
// else |
| 1344 |
> |
myNVT = new NVT(&(info[k]), the_ff); |
| 1345 |
> |
|
| 1346 |
> |
myNVT->setTargetTemp(globals->getTargetTemp()); |
| 1347 |
> |
|
| 1348 |
> |
if (globals->haveTauThermostat()) |
| 1349 |
> |
myNVT->setTauThermostat(globals->getTauThermostat()); |
| 1350 |
> |
else{ |
| 1351 |
> |
sprintf(painCave.errMsg, |
| 1352 |
> |
"SimSetup error: If you use the NVT\n" |
| 1353 |
> |
" ensemble, you must set tauThermostat.\n"); |
| 1354 |
> |
painCave.isFatal = 1; |
| 1355 |
> |
simError(); |
| 1356 |
> |
} |
| 1357 |
> |
|
| 1358 |
> |
info->the_integrator = myNVT; |
| 1359 |
> |
break; |
| 1360 |
> |
|
| 1361 |
> |
case NPTi_ENS: |
| 1362 |
> |
if (globals->haveZconstraints()){ |
| 1363 |
> |
|
| 1364 |
> |
std::cerr << "ZConstraint is temporarily disabled\n"; |
| 1365 |
> |
|
| 1366 |
> |
// setupZConstraint(info[k]); |
| 1367 |
> |
// myNPTi = new ZConstraint<NPTi<NPT <RealIntegrator> > >(&(info[k]), the_ff); |
| 1368 |
> |
} |
| 1369 |
> |
// else |
| 1370 |
> |
myNPTi = new NPTi(&(info[k]), the_ff); |
| 1371 |
> |
|
| 1372 |
> |
myNPTi->setTargetTemp(globals->getTargetTemp()); |
| 1373 |
> |
|
| 1374 |
> |
if (globals->haveTargetPressure()) |
| 1375 |
> |
myNPTi->setTargetPressure(globals->getTargetPressure()); |
| 1376 |
> |
else{ |
| 1377 |
> |
sprintf(painCave.errMsg, |
| 1378 |
> |
"SimSetup error: If you use a constant pressure\n" |
| 1379 |
> |
" ensemble, you must set targetPressure in the BASS file.\n"); |
| 1380 |
> |
painCave.isFatal = 1; |
| 1381 |
> |
simError(); |
| 1382 |
> |
} |
| 1383 |
> |
|
| 1384 |
> |
if (globals->haveTauThermostat()) |
| 1385 |
> |
myNPTi->setTauThermostat(globals->getTauThermostat()); |
| 1386 |
> |
else{ |
| 1387 |
> |
sprintf(painCave.errMsg, |
| 1388 |
> |
"SimSetup error: If you use an NPT\n" |
| 1389 |
> |
" ensemble, you must set tauThermostat.\n"); |
| 1390 |
> |
painCave.isFatal = 1; |
| 1391 |
> |
simError(); |
| 1392 |
> |
} |
| 1393 |
> |
|
| 1394 |
> |
if (globals->haveTauBarostat()) |
| 1395 |
> |
myNPTi->setTauBarostat(globals->getTauBarostat()); |
| 1396 |
> |
else{ |
| 1397 |
> |
sprintf(painCave.errMsg, |
| 1398 |
> |
"SimSetup error: If you use an NPT\n" |
| 1399 |
> |
" ensemble, you must set tauBarostat.\n"); |
| 1400 |
> |
painCave.isFatal = 1; |
| 1401 |
> |
simError(); |
| 1402 |
> |
} |
| 1403 |
> |
|
| 1404 |
> |
info->the_integrator = myNPTi; |
| 1405 |
> |
break; |
| 1406 |
> |
|
| 1407 |
> |
case NPTf_ENS: |
| 1408 |
> |
if (globals->haveZconstraints()){ |
| 1409 |
|
|
| 1410 |
< |
info->the_integrator = myNPTi; |
| 1436 |
< |
break; |
| 1410 |
> |
std::cerr << "ZConstraint is temporarily disabled\n"; |
| 1411 |
|
|
| 1412 |
< |
case NPTf_ENS: |
| 1413 |
< |
if (globals->haveZconstraints()){ |
| 1414 |
< |
setupZConstraint(info[k]); |
| 1415 |
< |
myNPTf = new ZConstraint<NPTf<NPT <RealIntegrator> > >(&(info[k]), the_ff); |
| 1416 |
< |
} |
| 1417 |
< |
else |
| 1418 |
< |
myNPTf = new NPTf<NPT <RealIntegrator> >(&(info[k]), the_ff); |
| 1419 |
< |
|
| 1420 |
< |
myNPTf->setTargetTemp(globals->getTargetTemp()); |
| 1421 |
< |
|
| 1422 |
< |
if (globals->haveTargetPressure()) |
| 1423 |
< |
myNPTf->setTargetPressure(globals->getTargetPressure()); |
| 1424 |
< |
else{ |
| 1425 |
< |
sprintf(painCave.errMsg, |
| 1426 |
< |
"SimSetup error: If you use a constant pressure\n" |
| 1427 |
< |
" ensemble, you must set targetPressure in the BASS file.\n"); |
| 1428 |
< |
painCave.isFatal = 1; |
| 1429 |
< |
simError(); |
| 1430 |
< |
} |
| 1431 |
< |
|
| 1432 |
< |
if (globals->haveTauThermostat()) |
| 1433 |
< |
myNPTf->setTauThermostat(globals->getTauThermostat()); |
| 1434 |
< |
else{ |
| 1435 |
< |
sprintf(painCave.errMsg, |
| 1436 |
< |
"SimSetup error: If you use an NPT\n" |
| 1437 |
< |
" ensemble, you must set tauThermostat.\n"); |
| 1438 |
< |
painCave.isFatal = 1; |
| 1439 |
< |
simError(); |
| 1440 |
< |
} |
| 1441 |
< |
|
| 1442 |
< |
if (globals->haveTauBarostat()) |
| 1443 |
< |
myNPTf->setTauBarostat(globals->getTauBarostat()); |
| 1444 |
< |
else{ |
| 1445 |
< |
sprintf(painCave.errMsg, |
| 1446 |
< |
"SimSetup error: If you use an NPT\n" |
| 1447 |
< |
" ensemble, you must set tauBarostat.\n"); |
| 1448 |
< |
painCave.isFatal = 1; |
| 1449 |
< |
simError(); |
| 1450 |
< |
} |
| 1451 |
< |
|
| 1452 |
< |
info->the_integrator = myNPTf; |
| 1453 |
< |
break; |
| 1454 |
< |
|
| 1455 |
< |
case NPTxyz_ENS: |
| 1456 |
< |
if (globals->haveZconstraints()){ |
| 1457 |
< |
setupZConstraint(info[k]); |
| 1458 |
< |
myNPTxyz = new ZConstraint<NPTxyz<NPT <RealIntegrator> > >(&(info[k]), the_ff); |
| 1459 |
< |
} |
| 1460 |
< |
else |
| 1461 |
< |
myNPTxyz = new NPTxyz<NPT <RealIntegrator> >(&(info[k]), the_ff); |
| 1462 |
< |
|
| 1463 |
< |
myNPTxyz->setTargetTemp(globals->getTargetTemp()); |
| 1464 |
< |
|
| 1491 |
< |
if (globals->haveTargetPressure()) |
| 1492 |
< |
myNPTxyz->setTargetPressure(globals->getTargetPressure()); |
| 1493 |
< |
else{ |
| 1494 |
< |
sprintf(painCave.errMsg, |
| 1495 |
< |
"SimSetup error: If you use a constant pressure\n" |
| 1496 |
< |
" ensemble, you must set targetPressure in the BASS file.\n"); |
| 1497 |
< |
painCave.isFatal = 1; |
| 1498 |
< |
simError(); |
| 1499 |
< |
} |
| 1412 |
> |
// setupZConstraint(info[k]); |
| 1413 |
> |
// myNPTf = new ZConstraint<NPTf<NPT <RealIntegrator> > >(&(info[k]), the_ff); |
| 1414 |
> |
} |
| 1415 |
> |
// else |
| 1416 |
> |
myNPTf = new NPTf(&(info[k]), the_ff); |
| 1417 |
> |
|
| 1418 |
> |
myNPTf->setTargetTemp(globals->getTargetTemp()); |
| 1419 |
> |
|
| 1420 |
> |
if (globals->haveTargetPressure()) |
| 1421 |
> |
myNPTf->setTargetPressure(globals->getTargetPressure()); |
| 1422 |
> |
else{ |
| 1423 |
> |
sprintf(painCave.errMsg, |
| 1424 |
> |
"SimSetup error: If you use a constant pressure\n" |
| 1425 |
> |
" ensemble, you must set targetPressure in the BASS file.\n"); |
| 1426 |
> |
painCave.isFatal = 1; |
| 1427 |
> |
simError(); |
| 1428 |
> |
} |
| 1429 |
> |
|
| 1430 |
> |
if (globals->haveTauThermostat()) |
| 1431 |
> |
myNPTf->setTauThermostat(globals->getTauThermostat()); |
| 1432 |
> |
|
| 1433 |
> |
else{ |
| 1434 |
> |
sprintf(painCave.errMsg, |
| 1435 |
> |
"SimSetup error: If you use an NPT\n" |
| 1436 |
> |
" ensemble, you must set tauThermostat.\n"); |
| 1437 |
> |
painCave.isFatal = 1; |
| 1438 |
> |
simError(); |
| 1439 |
> |
} |
| 1440 |
> |
|
| 1441 |
> |
if (globals->haveTauBarostat()) |
| 1442 |
> |
myNPTf->setTauBarostat(globals->getTauBarostat()); |
| 1443 |
> |
|
| 1444 |
> |
else{ |
| 1445 |
> |
sprintf(painCave.errMsg, |
| 1446 |
> |
"SimSetup error: If you use an NPT\n" |
| 1447 |
> |
" ensemble, you must set tauBarostat.\n"); |
| 1448 |
> |
painCave.isFatal = 1; |
| 1449 |
> |
simError(); |
| 1450 |
> |
} |
| 1451 |
> |
|
| 1452 |
> |
info->the_integrator = myNPTf; |
| 1453 |
> |
break; |
| 1454 |
> |
|
| 1455 |
> |
case NPTxyz_ENS: |
| 1456 |
> |
if (globals->haveZconstraints()){ |
| 1457 |
> |
|
| 1458 |
> |
std::cerr << "ZConstraint is temporarily disabled\n"; |
| 1459 |
> |
|
| 1460 |
> |
// setupZConstraint(info[k]); |
| 1461 |
> |
// myNPTxyz = new ZConstraint<NPTxyz<NPT <RealIntegrator> > >(&(info[k]), the_ff); |
| 1462 |
> |
} |
| 1463 |
> |
// else |
| 1464 |
> |
myNPTxyz = new NPTxyz(&(info[k]), the_ff); |
| 1465 |
|
|
| 1466 |
< |
if (globals->haveTauThermostat()) |
| 1467 |
< |
myNPTxyz->setTauThermostat(globals->getTauThermostat()); |
| 1468 |
< |
else{ |
| 1469 |
< |
sprintf(painCave.errMsg, |
| 1470 |
< |
"SimSetup error: If you use an NPT\n" |
| 1471 |
< |
" ensemble, you must set tauThermostat.\n"); |
| 1472 |
< |
painCave.isFatal = 1; |
| 1473 |
< |
simError(); |
| 1474 |
< |
} |
| 1475 |
< |
|
| 1476 |
< |
if (globals->haveTauBarostat()) |
| 1477 |
< |
myNPTxyz->setTauBarostat(globals->getTauBarostat()); |
| 1478 |
< |
else{ |
| 1479 |
< |
sprintf(painCave.errMsg, |
| 1480 |
< |
"SimSetup error: If you use an NPT\n" |
| 1481 |
< |
" ensemble, you must set tauBarostat.\n"); |
| 1482 |
< |
painCave.isFatal = 1; |
| 1483 |
< |
simError(); |
| 1484 |
< |
} |
| 1485 |
< |
|
| 1486 |
< |
info->the_integrator = myNPTxyz; |
| 1487 |
< |
break; |
| 1488 |
< |
|
| 1489 |
< |
default: |
| 1490 |
< |
sprintf(painCave.errMsg, |
| 1491 |
< |
"SimSetup Error. Unrecognized ensemble in case statement.\n"); |
| 1492 |
< |
painCave.isFatal = 1; |
| 1493 |
< |
simError(); |
| 1466 |
> |
myNPTxyz->setTargetTemp(globals->getTargetTemp()); |
| 1467 |
> |
|
| 1468 |
> |
if (globals->haveTargetPressure()) |
| 1469 |
> |
myNPTxyz->setTargetPressure(globals->getTargetPressure()); |
| 1470 |
> |
else{ |
| 1471 |
> |
sprintf(painCave.errMsg, |
| 1472 |
> |
"SimSetup error: If you use a constant pressure\n" |
| 1473 |
> |
" ensemble, you must set targetPressure in the BASS file.\n"); |
| 1474 |
> |
painCave.isFatal = 1; |
| 1475 |
> |
simError(); |
| 1476 |
> |
} |
| 1477 |
> |
|
| 1478 |
> |
if (globals->haveTauThermostat()) |
| 1479 |
> |
myNPTxyz->setTauThermostat(globals->getTauThermostat()); |
| 1480 |
> |
else{ |
| 1481 |
> |
sprintf(painCave.errMsg, |
| 1482 |
> |
"SimSetup error: If you use an NPT\n" |
| 1483 |
> |
" ensemble, you must set tauThermostat.\n"); |
| 1484 |
> |
painCave.isFatal = 1; |
| 1485 |
> |
simError(); |
| 1486 |
> |
} |
| 1487 |
> |
|
| 1488 |
> |
if (globals->haveTauBarostat()) |
| 1489 |
> |
myNPTxyz->setTauBarostat(globals->getTauBarostat()); |
| 1490 |
> |
else{ |
| 1491 |
> |
sprintf(painCave.errMsg, |
| 1492 |
> |
"SimSetup error: If you use an NPT\n" |
| 1493 |
> |
" ensemble, you must set tauBarostat.\n"); |
| 1494 |
> |
painCave.isFatal = 1; |
| 1495 |
> |
simError(); |
| 1496 |
> |
} |
| 1497 |
> |
|
| 1498 |
> |
info->the_integrator = myNPTxyz; |
| 1499 |
> |
break; |
| 1500 |
> |
|
| 1501 |
> |
default: |
| 1502 |
> |
sprintf(painCave.errMsg, |
| 1503 |
> |
"SimSetup Error. Unrecognized ensemble in case statement.\n"); |
| 1504 |
> |
painCave.isFatal = 1; |
| 1505 |
> |
simError(); |
| 1506 |
|
} |
| 1507 |
|
} |
| 1508 |
|
} |
| 1530 |
|
#endif // is_mpi |
| 1531 |
|
} |
| 1532 |
|
|
| 1533 |
< |
void SimSetup::setupZConstraint(SimInfo& theInfo){ |
| 1534 |
< |
int nZConstraints; |
| 1535 |
< |
ZconStamp** zconStamp; |
| 1533 |
> |
// void SimSetup::setupZConstraint(SimInfo& theInfo){ |
| 1534 |
> |
// int nZConstraints; |
| 1535 |
> |
// ZconStamp** zconStamp; |
| 1536 |
|
|
| 1537 |
< |
if (globals->haveZconstraintTime()){ |
| 1538 |
< |
//add sample time of z-constraint into SimInfo's property list |
| 1539 |
< |
DoubleData* zconsTimeProp = new DoubleData(); |
| 1540 |
< |
zconsTimeProp->setID(ZCONSTIME_ID); |
| 1541 |
< |
zconsTimeProp->setData(globals->getZconsTime()); |
| 1542 |
< |
theInfo.addProperty(zconsTimeProp); |
| 1543 |
< |
} |
| 1544 |
< |
else{ |
| 1545 |
< |
sprintf(painCave.errMsg, |
| 1546 |
< |
"ZConstraint error: If you use an ZConstraint\n" |
| 1547 |
< |
" , you must set sample time.\n"); |
| 1548 |
< |
painCave.isFatal = 1; |
| 1549 |
< |
simError(); |
| 1550 |
< |
} |
| 1537 |
> |
// if (globals->haveZconstraintTime()){ |
| 1538 |
> |
// //add sample time of z-constraint into SimInfo's property list |
| 1539 |
> |
// DoubleData* zconsTimeProp = new DoubleData(); |
| 1540 |
> |
// zconsTimeProp->setID(ZCONSTIME_ID); |
| 1541 |
> |
// zconsTimeProp->setData(globals->getZconsTime()); |
| 1542 |
> |
// theInfo.addProperty(zconsTimeProp); |
| 1543 |
> |
// } |
| 1544 |
> |
// else{ |
| 1545 |
> |
// sprintf(painCave.errMsg, |
| 1546 |
> |
// "ZConstraint error: If you use an ZConstraint\n" |
| 1547 |
> |
// " , you must set sample time.\n"); |
| 1548 |
> |
// painCave.isFatal = 1; |
| 1549 |
> |
// simError(); |
| 1550 |
> |
// } |
| 1551 |
|
|
| 1552 |
< |
//push zconsTol into siminfo, if user does not specify |
| 1553 |
< |
//value for zconsTol, a default value will be used |
| 1554 |
< |
DoubleData* zconsTol = new DoubleData(); |
| 1555 |
< |
zconsTol->setID(ZCONSTOL_ID); |
| 1556 |
< |
if (globals->haveZconsTol()){ |
| 1557 |
< |
zconsTol->setData(globals->getZconsTol()); |
| 1558 |
< |
} |
| 1559 |
< |
else{ |
| 1560 |
< |
double defaultZConsTol = 0.01; |
| 1561 |
< |
sprintf(painCave.errMsg, |
| 1562 |
< |
"ZConstraint Waring: Tolerance for z-constraint methodl is not specified\n" |
| 1563 |
< |
" , default value %f is used.\n", |
| 1564 |
< |
defaultZConsTol); |
| 1565 |
< |
painCave.isFatal = 0; |
| 1566 |
< |
simError(); |
| 1552 |
> |
// //push zconsTol into siminfo, if user does not specify |
| 1553 |
> |
// //value for zconsTol, a default value will be used |
| 1554 |
> |
// DoubleData* zconsTol = new DoubleData(); |
| 1555 |
> |
// zconsTol->setID(ZCONSTOL_ID); |
| 1556 |
> |
// if (globals->haveZconsTol()){ |
| 1557 |
> |
// zconsTol->setData(globals->getZconsTol()); |
| 1558 |
> |
// } |
| 1559 |
> |
// else{ |
| 1560 |
> |
// double defaultZConsTol = 0.01; |
| 1561 |
> |
// sprintf(painCave.errMsg, |
| 1562 |
> |
// "ZConstraint Waring: Tolerance for z-constraint methodl is not specified\n" |
| 1563 |
> |
// " , default value %f is used.\n", |
| 1564 |
> |
// defaultZConsTol); |
| 1565 |
> |
// painCave.isFatal = 0; |
| 1566 |
> |
// simError(); |
| 1567 |
|
|
| 1568 |
< |
zconsTol->setData(defaultZConsTol); |
| 1569 |
< |
} |
| 1570 |
< |
theInfo.addProperty(zconsTol); |
| 1568 |
> |
// zconsTol->setData(defaultZConsTol); |
| 1569 |
> |
// } |
| 1570 |
> |
// theInfo.addProperty(zconsTol); |
| 1571 |
|
|
| 1572 |
< |
//set Force Subtraction Policy |
| 1573 |
< |
StringData* zconsForcePolicy = new StringData(); |
| 1574 |
< |
zconsForcePolicy->setID(ZCONSFORCEPOLICY_ID); |
| 1572 |
> |
// //set Force Subtraction Policy |
| 1573 |
> |
// StringData* zconsForcePolicy = new StringData(); |
| 1574 |
> |
// zconsForcePolicy->setID(ZCONSFORCEPOLICY_ID); |
| 1575 |
|
|
| 1576 |
< |
if (globals->haveZconsForcePolicy()){ |
| 1577 |
< |
zconsForcePolicy->setData(globals->getZconsForcePolicy()); |
| 1578 |
< |
} |
| 1579 |
< |
else{ |
| 1580 |
< |
sprintf(painCave.errMsg, |
| 1581 |
< |
"ZConstraint Warning: User does not set force Subtraction policy, " |
| 1582 |
< |
"PolicyByMass is used\n"); |
| 1583 |
< |
painCave.isFatal = 0; |
| 1584 |
< |
simError(); |
| 1585 |
< |
zconsForcePolicy->setData("BYMASS"); |
| 1586 |
< |
} |
| 1576 |
> |
// if (globals->haveZconsForcePolicy()){ |
| 1577 |
> |
// zconsForcePolicy->setData(globals->getZconsForcePolicy()); |
| 1578 |
> |
// } |
| 1579 |
> |
// else{ |
| 1580 |
> |
// sprintf(painCave.errMsg, |
| 1581 |
> |
// "ZConstraint Warning: User does not set force Subtraction policy, " |
| 1582 |
> |
// "PolicyByMass is used\n"); |
| 1583 |
> |
// painCave.isFatal = 0; |
| 1584 |
> |
// simError(); |
| 1585 |
> |
// zconsForcePolicy->setData("BYMASS"); |
| 1586 |
> |
// } |
| 1587 |
|
|
| 1588 |
< |
theInfo.addProperty(zconsForcePolicy); |
| 1588 |
> |
// theInfo.addProperty(zconsForcePolicy); |
| 1589 |
|
|
| 1590 |
< |
//Determine the name of ouput file and add it into SimInfo's property list |
| 1591 |
< |
//Be careful, do not use inFileName, since it is a pointer which |
| 1592 |
< |
//point to a string at master node, and slave nodes do not contain that string |
| 1590 |
> |
// //Determine the name of ouput file and add it into SimInfo's property list |
| 1591 |
> |
// //Be careful, do not use inFileName, since it is a pointer which |
| 1592 |
> |
// //point to a string at master node, and slave nodes do not contain that string |
| 1593 |
|
|
| 1594 |
< |
string zconsOutput(theInfo.finalName); |
| 1594 |
> |
// string zconsOutput(theInfo.finalName); |
| 1595 |
|
|
| 1596 |
< |
zconsOutput = zconsOutput.substr(0, zconsOutput.rfind(".")) + ".fz"; |
| 1596 |
> |
// zconsOutput = zconsOutput.substr(0, zconsOutput.rfind(".")) + ".fz"; |
| 1597 |
|
|
| 1598 |
< |
StringData* zconsFilename = new StringData(); |
| 1599 |
< |
zconsFilename->setID(ZCONSFILENAME_ID); |
| 1600 |
< |
zconsFilename->setData(zconsOutput); |
| 1598 |
> |
// StringData* zconsFilename = new StringData(); |
| 1599 |
> |
// zconsFilename->setID(ZCONSFILENAME_ID); |
| 1600 |
> |
// zconsFilename->setData(zconsOutput); |
| 1601 |
|
|
| 1602 |
< |
theInfo.addProperty(zconsFilename); |
| 1602 |
> |
// theInfo.addProperty(zconsFilename); |
| 1603 |
|
|
| 1604 |
< |
//setup index, pos and other parameters of z-constraint molecules |
| 1605 |
< |
nZConstraints = globals->getNzConstraints(); |
| 1606 |
< |
theInfo.nZconstraints = nZConstraints; |
| 1604 |
> |
// //setup index, pos and other parameters of z-constraint molecules |
| 1605 |
> |
// nZConstraints = globals->getNzConstraints(); |
| 1606 |
> |
// theInfo.nZconstraints = nZConstraints; |
| 1607 |
|
|
| 1608 |
< |
zconStamp = globals->getZconStamp(); |
| 1609 |
< |
ZConsParaItem tempParaItem; |
| 1608 |
> |
// zconStamp = globals->getZconStamp(); |
| 1609 |
> |
// ZConsParaItem tempParaItem; |
| 1610 |
|
|
| 1611 |
< |
ZConsParaData* zconsParaData = new ZConsParaData(); |
| 1612 |
< |
zconsParaData->setID(ZCONSPARADATA_ID); |
| 1611 |
> |
// ZConsParaData* zconsParaData = new ZConsParaData(); |
| 1612 |
> |
// zconsParaData->setID(ZCONSPARADATA_ID); |
| 1613 |
|
|
| 1614 |
< |
for (int i = 0; i < nZConstraints; i++){ |
| 1615 |
< |
tempParaItem.havingZPos = zconStamp[i]->haveZpos(); |
| 1616 |
< |
tempParaItem.zPos = zconStamp[i]->getZpos(); |
| 1617 |
< |
tempParaItem.zconsIndex = zconStamp[i]->getMolIndex(); |
| 1618 |
< |
tempParaItem.kRatio = zconStamp[i]->getKratio(); |
| 1614 |
> |
// for (int i = 0; i < nZConstraints; i++){ |
| 1615 |
> |
// tempParaItem.havingZPos = zconStamp[i]->haveZpos(); |
| 1616 |
> |
// tempParaItem.zPos = zconStamp[i]->getZpos(); |
| 1617 |
> |
// tempParaItem.zconsIndex = zconStamp[i]->getMolIndex(); |
| 1618 |
> |
// tempParaItem.kRatio = zconStamp[i]->getKratio(); |
| 1619 |
|
|
| 1620 |
< |
zconsParaData->addItem(tempParaItem); |
| 1621 |
< |
} |
| 1620 |
> |
// zconsParaData->addItem(tempParaItem); |
| 1621 |
> |
// } |
| 1622 |
|
|
| 1623 |
< |
//check the uniqueness of index |
| 1624 |
< |
if(!zconsParaData->isIndexUnique()){ |
| 1625 |
< |
sprintf(painCave.errMsg, |
| 1626 |
< |
"ZConstraint Error: molIndex is not unique\n"); |
| 1627 |
< |
painCave.isFatal = 1; |
| 1628 |
< |
simError(); |
| 1629 |
< |
} |
| 1623 |
> |
// //check the uniqueness of index |
| 1624 |
> |
// if(!zconsParaData->isIndexUnique()){ |
| 1625 |
> |
// sprintf(painCave.errMsg, |
| 1626 |
> |
// "ZConstraint Error: molIndex is not unique\n"); |
| 1627 |
> |
// painCave.isFatal = 1; |
| 1628 |
> |
// simError(); |
| 1629 |
> |
// } |
| 1630 |
|
|
| 1631 |
< |
//sort the parameters by index of molecules |
| 1632 |
< |
zconsParaData->sortByIndex(); |
| 1631 |
> |
// //sort the parameters by index of molecules |
| 1632 |
> |
// zconsParaData->sortByIndex(); |
| 1633 |
|
|
| 1634 |
< |
//push data into siminfo, therefore, we can retrieve later |
| 1635 |
< |
theInfo.addProperty(zconsParaData); |
| 1636 |
< |
} |
| 1634 |
> |
// //push data into siminfo, therefore, we can retrieve later |
| 1635 |
> |
// theInfo.addProperty(zconsParaData); |
| 1636 |
> |
// } |