63#include "antlr/ANTLRException.hpp"
64#include "antlr/CharStreamException.hpp"
65#include "antlr/MismatchedCharException.hpp"
66#include "antlr/MismatchedTokenException.hpp"
67#include "antlr/NoViableAltException.hpp"
68#include "antlr/NoViableAltForCharException.hpp"
69#include "antlr/RecognitionException.hpp"
70#include "antlr/TokenStreamException.hpp"
71#include "antlr/TokenStreamIOException.hpp"
72#include "antlr/TokenStreamRecognitionException.hpp"
77#include "mdParser/MDLexer.hpp"
78#include "mdParser/MDParser.hpp"
79#include "mdParser/MDTreeParser.hpp"
80#include "mdParser/SimplePreprocessor.hpp"
81#include "types/DirectionalAdapter.hpp"
82#include "types/EAMAdapter.hpp"
83#include "types/FixedChargeAdapter.hpp"
84#include "types/FluctuatingChargeAdapter.hpp"
85#include "types/MultipoleAdapter.hpp"
86#include "types/PolarizableAdapter.hpp"
87#include "types/SuttonChenAdapter.hpp"
88#include "utils/RandNumGen.hpp"
89#include "utils/Revision.hpp"
90#include "utils/Trim.hpp"
91#include "utils/simError.h"
95 Globals* SimCreator::parseFile(std::istream& rawMetaDataStream,
96 const std::string& filename,
int mdFileVersion,
97 int startOfMetaDataBlock) {
101 std::stringstream ppStream;
104 const int primaryNode = 0;
106 if (worldRank == primaryNode) {
107 MPI_Bcast(&mdFileVersion, 1, MPI_INT, primaryNode, MPI_COMM_WORLD);
110 preprocessor.preprocess(rawMetaDataStream, filename,
111 startOfMetaDataBlock, ppStream);
115 streamSize = ppStream.str().size() + 1;
116 MPI_Bcast(&streamSize, 1, MPI_INT, primaryNode, MPI_COMM_WORLD);
117 MPI_Bcast(
static_cast<void*
>(
const_cast<char*
>(ppStream.str().c_str())),
118 streamSize, MPI_CHAR, primaryNode, MPI_COMM_WORLD);
120 MPI_Bcast(&mdFileVersion, 1, MPI_INT, primaryNode, MPI_COMM_WORLD);
123 MPI_Bcast(&streamSize, 1, MPI_INT, primaryNode, MPI_COMM_WORLD);
124 char* buf =
new char[streamSize];
128 MPI_Bcast(buf, streamSize, MPI_CHAR, primaryNode, MPI_COMM_WORLD);
136 lexer.setFilename(filename);
137 lexer.initDeferredLineCount();
141 parser.setFilename(filename);
145 observer.setLexer(&lexer);
146 observer.setParser(&parser);
147 lexer.setObserver(&observer);
149 parser.initializeASTFactory(factory);
150 parser.setASTFactory(&factory);
154 treeParser.initializeASTFactory(factory);
155 treeParser.setASTFactory(&factory);
156 simParams = treeParser.walkTree(parser.getAST());
160 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
161 "Mismatched Character: %s in file %s at line %d, column %d\n",
164 painCave.isFatal = 1;
167 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
168 "Mismatched Token: %s in file %s at line %d, column %d\n",
171 painCave.isFatal = 1;
174 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
175 "No Viable Alternative for Character: %s in file %s at line %d, "
179 painCave.isFatal = 1;
182 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
183 "No Viable Alternative: %s in file %s at line %d, column %d\n",
186 painCave.isFatal = 1;
192 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
193 "Token Stream Recognition: %s in file %s at line %d, column %d\n",
194 e.
getMessage().c_str(), e.getFilename().c_str(), e.getLine(),
196 painCave.isFatal = 1;
201 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
202 "Token Stream IO exception: %s\n", e.
getMessage().c_str());
203 painCave.isFatal = 1;
208 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
209 "Token Stream exception: %s\n", e.
getMessage().c_str());
210 painCave.isFatal = 1;
213 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
214 "Recognition exception: %s in file %s at line %d, column %d\n",
217 painCave.isFatal = 1;
220 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
221 "Character Stream exception: %s\n", e.
getMessage().c_str());
222 painCave.isFatal = 1;
225 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
"%s\n", e.what());
226 painCave.isFatal = 1;
228 }
catch (std::exception& e) {
229 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
230 "parser exception: %s\n", e.what());
231 painCave.isFatal = 1;
235 simParams->setMDfileVersion(mdFileVersion);
240 bool loadInitCoords) {
241 const int bufferSize = 65535;
242 char buffer[bufferSize];
244 std::string mdRawData;
245 int metaDataBlockStart = -1;
246 int metaDataBlockEnd = -1;
247 streamoff mdOffset {};
248 int mdFileVersion(2);
252 version.assign(
"## Last run using OpenMD version: ");
253 version.append(OPENMD_VERSION_MAJOR);
255 version.append(OPENMD_VERSION_MINOR);
258 std::string rev(revision, strnlen(revision, 40));
259 rev.append(40 - rev.length(),
' ');
261 version.append(
" revision: ");
266 version.append(
"RELEASE");
270 const int primaryNode = 0;
271 if (worldRank == primaryNode) {
274 std::ifstream mdFile_;
275 mdFile_.open(mdFileName.c_str(), ifstream::in | ifstream::binary);
277 if (mdFile_.fail()) {
278 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
279 "SimCreator: Cannot open file: %s\n", mdFileName.c_str());
280 painCave.isFatal = 1;
284 mdFile_.getline(buffer, bufferSize);
286 std::string line = Utils::trimLeftCopy(buffer);
287 std::size_t i = CaseInsensitiveFind(line,
"<OpenMD");
288 if (i == string::npos) {
290 i = CaseInsensitiveFind(line,
"<OOPSE");
293 if (i == string::npos) {
295 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
296 "SimCreator: File: %s is not a valid OpenMD file!\n",
298 painCave.isFatal = 1;
306 std::string fileType = tokenizer.
nextToken();
311 if (fileType ==
"OPENMD") {
313 std::string token(tokenizer.
nextToken());
315 if (token ==
"VERSION") {
322 bool startFound(
false);
323 bool endFound(
false);
325 while (mdFile_.getline(buffer, bufferSize)) {
328 std::string line = Utils::trimLeftCopy(buffer);
329 if (metaDataBlockStart == -1) {
330 std::size_t i = CaseInsensitiveFind(line,
"<MetaData>");
331 if (i != string::npos) {
332 metaDataBlockStart = lineNo;
334 mdOffset = mdFile_.tellg();
337 std::size_t i = CaseInsensitiveFind(line,
"</MetaData>");
338 if (i != string::npos) {
339 metaDataBlockEnd = lineNo;
343 if (startFound && endFound)
break;
346 if (metaDataBlockStart == -1) {
347 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
348 "SimCreator: File: %s did not contain a <MetaData> tag!\n",
350 painCave.isFatal = 1;
353 if (metaDataBlockEnd == -1) {
355 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
356 "SimCreator: File: %s did not contain a closed MetaData block!\n",
358 painCave.isFatal = 1;
364 mdFile_.seekg(mdOffset);
368 bool foundVersion =
false;
370 for (
int i = 0; i < metaDataBlockEnd - metaDataBlockStart - 1; ++i) {
371 mdFile_.getline(buffer, bufferSize);
372 std::string line = Utils::trimLeftCopy(buffer);
374 CaseInsensitiveFind(line,
"## Last run using OpenMD Version");
375 if (j != string::npos) {
377 mdRawData += version;
384 if (!foundVersion) mdRawData += version +
"\n";
392 std::stringstream rawMetaDataStream(mdRawData);
395 Globals* simParams = parseFile(rawMetaDataStream, mdFileName, mdFileVersion,
396 metaDataBlockStart + 1);
402 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
403 "ForceField Factory can not create %s force field\n",
404 simParams->getForceField().c_str());
405 painCave.isFatal = 1;
409 if (simParams->haveForceFieldFileName()) {
410 ff->setForceFieldFileName(simParams->getForceFieldFileName());
413 std::string forcefieldFileName;
414 forcefieldFileName = ff->getForceFieldFileName();
416 if (simParams->haveForceFieldVariant()) {
420 std::string variant = simParams->getForceFieldVariant();
422 std::string::size_type pos = forcefieldFileName.rfind(
".frc");
423 variant =
"." + variant;
424 if (pos != std::string::npos) {
425 forcefieldFileName.insert(pos, variant);
429 forcefieldFileName.append(variant);
433 ff->parse(forcefieldFileName);
437 info->setRawMetaData(mdRawData);
441 gatherParameters(info, mdFileName);
445 divideMolecules(info);
449 createMolecules(info);
453 computeStorageLayouts(info);
456 int rbsl = info->getRigidBodyStorageLayout();
457 int cgsl = info->getCutoffGroupStorageLayout();
468 setGlobalIndex(info);
476 SimInfo::MoleculeIterator mi;
483 if (loadInitCoords) loadCoordinates(info, mdFileName);
487 void SimCreator::gatherParameters(
SimInfo* info,
const std::string& mdfile) {
493 if (worldRank == 0) {
495 Globals* simParams = info->getSimParams();
496 if (simParams->haveFinalConfig()) {
497 prefix =
getPrefix(simParams->getFinalConfig());
502 info->setFinalConfigFileName(prefix +
".eor");
503 info->setDumpFileName(prefix +
".dump");
504 info->setStatFileName(prefix +
".stat");
505 info->setReportFileName(prefix +
".report");
506 info->setRestFileName(prefix +
".zang");
514 void SimCreator::divideMolecules(
SimInfo* info) {
517 std::vector<int> atomsPerProc;
519 std::vector<int> molToProcMap(nGlobalMols, -1);
522 MPI_Comm_size(MPI_COMM_WORLD, &nProcessors);
524 if (nProcessors > nGlobalMols) {
525 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
526 "nProcessors (%d) > nMol (%d)\n"
527 "\tThe number of processors is larger than\n"
528 "\tthe number of molecules. This will not result in a \n"
529 "\tusable division of atoms for force decomposition.\n"
530 "\tEither try a smaller number of processors, or run the\n"
531 "\tsingle-processor version of OpenMD.\n",
532 nProcessors, nGlobalMols);
534 painCave.isFatal = 1;
541 atomsPerProc.insert(atomsPerProc.end(), nProcessors, 0);
543 if (worldRank == 0) {
544 Utils::RandNumGenPtr myRandom = info->getRandomNumberGenerator();
546 std::uniform_int_distribution<> processorDistribution {0,
548 std::uniform_real_distribution<RealType> yDistribution {0, 1};
551 RealType denominator = nProcessors;
552 RealType precast = numerator / denominator;
553 int nTarget = (int)(precast + 0.5);
556 for (
int i = 0; i < nGlobalMols; i++) {
558 int stampId = info->getMoleculeStampId(i);
560 int add_atoms = moleculeStamp->getNAtoms();
562 if (nProcessors > 1) {
570 which_proc = processorDistribution(*myRandom);
573 int old_atoms = atomsPerProc[which_proc];
574 int new_atoms = old_atoms + add_atoms;
582 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
583 "There have been 100 attempts to assign molecule %d to an\n"
584 "\tunderworked processor, but there's no good place to\n"
585 "\tleave it. OpenMD is assigning it at random to processor "
589 painCave.isFatal = 0;
590 painCave.severity = OPENMD_INFO;
593 molToProcMap[i] = which_proc;
594 atomsPerProc[which_proc] += add_atoms;
603 if (new_atoms <= nTarget) {
604 molToProcMap[i] = which_proc;
605 atomsPerProc[which_proc] += add_atoms;
619 RealType x = (RealType)(new_atoms - nTarget);
620 RealType y = yDistribution(*myRandom);
622 if (y < exp(-a * x)) {
623 molToProcMap[i] = which_proc;
624 atomsPerProc[which_proc] += add_atoms;
634 molToProcMap[i] = which_proc;
635 atomsPerProc[which_proc] += add_atoms;
640 MPI_Bcast(&molToProcMap[0], nGlobalMols, MPI_INT, 0, MPI_COMM_WORLD);
644 MPI_Bcast(&molToProcMap[0], nGlobalMols, MPI_INT, 0, MPI_COMM_WORLD);
648 snprintf(checkPointMsg, MAX_SIM_ERROR_MSG_LENGTH,
649 "Successfully divided the molecules among the processors.\n");
655 void SimCreator::createMolecules(
SimInfo* info) {
664 stampId = info->getMoleculeStampId(i);
665 Molecule* mol = molCreator.createMolecule(
677 void SimCreator::computeStorageLayouts(
SimInfo* info) {
678 Globals* simParams = info->getSimParams();
681 AtomTypeSet::iterator i;
682 bool hasDirectionalAtoms =
false;
683 bool hasFixedCharge =
false;
684 bool hasDipoles =
false;
685 bool hasQuadrupoles =
false;
686 bool hasPolarizable =
false;
687 bool hasFluctuatingCharge =
false;
688 bool hasMetallic =
false;
689 int atomStorageLayout = 0;
690 int rigidBodyStorageLayout = 0;
691 int cutoffGroupStorageLayout = 0;
693 atomStorageLayout |= DataStorage::dslPosition;
694 atomStorageLayout |= DataStorage::dslVelocity;
695 atomStorageLayout |= DataStorage::dslForce;
696 cutoffGroupStorageLayout |= DataStorage::dslPosition;
698 for (i = atomTypes.begin(); i != atomTypes.end(); ++i) {
707 if (da.isDirectional()) { hasDirectionalAtoms =
true; }
708 if (ma.isDipole()) { hasDipoles =
true; }
709 if (ma.isQuadrupole()) { hasQuadrupoles =
true; }
710 if (ea.isEAM() || sca.isSuttonChen()) { hasMetallic =
true; }
711 if (fca.isFixedCharge()) { hasFixedCharge =
true; }
712 if (fqa.isFluctuatingCharge()) { hasFluctuatingCharge =
true; }
713 if (pa.isPolarizable()) { hasPolarizable =
true; }
716 if (nRigidBodies > 0) {
717 rigidBodyStorageLayout |= DataStorage::dslPosition;
718 rigidBodyStorageLayout |= DataStorage::dslVelocity;
719 rigidBodyStorageLayout |= DataStorage::dslForce;
720 rigidBodyStorageLayout |= DataStorage::dslAmat;
721 rigidBodyStorageLayout |= DataStorage::dslAngularMomentum;
722 rigidBodyStorageLayout |= DataStorage::dslTorque;
724 if (hasDirectionalAtoms) {
725 atomStorageLayout |= DataStorage::dslAmat;
726 if (atomStorageLayout & DataStorage::dslVelocity) {
727 atomStorageLayout |= DataStorage::dslAngularMomentum;
729 if (atomStorageLayout & DataStorage::dslForce) {
730 atomStorageLayout |= DataStorage::dslTorque;
733 if (hasDipoles) { atomStorageLayout |= DataStorage::dslDipole; }
734 if (hasQuadrupoles) { atomStorageLayout |= DataStorage::dslQuadrupole; }
735 if (hasFixedCharge || hasFluctuatingCharge) {
736 atomStorageLayout |= DataStorage::dslSkippedCharge;
739 atomStorageLayout |= DataStorage::dslDensity;
740 atomStorageLayout |= DataStorage::dslFunctional;
741 atomStorageLayout |= DataStorage::dslFunctionalDerivative;
743 if (hasPolarizable) { atomStorageLayout |= DataStorage::dslElectricField; }
744 if (hasFluctuatingCharge) {
745 atomStorageLayout |= DataStorage::dslFlucQPosition;
746 if (atomStorageLayout & DataStorage::dslVelocity) {
747 atomStorageLayout |= DataStorage::dslFlucQVelocity;
749 if (atomStorageLayout & DataStorage::dslForce) {
750 atomStorageLayout |= DataStorage::dslFlucQForce;
757 if (simParams->getOutputParticlePotential()) {
758 atomStorageLayout |= DataStorage::dslParticlePot;
761 if (simParams->havePrintHeatFlux()) {
762 if (simParams->getPrintHeatFlux()) {
763 atomStorageLayout |= DataStorage::dslParticlePot;
767 if (simParams->getOutputElectricField() | simParams->haveElectricField() |
768 simParams->haveUniformField() |
769 simParams->haveUniformGradientStrength() |
770 simParams->haveUniformGradientDirection1() |
771 simParams->haveUniformGradientDirection2() |
772 simParams->getLightParameters()->getUseLight()) {
773 atomStorageLayout |= DataStorage::dslElectricField;
774 rigidBodyStorageLayout |= DataStorage::dslElectricField;
777 if (simParams->getRNEMDParameters()->haveUseRNEMD()) {
778 if (simParams->getRNEMDParameters()->getUseRNEMD()) {
779 if (simParams->getRNEMDParameters()->requiresElectricField()) {
780 atomStorageLayout |= DataStorage::dslElectricField;
781 rigidBodyStorageLayout |= DataStorage::dslElectricField;
786 if (simParams->getOutputSitePotential()) {
787 atomStorageLayout |= DataStorage::dslSitePotential;
788 rigidBodyStorageLayout |= DataStorage::dslSitePotential;
791 if (simParams->getOutputFluctuatingCharges()) {
792 atomStorageLayout |= DataStorage::dslFlucQPosition;
793 atomStorageLayout |= DataStorage::dslFlucQVelocity;
794 atomStorageLayout |= DataStorage::dslFlucQForce;
798 info->setRigidBodyStorageLayout(rigidBodyStorageLayout);
799 info->setCutoffGroupStorageLayout(cutoffGroupStorageLayout);
804 void SimCreator::setGlobalIndex(
SimInfo* info) {
805 SimInfo::MoleculeIterator mi;
806 Molecule::AtomIterator ai;
807 Molecule::RigidBodyIterator ri;
808 Molecule::CutoffGroupIterator ci;
809 Molecule::BondIterator boi;
810 Molecule::BendIterator bei;
811 Molecule::TorsionIterator ti;
812 Molecule::InversionIterator ii;
813 Molecule::IntegrableObjectIterator ioi;
823 int beginRigidBodyIndex;
824 int beginCutoffGroupIndex;
827 int beginTorsionIndex;
828 int beginInversionIndex;
837 beginCutoffGroupIndex = 0;
840 beginTorsionIndex = 0;
841 beginInversionIndex = 0;
851 for (atom = mol->beginAtom(ai); atom != NULL;
852 atom = mol->nextAtom(ai)) {
856 for (rb = mol->beginRigidBody(ri); rb != NULL;
857 rb = mol->nextRigidBody(ri)) {
863 for (cg = mol->beginCutoffGroup(ci); cg != NULL;
864 cg = mol->nextCutoffGroup(ci)) {
865 cg->setGlobalIndex(beginCutoffGroupIndex++);
867 for (bond = mol->beginBond(boi); bond != NULL;
868 bond = mol->nextBond(boi)) {
871 for (bend = mol->beginBend(bei); bend != NULL;
872 bend = mol->nextBend(bei)) {
875 for (torsion = mol->beginTorsion(ti); torsion != NULL;
876 torsion = mol->nextTorsion(ti)) {
879 for (inversion = mol->beginInversion(ii); inversion != NULL;
880 inversion = mol->nextInversion(ii)) {
888 int stampId = info->getMoleculeStampId(i);
891 beginAtomIndex += stamp->getNAtoms();
892 beginRigidBodyIndex += stamp->getNRigidBodies();
893 beginCutoffGroupIndex +=
894 stamp->getNCutoffGroups() + stamp->getNFreeAtoms();
895 beginBondIndex += stamp->getNBonds();
896 beginBendIndex += stamp->getNBends();
897 beginTorsionIndex += stamp->getNTorsions();
898 beginInversionIndex += stamp->getNInversions();
908 for (cg = mol->beginCutoffGroup(ci); cg != NULL;
909 cg = mol->nextCutoffGroup(ci)) {
910 for (atom = cg->beginAtom(ai); atom != NULL; atom = cg->nextAtom(ai)) {
911 globalGroupMembership[atom->
getGlobalIndex()] = cg->getGlobalIndex();
923 MPI_Allreduce(&globalGroupMembership[0], &tmpGroupMembership[0],
924 nGlobalAtoms, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
932 std::vector<int> globalMolMembership(
937 for (atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
940 for (rb = mol->beginRigidBody(ri); rb != NULL;
941 rb = mol->nextRigidBody(ri)) {
947 std::vector<int> tmpMolMembership(
949 MPI_Allreduce(&globalMolMembership[0], &tmpMolMembership[0],
950 nGlobalAtoms + nGlobalRigidBodies, MPI_INT, MPI_SUM,
969 MPI_Allreduce(&nIOPerMol[0], &numIntegrableObjectsPerMol[0],
973 std::vector<int> numIntegrableObjectsPerMol = nIOPerMol;
978 int startingIndex = 0;
980 startingIOIndexForMol[i] = startingIndex;
981 startingIndex += numIntegrableObjectsPerMol[i];
984 std::vector<StuntDouble*> IOIndexToIntegrableObject(
989 int globalIO = startingIOIndexForMol[myGlobalIndex];
990 for (
StuntDouble* sd = mol->beginIntegrableObject(ioi); sd != NULL;
991 sd = mol->nextIntegrableObject(ioi)) {
992 sd->setGlobalIntegrableObjectIndex(globalIO);
993 IOIndexToIntegrableObject[globalIO] = sd;
998 info->setIOIndexToIntegrableObject(IOIndexToIntegrableObject);
1001 void SimCreator::loadCoordinates(
SimInfo* info,
1002 const std::string& mdFileName) {
1004 int nframes = reader.getNFrames();
1007 reader.readFrame(nframes - 1);
1011 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
1012 "Initial configuration file %s should at least contain one frame\n",
1013 mdFileName.c_str());
1014 painCave.isFatal = 1;
size_t getNIntegrableObjects()
Returns the total number of integrable objects in this molecule.
int getGlobalIndex()
Returns the global index of this molecule.
void setGlobalIndex(int index)
Sets the global index of this ShortRangeInteraction.
SimInfo * createSim(const std::string &mdFileName, bool loadInitCoords=true)
Setup Simulation.
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
Molecule * getMoleculeByGlobalIndex(int index)
Finds a molecule with a specified global index.
int getNGlobalIntegrableObjects()
Returns the total number of integrable objects (total number of rigid bodies plus the total number of...
void setGlobalMolMembership(const std::vector< int > &gmm)
Sets GlobalMolMembership.
void setAtomStorageLayout(int asl)
Sets the storage layouts (computed by SimCreator)
int getMolToProc(int globalIndex)
Finds the processor where a molecule resides.
ForceField * getForceField()
Returns the force field.
Molecule * beginMolecule(MoleculeIterator &i)
Returns the first molecule in this SimInfo and intialize the iterator.
MoleculeStamp * getMoleculeStamp(int id)
Returns the molecule stamp.
int getNGlobalRigidBodies()
Returns the total number of integrable objects (total number of rigid bodies plus the total number of...
int getAtomStorageLayout()
Returns the storage layouts (computed by SimCreator)
int getNGlobalAtoms()
Returns the total number of atoms in the system.
int getNGlobalMolecules()
Returns the total number of molecules in the system.
void setSnapshotManager(SnapshotManager *sman)
Sets the snapshot manager.
void setGlobalGroupMembership(const std::vector< int > &ggm)
Sets GlobalGroupMembership.
bool addMolecule(Molecule *mol)
Adds a molecule.
void addInteractionPairs(Molecule *mol)
add all special interaction pairs (including excluded interactions) in a molecule into the appropriat...
Molecule * nextMolecule(MoleculeIterator &i)
Returns the next avaliable Molecule based on the iterator.
SnapshotManager * getSnapshotManager()
Returns the snapshot manager.
void setMolToProcMap(const std::vector< int > &molToProcMap)
Set MolToProcMap array.
AtomTypeSet getSimulatedAtomTypes()
Returns the set of atom types present in this simulation.
LocalIndexManager * getLocalIndexManager()
Returns the local index manager.
"brains/SimSnapshotManager.hpp"
The string tokenizer class allows an application to break a string into tokens The set of delimiters ...
std::string nextToken()
Returns the next token from this string tokenizer.
int nextTokenAsInt()
Returns the next token from this string tokenizer as an integer.
bool hasMoreTokens()
Tests if there are more tokens available from this tokenizer's string.
"Don't move, or you're dead! Stand up! Captain, we've got them!"
void setGlobalIndex(int index)
Sets the global index of this stuntDouble.
int getGlobalIndex()
Returns the global index of this stuntDouble.
virtual std::string getMessage() const
Return error message without additional info (if present)
AST Super Factory shared by TreeParser and Parser.
std::string getMessage() const
Returns a clean error message (no line number/column information)
std::string getMessage() const
Returns a clean error message (no line number/column information)
std::string getMessage() const
Returns a clean error message (no line number/column information)
std::string getMessage() const
Returns a clean error message (no line number/column information)
virtual int getColumn() const
virtual std::string getFilename() const
Return file where mishap occurred.
virtual int getLine() const
Baseclass for exceptions thrown by classes implementing the TokenStream interface.
Exception thrown from generated lexers when there's no default error handler specified.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
std::string getPrefix(const std::string &str)