69#include "io/ForceFieldOptions.hpp"
71#include "nonbonded/SwitchingFunction.hpp"
74#include "selection/SelectionManager.hpp"
76#include "utils/RandNumGen.hpp"
77#include "utils/simError.h"
83 forceField_(ff), simParams_(simParams), randNumGen_ {nullptr}, nAtoms_(0),
84 nBonds_(0), nBends_(0), nTorsions_(0), nInversions_(0), nRigidBodies_(0),
85 nIntegrableObjects_(0), nCutoffGroups_(0), nConstraints_(0),
86 nFluctuatingCharges_(0), nGlobalMols_(0), nGlobalAtoms_(0),
87 nGlobalCutoffGroups_(0), nGlobalIntegrableObjects_(0),
88 nGlobalRigidBodies_(0), nGlobalFluctuatingCharges_(0), nGlobalBonds_(0),
89 nGlobalBends_(0), nGlobalTorsions_(0), nGlobalInversions_(0),
90 nGlobalConstraints_(0), hasNGlobalConstraints_(false), ndf_(0),
91 fdf_local(0), ndfRaw_(0), ndfTrans_(0), nZconstraint_(0), sman_(NULL),
92 topologyDone_(false), calcBoxDipole_(false), calcBoxQuadrupole_(false),
93 useAtomicVirial_(true) {
95 int nMolWithSameStamp;
102 vector<Component*> components = simParams->getComponents();
104 for (vector<Component*>::iterator i = components.begin();
105 i != components.end(); ++i) {
106 molStamp = (*i)->getMoleculeStamp();
107 if ((*i)->haveRegion()) {
108 molStamp->setRegion((*i)->getRegion());
111 molStamp->setRegion(-1);
114 nMolWithSameStamp = (*i)->getNMol();
116 addMoleculeStamp(molStamp, nMolWithSameStamp);
119 nGlobalAtoms_ += molStamp->getNAtoms() * nMolWithSameStamp;
120 nGlobalBonds_ += molStamp->getNBonds() * nMolWithSameStamp;
121 nGlobalBends_ += molStamp->getNBends() * nMolWithSameStamp;
122 nGlobalTorsions_ += molStamp->getNTorsions() * nMolWithSameStamp;
123 nGlobalInversions_ += molStamp->getNInversions() * nMolWithSameStamp;
126 int nAtomsInGroups = 0;
127 int nCutoffGroupsInStamp = molStamp->getNCutoffGroups();
129 for (
int j = 0; j < nCutoffGroupsInStamp; j++) {
130 cgStamp = molStamp->getCutoffGroupStamp(j);
131 nAtomsInGroups += cgStamp->getNMembers();
134 nGroups += nCutoffGroupsInStamp * nMolWithSameStamp;
136 nCutoffAtoms += nAtomsInGroups * nMolWithSameStamp;
139 int nAtomsInRigidBodies = 0;
140 int nRigidBodiesInStamp = molStamp->getNRigidBodies();
142 for (
int j = 0; j < nRigidBodiesInStamp; j++) {
143 rbStamp = molStamp->getRigidBodyStamp(j);
144 nAtomsInRigidBodies += rbStamp->getNMembers();
147 nGlobalRigidBodies_ += nRigidBodiesInStamp * nMolWithSameStamp;
148 nRigidAtoms += nAtomsInRigidBodies * nMolWithSameStamp;
157 nGlobalCutoffGroups_ = nGlobalAtoms_ - nCutoffAtoms + nGroups;
164 nGlobalIntegrableObjects_ =
165 nGlobalAtoms_ - nRigidAtoms + nGlobalRigidBodies_;
167 nGlobalMols_ = molStampIds_.size();
168 molToProcMap_.resize(nGlobalMols_);
172 std::uint_fast32_t seed;
174 if (simParams_->haveSeed())
175 seed =
static_cast<std::uint_fast32_t
>(simParams_->getSeed());
177 seed = std::mt19937::default_seed;
179 randNumGen_ = std::make_shared<Utils::RandNumGen>(seed);
182 SimInfo::~SimInfo() {
183 Utils::deletePointers(molecules_);
194 if (i == molecules_.end()) {
219 if (i != molecules_.end()) {
220 assert(mol == i->second);
244 i = molecules_.begin();
245 return i == molecules_.end() ? NULL : i->second;
250 return i == molecules_.end() ? NULL : i->second;
253 void SimInfo::calcNdf() {
254 int ndf_local, nfq_local;
256 vector<StuntDouble*>::iterator j;
257 vector<Atom*>::iterator k;
266 for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) {
267 for (sd = mol->beginIntegrableObject(j); sd != NULL;
268 sd = mol->nextIntegrableObject(j)) {
280 for (atom = mol->beginFluctuatingCharge(k); atom != NULL;
281 atom = mol->nextFluctuatingCharge(k)) {
282 if (atom->isFluctuatingCharge()) { nfq_local++; }
286 ndfLocal_ = ndf_local;
289 ndf_local -= nConstraints_;
292 MPI_Allreduce(&ndf_local, &ndf_, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
293 MPI_Allreduce(&nfq_local, &nGlobalFluctuatingCharges_, 1, MPI_INT, MPI_SUM,
297 nGlobalFluctuatingCharges_ = nfq_local;
302 ndf_ = ndf_ - 3 - nZconstraint_;
305 int SimInfo::getFdf() {
307 MPI_Allreduce(&fdf_local, &fdf_, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
315 int nLocalCutoffAtoms = 0;
319 Molecule::CutoffGroupIterator ci;
322 for (cg = mol->beginCutoffGroup(ci); cg != NULL;
323 cg = mol->nextCutoffGroup(ci)) {
324 nLocalCutoffAtoms += cg->getNumAtom();
328 return nAtoms_ - nLocalCutoffAtoms + nCutoffGroups_;
331 void SimInfo::calcNdfRaw() {
335 vector<StuntDouble*>::iterator j;
342 for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) {
343 for (sd = mol->beginIntegrableObject(j); sd != NULL;
344 sd = mol->nextIntegrableObject(j)) {
358 MPI_Allreduce(&ndfRaw_local, &ndfRaw_, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
360 ndfRaw_ = ndfRaw_local;
364 void SimInfo::calcNdfTrans() {
367 ndfTrans_local = 3 * nIntegrableObjects_ - nConstraints_;
370 MPI_Allreduce(&ndfTrans_local, &ndfTrans_, 1, MPI_INT, MPI_SUM,
373 ndfTrans_ = ndfTrans_local;
376 ndfTrans_ = ndfTrans_ - 3 - nZconstraint_;
381 vector<Bond*>::iterator bondIter;
382 vector<Bend*>::iterator bendIter;
383 vector<Torsion*>::iterator torsionIter;
384 vector<Inversion*>::iterator inversionIter;
402 map<int, set<int>> atomGroups;
403 Molecule::RigidBodyIterator rbIter;
405 Molecule::IntegrableObjectIterator ii;
408 for (sd = mol->beginIntegrableObject(ii); sd != NULL;
409 sd = mol->nextIntegrableObject(ii)) {
412 vector<Atom*> atoms = rb->
getAtoms();
414 for (
int i = 0; i < static_cast<int>(atoms.size()); ++i) {
415 rigidAtoms.insert(atoms[i]->getGlobalIndex());
417 for (
int i = 0; i < static_cast<int>(atoms.size()); ++i) {
418 atomGroups.insert(map<
int, set<int>>::value_type(
419 atoms[i]->getGlobalIndex(), rigidAtoms));
425 map<
int, set<int>>::value_type(sd->
getGlobalIndex(), oneAtomSet));
429 for (bond = mol->beginBond(bondIter); bond != NULL;
430 bond = mol->nextBond(bondIter)) {
434 if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
435 oneTwoInteractions_.addPair(a, b);
437 excludedInteractions_.addPair(a, b);
441 for (bend = mol->beginBend(bendIter); bend != NULL;
442 bend = mol->nextBend(bendIter)) {
447 if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
448 oneTwoInteractions_.addPair(a, b);
449 oneTwoInteractions_.addPair(b, c);
451 excludedInteractions_.addPair(a, b);
452 excludedInteractions_.addPair(b, c);
455 if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
456 oneThreeInteractions_.addPair(a, c);
458 excludedInteractions_.addPair(a, c);
462 for (torsion = mol->beginTorsion(torsionIter); torsion != NULL;
463 torsion = mol->nextTorsion(torsionIter)) {
469 if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
470 oneTwoInteractions_.addPair(a, b);
471 oneTwoInteractions_.addPair(b, c);
472 oneTwoInteractions_.addPair(c, d);
474 excludedInteractions_.addPair(a, b);
475 excludedInteractions_.addPair(b, c);
476 excludedInteractions_.addPair(c, d);
479 if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
480 oneThreeInteractions_.addPair(a, c);
481 oneThreeInteractions_.addPair(b, d);
483 excludedInteractions_.addPair(a, c);
484 excludedInteractions_.addPair(b, d);
487 if (options_.havevdw14scale() || options_.haveelectrostatic14scale()) {
488 oneFourInteractions_.addPair(a, d);
490 excludedInteractions_.addPair(a, d);
494 for (inversion = mol->beginInversion(inversionIter); inversion != NULL;
495 inversion = mol->nextInversion(inversionIter)) {
501 if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
502 oneTwoInteractions_.addPair(a, b);
503 oneTwoInteractions_.addPair(a, c);
504 oneTwoInteractions_.addPair(a, d);
506 excludedInteractions_.addPair(a, b);
507 excludedInteractions_.addPair(a, c);
508 excludedInteractions_.addPair(a, d);
511 if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
512 oneThreeInteractions_.addPair(b, c);
513 oneThreeInteractions_.addPair(b, d);
514 oneThreeInteractions_.addPair(c, d);
516 excludedInteractions_.addPair(b, c);
517 excludedInteractions_.addPair(b, d);
518 excludedInteractions_.addPair(c, d);
522 for (rb = mol->beginRigidBody(rbIter); rb != NULL;
523 rb = mol->nextRigidBody(rbIter)) {
524 vector<Atom*> atoms = rb->
getAtoms();
525 for (
int i = 0; i < static_cast<int>(atoms.size()) - 1; ++i) {
526 for (
int j = i + 1; j < static_cast<int>(atoms.size()); ++j) {
527 a = atoms[i]->getGlobalIndex();
528 b = atoms[j]->getGlobalIndex();
529 excludedInteractions_.addPair(a, b);
537 vector<Bond*>::iterator bondIter;
538 vector<Bend*>::iterator bendIter;
539 vector<Torsion*>::iterator torsionIter;
540 vector<Inversion*>::iterator inversionIter;
550 map<int, set<int>> atomGroups;
551 Molecule::RigidBodyIterator rbIter;
553 Molecule::IntegrableObjectIterator ii;
556 for (sd = mol->beginIntegrableObject(ii); sd != NULL;
557 sd = mol->nextIntegrableObject(ii)) {
560 vector<Atom*> atoms = rb->
getAtoms();
562 for (
int i = 0; i < static_cast<int>(atoms.size()); ++i) {
563 rigidAtoms.insert(atoms[i]->getGlobalIndex());
565 for (
int i = 0; i < static_cast<int>(atoms.size()); ++i) {
566 atomGroups.insert(map<
int, set<int>>::value_type(
567 atoms[i]->getGlobalIndex(), rigidAtoms));
573 map<
int, set<int>>::value_type(sd->
getGlobalIndex(), oneAtomSet));
577 for (bond = mol->beginBond(bondIter); bond != NULL;
578 bond = mol->nextBond(bondIter)) {
582 if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
583 oneTwoInteractions_.removePair(a, b);
585 excludedInteractions_.removePair(a, b);
589 for (bend = mol->beginBend(bendIter); bend != NULL;
590 bend = mol->nextBend(bendIter)) {
595 if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
596 oneTwoInteractions_.removePair(a, b);
597 oneTwoInteractions_.removePair(b, c);
599 excludedInteractions_.removePair(a, b);
600 excludedInteractions_.removePair(b, c);
603 if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
604 oneThreeInteractions_.removePair(a, c);
606 excludedInteractions_.removePair(a, c);
610 for (torsion = mol->beginTorsion(torsionIter); torsion != NULL;
611 torsion = mol->nextTorsion(torsionIter)) {
617 if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
618 oneTwoInteractions_.removePair(a, b);
619 oneTwoInteractions_.removePair(b, c);
620 oneTwoInteractions_.removePair(c, d);
622 excludedInteractions_.removePair(a, b);
623 excludedInteractions_.removePair(b, c);
624 excludedInteractions_.removePair(c, d);
627 if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
628 oneThreeInteractions_.removePair(a, c);
629 oneThreeInteractions_.removePair(b, d);
631 excludedInteractions_.removePair(a, c);
632 excludedInteractions_.removePair(b, d);
635 if (options_.havevdw14scale() || options_.haveelectrostatic14scale()) {
636 oneFourInteractions_.removePair(a, d);
638 excludedInteractions_.removePair(a, d);
642 for (inversion = mol->beginInversion(inversionIter); inversion != NULL;
643 inversion = mol->nextInversion(inversionIter)) {
649 if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) {
650 oneTwoInteractions_.removePair(a, b);
651 oneTwoInteractions_.removePair(a, c);
652 oneTwoInteractions_.removePair(a, d);
654 excludedInteractions_.removePair(a, b);
655 excludedInteractions_.removePair(a, c);
656 excludedInteractions_.removePair(a, d);
659 if (options_.havevdw13scale() || options_.haveelectrostatic13scale()) {
660 oneThreeInteractions_.removePair(b, c);
661 oneThreeInteractions_.removePair(b, d);
662 oneThreeInteractions_.removePair(c, d);
664 excludedInteractions_.removePair(b, c);
665 excludedInteractions_.removePair(b, d);
666 excludedInteractions_.removePair(c, d);
670 for (rb = mol->beginRigidBody(rbIter); rb != NULL;
671 rb = mol->nextRigidBody(rbIter)) {
672 vector<Atom*> atoms = rb->
getAtoms();
673 for (
int i = 0; i < static_cast<int>(atoms.size()) - 1; ++i) {
674 for (
int j = i + 1; j < static_cast<int>(atoms.size()); ++j) {
675 a = atoms[i]->getGlobalIndex();
676 b = atoms[j]->getGlobalIndex();
677 excludedInteractions_.removePair(a, b);
683 void SimInfo::addMoleculeStamp(
MoleculeStamp* molStamp,
int nmol) {
687 curStampId = moleculeStamps_.size();
689 moleculeStamps_.push_back(molStamp);
690 moleculeStamps_[moleculeStamps_.size() - 1]->setIdent(curStampId);
691 molStampIds_.insert(molStampIds_.end(), nmol, curStampId);
717 SimInfo::MoleculeIterator mi;
719 Molecule::AtomIterator ai;
721 AtomTypeSet atomTypes;
724 for (atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
734 vector<int> foundTypes;
735 AtomTypeSet::iterator i;
736 for (i = atomTypes.begin(); i != atomTypes.end(); ++i)
737 foundTypes.push_back((*i)->getIdent());
740 int count_local = foundTypes.size();
743 MPI_Comm_size(MPI_COMM_WORLD, &nproc);
747 vector<int> counts(nproc, 0);
748 vector<int> disps(nproc, 0);
751 MPI_Allgather(&count_local, 1, MPI_INT, &counts[0], 1, MPI_INT,
756 int totalCount = counts[0];
757 for (
int iproc = 1; iproc < nproc; iproc++) {
758 disps[iproc] = disps[iproc - 1] + counts[iproc - 1];
759 totalCount += counts[iproc];
763 vector<int> ftGlobal(totalCount);
766 MPI_Allgatherv(&foundTypes[0], count_local, MPI_INT, &ftGlobal[0],
767 &counts[0], &disps[0], MPI_INT, MPI_COMM_WORLD);
769 vector<int>::iterator j;
773 set<int> foundIdents;
775 for (j = ftGlobal.begin(); j != ftGlobal.end(); ++j)
776 foundIdents.insert((*j));
780 set<int>::iterator it;
781 for (it = foundIdents.begin(); it != foundIdents.end(); ++it)
782 atomTypes.insert(forceField_->getAtomType((*it)));
789 int getGlobalCountOfType(
AtomType*) {
804 void SimInfo::setupSimVariables() {
805 useAtomicVirial_ = simParams_->getUseAtomicVirial();
808 calcBoxDipole_ =
false;
809 if (simParams_->haveAccumulateBoxDipole())
810 if (simParams_->getAccumulateBoxDipole()) { calcBoxDipole_ =
true; }
813 calcBoxQuadrupole_ =
false;
814 if (simParams_->haveAccumulateBoxQuadrupole())
815 if (simParams_->getAccumulateBoxQuadrupole()) {
816 calcBoxQuadrupole_ =
true;
819 AtomTypeSet::iterator i;
820 AtomTypeSet atomTypes;
821 atomTypes = getSimulatedAtomTypes();
822 bool usesElectrostatic =
false;
823 bool usesMetallic =
false;
824 bool usesDirectional =
false;
825 bool usesFluctuatingCharges =
false;
827 for (i = atomTypes.begin(); i != atomTypes.end(); ++i) {
828 usesElectrostatic |= (*i)->isElectrostatic();
829 usesMetallic |= (*i)->isMetal();
830 usesDirectional |= (*i)->isDirectional();
831 usesFluctuatingCharges |= (*i)->isFluctuatingCharge();
837 temp = usesDirectional;
838 MPI_Allreduce(MPI_IN_PLACE, &temp, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);
839 usesDirectionalAtoms_ = (temp == 0) ?
false : true;
842 MPI_Allreduce(MPI_IN_PLACE, &temp, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);
843 usesMetallicAtoms_ = (temp == 0) ?
false : true;
845 temp = usesElectrostatic;
846 MPI_Allreduce(MPI_IN_PLACE, &temp, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);
847 usesElectrostaticAtoms_ = (temp == 0) ?
false : true;
849 temp = usesFluctuatingCharges;
850 MPI_Allreduce(MPI_IN_PLACE, &temp, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);
851 usesFluctuatingCharges_ = (temp == 0) ?
false : true;
854 usesDirectionalAtoms_ = usesDirectional;
855 usesMetallicAtoms_ = usesMetallic;
856 usesElectrostaticAtoms_ = usesElectrostatic;
857 usesFluctuatingCharges_ = usesFluctuatingCharges;
861 requiresPrepair_ = usesMetallicAtoms_ ? true :
false;
862 requiresSkipCorrection_ = usesElectrostaticAtoms_ ? true :
false;
863 requiresSelfCorrection_ = usesElectrostaticAtoms_ ? true :
false;
867 SimInfo::MoleculeIterator mi;
869 Molecule::AtomIterator ai;
872 vector<int> GlobalAtomIndices(
getNAtoms(), 0);
875 for (atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
879 return GlobalAtomIndices;
883 SimInfo::MoleculeIterator mi;
885 Molecule::CutoffGroupIterator ci;
888 vector<int> GlobalGroupIndices;
893 for (cg = mol->beginCutoffGroup(ci); cg != NULL;
894 cg = mol->nextCutoffGroup(ci)) {
895 GlobalGroupIndices.push_back(cg->getGlobalIndex());
898 return GlobalGroupIndices;
903 SimInfo::MoleculeIterator mi;
905 Molecule::CutoffGroupIterator ci;
907 Molecule::AtomIterator ai;
919 massFactors_.clear();
923 for (cg = mol->beginCutoffGroup(ci); cg != NULL;
924 cg = mol->nextCutoffGroup(ci)) {
925 totalMass = cg->getMass();
926 for (atom = cg->beginAtom(ai); atom != NULL; atom = cg->nextAtom(ai)) {
944 int reg = mol->getRegion();
945 for (atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
946 identArray_.push_back(atom->getIdent());
947 regions_.push_back(reg);
951 topologyDone_ =
true;
955 properties_.addProperty(genData);
959 properties_.removeProperty(propName);
963 return properties_.getPropertyNames();
967 return properties_.getProperties();
971 const string& propName) {
972 return properties_.getPropertyByName(propName);
976 if (sman_ == sman) {
return; }
980 SimInfo::MoleculeIterator mi;
981 Molecule::AtomIterator ai;
982 Molecule::RigidBodyIterator rbIter;
983 Molecule::CutoffGroupIterator cgIter;
984 Molecule::BondIterator bondIter;
985 Molecule::BendIterator bendIter;
986 Molecule::TorsionIterator torsionIter;
987 Molecule::InversionIterator inversionIter;
999 for (atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
1002 for (rb = mol->beginRigidBody(rbIter); rb != NULL;
1003 rb = mol->nextRigidBody(rbIter)) {
1006 for (cg = mol->beginCutoffGroup(cgIter); cg != NULL;
1007 cg = mol->nextCutoffGroup(cgIter)) {
1010 for (bond = mol->beginBond(bondIter); bond != NULL;
1011 bond = mol->nextBond(bondIter)) {
1014 for (bend = mol->beginBend(bendIter); bend != NULL;
1015 bend = mol->nextBend(bendIter)) {
1018 for (torsion = mol->beginTorsion(torsionIter); torsion != NULL;
1019 torsion = mol->nextTorsion(torsionIter)) {
1022 for (inversion = mol->beginInversion(inversionIter); inversion != NULL;
1023 inversion = mol->nextInversion(inversionIter)) {
1029 ostream& operator<<(ostream& o,
SimInfo&) {
return o; }
1032 if (index >=
int(IOIndexToIntegrableObject.size())) {
1034 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
1035 "SimInfo::getIOIndexToIntegrableObject Error: Integrable Object\n"
1036 "\tindex exceeds number of known objects!\n");
1037 painCave.isFatal = 1;
1041 return IOIndexToIntegrableObject.at(index);
1044 void SimInfo::setIOIndexToIntegrableObject(
const vector<StuntDouble*>& v) {
1045 IOIndexToIntegrableObject = v;
1048 void SimInfo::calcNConstraints() {
1050 MPI_Allreduce(&nConstraints_, &nGlobalConstraints_, 1, MPI_INT, MPI_SUM,
1053 nGlobalConstraints_ = nConstraints_;
AtomType * getAtomType()
Returns the AtomType of this Atom.
AtomType is what OpenMD looks to for unchanging data about an atom.
void setSnapshotManager(SnapshotManager *sman)
Sets the Snapshot Manager of this cutoffGroup.
size_t getNIntegrableObjects()
Returns the total number of integrable objects in this molecule.
size_t getNInversions()
Returns the total number of improper torsions in this molecule.
int getGlobalIndex()
Returns the global index of this molecule.
size_t getNBends()
Returns the total number of bends in this molecule.
size_t getNConstraintPairs()
Returns the total number of constraints in this molecule.
size_t getNAtoms()
Returns the total number of atoms in this molecule.
size_t getNRigidBodies()
Returns the total number of rigid bodies in this molecule.
size_t getNBonds()
Returns the total number of bonds in this molecule.
size_t getNCutoffGroups()
Returns the total number of cutoff groups in this molecule.
size_t getNTorsions()
Returns the total number of torsions in this molecule.
std::vector< Atom * > getAtoms()
Returns the atoms of this rigid body.
void setSnapshotManager(SnapshotManager *sman)
Sets the Snapshot Manager of this ShortRangeInteraction.
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
bool removeMolecule(Molecule *mol)
Removes a molecule from SimInfo.
std::vector< std::shared_ptr< GenericData > > getProperties()
Returns all of the properties in PropertyMap.
std::vector< int > getGlobalGroupIndices()
returns a vector which maps the local cutoff group index on this processor to the global cutoff group...
void removeInteractionPairs(Molecule *mol)
remove all special interaction pairs which belong to a molecule from the appropriate lists.
Molecule * beginMolecule(MoleculeIterator &i)
Returns the first molecule in this SimInfo and intialize the iterator.
unsigned int getNAtoms()
Returns the number of local atoms.
void prepareTopology()
Do final bookkeeping before Force managers need their data.
std::shared_ptr< GenericData > getPropertyByName(const std::string &propName)
Returns property.
void setSnapshotManager(SnapshotManager *sman)
Sets the snapshot manager.
bool addMolecule(Molecule *mol)
Adds a molecule.
std::vector< std::string > getPropertyNames()
Returns all names of properties.
void addInteractionPairs(Molecule *mol)
add all special interaction pairs (including excluded interactions) in a molecule into the appropriat...
unsigned int getNLocalCutoffGroups()
Returns the number of effective cutoff groups on local processor.
Molecule * nextMolecule(MoleculeIterator &i)
Returns the next avaliable Molecule based on the iterator.
StuntDouble * getIOIndexToIntegrableObject(int index)
return an integral objects by its global index.
void addProperty(std::shared_ptr< GenericData > genData)
Adds property into property map.
std::vector< int > getGlobalAtomIndices()
returns a vector which maps the local atom index on this processor to the global atom index.
void removeProperty(const std::string &propName)
Removes property from PropertyMap by name.
AtomTypeSet getSimulatedAtomTypes()
Returns the set of atom types present in this simulation.
SimInfo(ForceField *ff, Globals *simParams)
Constructor of SimInfo.
SnapshotManager class is an abstract class which maintains a series of snapshots.
"Don't move, or you're dead! Stand up! Captain, we've got them!"
RealType getMass()
Returns the mass of this stuntDouble.
bool isLinear()
Tests the if this stuntDouble is a linear rigidbody.
void setSnapshotManager(SnapshotManager *sman)
Sets the Snapshot Manager of this stuntDouble.
bool isRigidBody()
Tests if this stuntDouble is a rigid body.
int getGlobalIndex()
Returns the global index of this stuntDouble.
bool isDirectional()
Tests if this stuntDouble is a directional one.
int getLocalIndex()
Returns the local index of this stuntDouble.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.