52#ifndef BRAINS_SIMMODEL_HPP
53#define BRAINS_SIMMODEL_HPP
64#include "brains/PairList.hpp"
65#include "io/Globals.hpp"
68#include "nonbonded/SwitchingFunction.hpp"
69#include "types/MoleculeStamp.hpp"
72#include "utils/RandNumGen.hpp"
77 class SnapshotManager;
79 class SelectionManager;
95 using MoleculeIterator = std::map<int, Molecule*>::iterator;
160 unsigned int getNGlobalConstraints() {
161 if (!hasNGlobalConstraints_) calcNConstraints();
162 return nGlobalConstraints_;
232 void setFdf(
int fdf) { fdf_local = fdf; }
252 int getRigidBodyStorageLayout() {
return rigidBodyStorageLayout_; }
253 int getCutoffGroupStorageLayout() {
return cutoffGroupStorageLayout_; }
257 void setRigidBodyStorageLayout(
int rbsl) { rigidBodyStorageLayout_ = rbsl; }
258 void setCutoffGroupStorageLayout(
int cgsl) {
259 cutoffGroupStorageLayout_ = cgsl;
268 Globals* getSimParams() {
return simParams_; }
270 Utils::RandNumGenPtr getRandomNumberGenerator()
const {
284 int getMoleculeStampId(
int globalIndex) {
286 return molStampIds_[globalIndex];
302 i = molecules_.find(index);
304 return i != molecules_.end() ? i->second : NULL;
307 int getGlobalMolMembership(
int id) {
return globalMolMembership_[id]; }
323 std::string getFinalConfigFileName() {
return finalConfigFileName_; }
325 void setFinalConfigFileName(
const std::string& fileName) {
326 finalConfigFileName_ = fileName;
329 std::string getRawMetaData() {
return rawMetaData_; }
331 void setRawMetaData(
const std::string& rawMetaData) {
332 rawMetaData_ = rawMetaData;
335 std::string getDumpFileName() {
return dumpFileName_; }
337 void setDumpFileName(
const std::string& fileName) {
338 dumpFileName_ = fileName;
341 std::string getStatFileName() {
return statFileName_; }
343 void setStatFileName(
const std::string& fileName) {
344 statFileName_ = fileName;
347 std::string getReportFileName() {
return reportFileName_; }
349 void setReportFileName(
const std::string& fileName) {
350 reportFileName_ = fileName;
353 std::string getRestFileName() {
return restFileName_; }
355 void setRestFileName(
const std::string& fileName) {
356 restFileName_ = fileName;
363 assert(ggm.size() ==
static_cast<size_t>(nGlobalAtoms_));
364 globalGroupMembership_ = ggm;
372 (
static_cast<size_t>(nGlobalAtoms_ + nGlobalRigidBodies_)));
373 globalMolMembership_ = gmm;
376 bool isTopologyDone() {
return topologyDone_; }
378 bool getCalcBoxDipole() {
return calcBoxDipole_; }
379 bool getCalcBoxQuadrupole() {
return calcBoxQuadrupole_; }
381 bool getUseAtomicVirial() {
return useAtomicVirial_; }
387 void addProperty(std::shared_ptr<GenericData> genData);
433 friend ostream& operator<<(ostream& o,
SimInfo& info);
435 void getCutoff(RealType& rcut, RealType& rsw);
439 void setupSimVariables();
445 void calcNConstraints();
458 Utils::RandNumGenPtr randNumGen_;
467 int nIntegrableObjects_;
471 int nFluctuatingCharges_;
477 int nGlobalCutoffGroups_;
479 int nGlobalIntegrableObjects_;
481 int nGlobalRigidBodies_;
483 int nGlobalFluctuatingCharges_;
487 int nGlobalTorsions_;
488 int nGlobalInversions_;
489 int nGlobalConstraints_;
490 bool hasNGlobalConstraints_;
505 bool usesPeriodicBoundaries_;
506 bool usesDirectionalAtoms_;
508 bool usesMetallicAtoms_;
509 bool usesElectrostaticAtoms_;
510 bool usesFluctuatingCharges_;
511 bool usesAtomicVirial_;
512 bool requiresPrepair_;
513 bool requiresSkipCorrection_;
515 bool requiresSelfCorrection_;
519 bool usesElectrostaticAtoms() {
return usesElectrostaticAtoms_; }
520 bool usesDirectionalAtoms() {
return usesDirectionalAtoms_; }
521 bool usesFluctuatingCharges() {
return usesFluctuatingCharges_; }
522 bool usesAtomicVirial() {
return usesAtomicVirial_; }
523 bool requiresPrepair() {
return requiresPrepair_; }
524 bool requiresSkipCorrection() {
return requiresSkipCorrection_; }
525 bool requiresSelfCorrection() {
return requiresSelfCorrection_; }
529 std::map<int, Molecule*>
537 std::vector<int> molStampIds_;
538 std::vector<MoleculeStamp*> moleculeStamps_;
546 std::vector<int> globalGroupMembership_;
549 std::vector<int> getGlobalGroupMembership() {
550 return globalGroupMembership_;
560 std::vector<int> globalMolMembership_;
566 std::vector<int> identArray_;
569 std::vector<int> getIdentArray() {
return identArray_; }
576 std::vector<int> regions_;
579 std::vector<int> getRegions() {
return regions_; }
589 std::vector<RealType> massFactors_;
592 std::vector<RealType> getMassFactors() {
return massFactors_; }
594 PairList* getExcludedInteractions() {
return &excludedInteractions_; }
595 PairList* getOneTwoInteractions() {
return &oneTwoInteractions_; }
596 PairList* getOneThreeInteractions() {
return &oneThreeInteractions_; }
597 PairList* getOneFourInteractions() {
return &oneFourInteractions_; }
602 PairList excludedInteractions_;
604 PairList oneTwoInteractions_;
605 PairList oneThreeInteractions_;
606 PairList oneFourInteractions_;
608 PropertyMap properties_;
612 int atomStorageLayout_;
614 int rigidBodyStorageLayout_;
615 int cutoffGroupStorageLayout_;
625 LocalIndexManager localIndexMan_;
628 std::string rawMetaData_;
631 std::string finalConfigFileName_;
632 std::string dumpFileName_;
633 std::string statFileName_;
634 std::string reportFileName_;
635 std::string restFileName_;
643 bool calcBoxQuadrupole_;
646 bool useAtomicVirial_;
656 void setIOIndexToIntegrableObject(
const std::vector<StuntDouble*>& v);
659 std::vector<StuntDouble*> IOIndexToIntegrableObject;
669 return molToProcMap_[globalIndex];
676 molToProcMap_ = molToProcMap;
685 std::vector<int> molToProcMap_;
AtomType is what OpenMD looks to for unchanging data about an atom.
"utils/LocalIndexManager.hpp"
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.
int getNdf()
Returns the number of degrees of freedom.
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...
std::vector< std::shared_ptr< GenericData > > getProperties()
Returns all of the properties in PropertyMap.
int getGlobalCountOfType(AtomType *atype)
Returns the global count of atoms of a particular type.
int getNdfRaw()
Returns the number of raw degrees of freedom.
void setGlobalMolMembership(const std::vector< int > &gmm)
Sets GlobalMolMembership.
void setAtomStorageLayout(int asl)
Sets the storage layouts (computed by SimCreator)
void setNZconstraint(int nZconstraint)
Sets the number of z-constraint molecules in the system.
unsigned int getNInversions()
Returns the number of local inversions.
std::vector< int > getGlobalGroupIndices()
returns a vector which maps the local cutoff group index on this processor to the global cutoff group...
int getMolToProc(int globalIndex)
Finds the processor where a molecule resides.
void removeInteractionPairs(Molecule *mol)
remove all special interaction pairs which belong to a molecule from the appropriate lists.
ForceField * getForceField()
Returns the force field.
size_t getNMolecules()
Returns the number of local molecules.
unsigned int getNGlobalInversions()
Returns the number of global inversions.
Molecule * beginMolecule(MoleculeIterator &i)
Returns the first molecule in this SimInfo and intialize the iterator.
MoleculeStamp * getMoleculeStamp(int id)
Returns the molecule stamp.
unsigned int getNGlobalTorsions()
Returns the number of global torsions.
unsigned int getNIntegrableObjects()
Returns the number of local integrable objects.
unsigned int getNAtoms()
Returns the number of local atoms.
int getNGlobalRigidBodies()
Returns the total number of integrable objects (total number of rigid bodies plus the total number of...
unsigned int getNTorsions()
Returns the number of local torsions.
void prepareTopology()
Do final bookkeeping before Force managers need their data.
int getNdfLocal()
Returns the number of degrees of freedom (LOCAL)
int getAtomStorageLayout()
Returns the storage layouts (computed by SimCreator)
std::shared_ptr< GenericData > getPropertyByName(const std::string &propName)
Returns property.
unsigned int getNConstraints()
Returns the total number of constraints in this SimInfo.
unsigned int getNRigidBodies()
Returns the number of local rigid bodies.
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.
std::vector< std::string > getPropertyNames()
Returns all names of properties.
unsigned int getNBends()
Returns the number of local bends.
unsigned int getNCutoffGroups()
Returns the number of local cutoff groups.
void addInteractionPairs(Molecule *mol)
add all special interaction pairs (including excluded interactions) in a molecule into the appropriat...
unsigned int getNGlobalBonds()
Returns the number of global bonds.
unsigned int getNLocalCutoffGroups()
Returns the number of effective cutoff groups on local processor.
int getNFluctuatingCharges()
Returns the total number of fluctuating charges that are present.
Molecule * nextMolecule(MoleculeIterator &i)
Returns the next avaliable Molecule based on the iterator.
SnapshotManager * getSnapshotManager()
Returns the snapshot manager.
int getNGlobalCutoffGroups()
Returns the total number of cutoff groups in the system.
size_t getNMoleculeStamp()
Return the total number of the molecule stamps.
StuntDouble * getIOIndexToIntegrableObject(int index)
return an integral objects by its global index.
void setMolToProcMap(const std::vector< int > &molToProcMap)
Set MolToProcMap array.
void addProperty(std::shared_ptr< GenericData > genData)
Adds property into property map.
unsigned int getNGlobalBends()
Returns the number of global bends.
void setFdf(int fdf)
sets the current number of frozen degrees of freedom
unsigned int getNBonds()
Returns the number of local bonds.
std::vector< int > getGlobalAtomIndices()
returns a vector which maps the local atom index on this processor to the global atom index.
int getNZconstraint()
Returns the total number of z-constraint molecules in the system.
void removeProperty(const std::string &propName)
Removes property from PropertyMap by name.
AtomTypeSet getSimulatedAtomTypes()
Returns the set of atom types present in this simulation.
LocalIndexManager * getLocalIndexManager()
Returns the local index manager.
int getNdfTrans()
Returns the number of translational degrees of freedom.
SimInfo(ForceField *ff, Globals *simParams)
Constructor of SimInfo.
SnapshotManager class is an abstract class which maintains a series of snapshots.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.