| 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 | 
| 90 | 
  | 
#endif // is_mpi | 
| 91 | 
  | 
 | 
| 92 | 
  | 
void SimSetup::createSim(void){ | 
| 95 | 
– | 
  int i, j, k, globalAtomIndex; | 
| 93 | 
  | 
 | 
| 94 | 
  | 
  // gather all of the information from the Bass file | 
| 95 | 
  | 
 | 
| 107 | 
  | 
 | 
| 108 | 
  | 
  if (!isInfoArray){ | 
| 109 | 
  | 
    initSystemCoords(); | 
| 110 | 
+ | 
 | 
| 111 | 
+ | 
    if( !(globals->getUseInitTime()) ) | 
| 112 | 
+ | 
      info[0].currentTime = 0.0; | 
| 113 | 
  | 
  }   | 
| 114 | 
  | 
 | 
| 115 | 
  | 
  // make the output filenames | 
| 131 | 
  | 
 | 
| 132 | 
  | 
 | 
| 133 | 
  | 
void SimSetup::makeMolecules(void){ | 
| 134 | 
< | 
  int k, l; | 
| 134 | 
> | 
  int k; | 
| 135 | 
  | 
  int i, j, exI, exJ, tempEx, stampID, atomOffset, excludeOffset; | 
| 136 | 
  | 
  molInit molInfo; | 
| 137 | 
  | 
  DirectionalAtom* dAtom; | 
| 553 | 
  | 
 | 
| 554 | 
  | 
 | 
| 555 | 
  | 
void SimSetup::gatherInfo(void){ | 
| 556 | 
< | 
  int i, j, k; | 
| 556 | 
> | 
  int i; | 
| 557 | 
  | 
 | 
| 558 | 
  | 
  ensembleCase = -1; | 
| 559 | 
  | 
  ffCase = -1; | 
| 603 | 
  | 
  } | 
| 604 | 
  | 
  else if (!strcasecmp(ensemble, "NPTf")){ | 
| 605 | 
  | 
    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; | 
| 606 | 
  | 
  } | 
| 607 | 
  | 
  else{ | 
| 608 | 
  | 
    sprintf(painCave.errMsg, | 
| 916 | 
  | 
    if (worldRank == 0){ | 
| 917 | 
  | 
#endif //is_mpi | 
| 918 | 
  | 
      inName = globals->getInitialConfig(); | 
| 925 | 
– | 
      double* tempDouble = new double[1000000]; | 
| 919 | 
  | 
      fileInit = new InitializeFromFile(inName); | 
| 920 | 
  | 
#ifdef IS_MPI | 
| 921 | 
  | 
    } | 
| 933 | 
  | 
 | 
| 934 | 
  | 
    sprintf(painCave.errMsg, | 
| 935 | 
  | 
            "Cannot intialize a parallel simulation without an initial configuration file.\n"); | 
| 936 | 
< | 
    painCave.isFatal; | 
| 936 | 
> | 
    painCave.isFatal = 1;; | 
| 937 | 
  | 
    simError(); | 
| 938 | 
  | 
 | 
| 939 | 
  | 
#else | 
| 1159 | 
  | 
} | 
| 1160 | 
  | 
 | 
| 1161 | 
  | 
void SimSetup::calcSysValues(void){ | 
| 1162 | 
< | 
  int i, j, k; | 
| 1162 | 
> | 
  int i; | 
| 1163 | 
  | 
 | 
| 1164 | 
  | 
  int* molMembershipArray; | 
| 1165 | 
  | 
 | 
| 1258 | 
  | 
 | 
| 1259 | 
  | 
 | 
| 1260 | 
  | 
void SimSetup::makeSysArrays(void){ | 
| 1261 | 
< | 
  int i, j, k, l; | 
| 1261 | 
> | 
  | 
| 1262 | 
> | 
#ifndef IS_MPI | 
| 1263 | 
> | 
  int k, j; | 
| 1264 | 
> | 
#endif // is_mpi | 
| 1265 | 
> | 
  int i, l; | 
| 1266 | 
  | 
 | 
| 1267 | 
  | 
  Atom** the_atoms; | 
| 1268 | 
  | 
  Molecule* the_molecules; | 
| 1345 | 
  | 
void SimSetup::makeIntegrator(void){ | 
| 1346 | 
  | 
  int k; | 
| 1347 | 
  | 
 | 
| 1348 | 
+ | 
  NVE<RealIntegrator>* myNVE = NULL; | 
| 1349 | 
  | 
  NVT<RealIntegrator>* myNVT = NULL; | 
| 1350 | 
< | 
  NPTi<RealIntegrator>* myNPTi = NULL; | 
| 1351 | 
< | 
  NPTf<RealIntegrator>* myNPTf = NULL; | 
| 1354 | 
< | 
  NPTim<RealIntegrator>* myNPTim = NULL; | 
| 1355 | 
< | 
  NPTfm<RealIntegrator>* myNPTfm = NULL; | 
| 1350 | 
> | 
  NPTi<NPT<RealIntegrator> >* myNPTi = NULL; | 
| 1351 | 
> | 
  NPTf<NPT<RealIntegrator> >* myNPTf = NULL; | 
| 1352 | 
  | 
   | 
| 1353 | 
  | 
  for (k = 0; k < nInfo; k++){ | 
| 1354 | 
  | 
    switch (ensembleCase){ | 
| 1355 | 
  | 
      case NVE_ENS: | 
| 1356 | 
  | 
        if (globals->haveZconstraints()){ | 
| 1357 | 
  | 
          setupZConstraint(info[k]); | 
| 1358 | 
< | 
          new ZConstraint<NVE<RealIntegrator> >(&(info[k]), the_ff); | 
| 1358 | 
> | 
          myNVE = new ZConstraint<NVE<RealIntegrator> >(&(info[k]), the_ff); | 
| 1359 | 
  | 
        } | 
| 1360 | 
< | 
        else | 
| 1361 | 
< | 
          new NVE<RealIntegrator>(&(info[k]), the_ff); | 
| 1360 | 
> | 
        else{ | 
| 1361 | 
> | 
          myNVE = new NVE<RealIntegrator>(&(info[k]), the_ff); | 
| 1362 | 
> | 
        } | 
| 1363 | 
> | 
         | 
| 1364 | 
> | 
        info->the_integrator = myNVE; | 
| 1365 | 
  | 
        break; | 
| 1366 | 
  | 
 | 
| 1367 | 
  | 
      case NVT_ENS: | 
| 1383 | 
  | 
          painCave.isFatal = 1; | 
| 1384 | 
  | 
          simError(); | 
| 1385 | 
  | 
        } | 
| 1386 | 
+ | 
 | 
| 1387 | 
+ | 
        info->the_integrator = myNVT; | 
| 1388 | 
  | 
        break; | 
| 1389 | 
  | 
 | 
| 1390 | 
  | 
      case NPTi_ENS: | 
| 1391 | 
  | 
        if (globals->haveZconstraints()){ | 
| 1392 | 
  | 
          setupZConstraint(info[k]); | 
| 1393 | 
< | 
          myNPTi = new ZConstraint<NPTi<RealIntegrator> >(&(info[k]), the_ff); | 
| 1393 | 
> | 
          myNPTi = new ZConstraint<NPTi<NPT <RealIntegrator> > >(&(info[k]), the_ff); | 
| 1394 | 
  | 
        } | 
| 1395 | 
  | 
        else | 
| 1396 | 
< | 
          myNPTi = new NPTi<RealIntegrator>(&(info[k]), the_ff); | 
| 1396 | 
> | 
          myNPTi = new NPTi<NPT<RealIntegrator> >(&(info[k]), the_ff); | 
| 1397 | 
  | 
 | 
| 1398 | 
  | 
        myNPTi->setTargetTemp(globals->getTargetTemp()); | 
| 1399 | 
  | 
 | 
| 1426 | 
  | 
          painCave.isFatal = 1; | 
| 1427 | 
  | 
          simError(); | 
| 1428 | 
  | 
        } | 
| 1429 | 
+ | 
 | 
| 1430 | 
+ | 
        info->the_integrator = myNPTi; | 
| 1431 | 
  | 
        break; | 
| 1432 | 
  | 
 | 
| 1433 | 
  | 
      case NPTf_ENS: | 
| 1434 | 
  | 
        if (globals->haveZconstraints()){ | 
| 1435 | 
  | 
          setupZConstraint(info[k]); | 
| 1436 | 
< | 
          myNPTf = new ZConstraint<NPTf<RealIntegrator> >(&(info[k]), the_ff); | 
| 1436 | 
> | 
          myNPTf = new ZConstraint<NPTf<NPT <RealIntegrator> > >(&(info[k]), the_ff); | 
| 1437 | 
  | 
        } | 
| 1438 | 
  | 
        else | 
| 1439 | 
< | 
          myNPTf = new NPTf<RealIntegrator>(&(info[k]), the_ff); | 
| 1439 | 
> | 
          myNPTf = new NPTf<NPT <RealIntegrator> >(&(info[k]), the_ff); | 
| 1440 | 
  | 
 | 
| 1441 | 
  | 
        myNPTf->setTargetTemp(globals->getTargetTemp()); | 
| 1442 | 
  | 
 | 
| 1469 | 
  | 
          painCave.isFatal = 1; | 
| 1470 | 
  | 
          simError(); | 
| 1471 | 
  | 
        } | 
| 1469 | 
– | 
        break; | 
| 1472 | 
  | 
 | 
| 1473 | 
< | 
      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()); | 
| 1503 | 
< | 
        else{ | 
| 1504 | 
< | 
          sprintf(painCave.errMsg, | 
| 1505 | 
< | 
                  "SimSetup error: If you use an NPT\n" | 
| 1506 | 
< | 
                  "    ensemble, you must set tauBarostat.\n"); | 
| 1507 | 
< | 
          painCave.isFatal = 1; | 
| 1508 | 
< | 
          simError(); | 
| 1509 | 
< | 
        } | 
| 1473 | 
> | 
        info->the_integrator = myNPTf; | 
| 1474 | 
  | 
        break; | 
| 1475 | 
  | 
 | 
| 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 | 
– | 
 | 
| 1476 | 
  | 
      default: | 
| 1477 | 
  | 
        sprintf(painCave.errMsg, | 
| 1478 | 
  | 
                "SimSetup Error. Unrecognized ensemble in case statement.\n"); |