55#ifndef BRAINS_SIMMODEL_HPP
56#define BRAINS_SIMMODEL_HPP
67#include "brains/PairList.hpp"
68#include "io/Globals.hpp"
71#include "nonbonded/SwitchingFunction.hpp"
72#include "types/MoleculeStamp.hpp"
75#include "utils/RandNumGen.hpp"
98 using MoleculeIterator = std::map<int, Molecule*>::iterator;
163 unsigned int getNGlobalConstraints() {
164 if (!hasNGlobalConstraints_) calcNConstraints();
165 return nGlobalConstraints_;
235 void setFdf(
int fdf) { fdf_local = fdf; }
255 int getRigidBodyStorageLayout() {
return rigidBodyStorageLayout_; }
256 int getCutoffGroupStorageLayout() {
return cutoffGroupStorageLayout_; }
260 void setRigidBodyStorageLayout(
int rbsl) { rigidBodyStorageLayout_ = rbsl; }
261 void setCutoffGroupStorageLayout(
int cgsl) {
262 cutoffGroupStorageLayout_ = cgsl;
271 Globals* getSimParams() {
return simParams_; }
273 Utils::RandNumGenPtr getRandomNumberGenerator()
const {
287 int getMoleculeStampId(
int globalIndex) {
289 return molStampIds_[globalIndex];
305 i = molecules_.find(index);
307 return i != molecules_.end() ? i->second : NULL;
310 int getGlobalMolMembership(
int id) {
return globalMolMembership_[id]; }
326 std::string getFinalConfigFileName() {
return finalConfigFileName_; }
328 void setFinalConfigFileName(
const std::string& fileName) {
329 finalConfigFileName_ = fileName;
332 std::string getRawMetaData() {
return rawMetaData_; }
334 void setRawMetaData(
const std::string& rawMetaData) {
335 rawMetaData_ = rawMetaData;
338 std::string getDumpFileName() {
return dumpFileName_; }
340 void setDumpFileName(
const std::string& fileName) {
341 dumpFileName_ = fileName;
344 std::string getStatFileName() {
return statFileName_; }
346 void setStatFileName(
const std::string& fileName) {
347 statFileName_ = fileName;
350 std::string getReportFileName() {
return reportFileName_; }
352 void setReportFileName(
const std::string& fileName) {
353 reportFileName_ = fileName;
356 std::string getRestFileName() {
return restFileName_; }
358 void setRestFileName(
const std::string& fileName) {
359 restFileName_ = fileName;
366 assert(ggm.size() ==
static_cast<size_t>(nGlobalAtoms_));
367 globalGroupMembership_ = ggm;
375 (
static_cast<size_t>(nGlobalAtoms_ + nGlobalRigidBodies_)));
376 globalMolMembership_ = gmm;
379 bool isTopologyDone() {
return topologyDone_; }
381 bool getCalcBoxDipole() {
return calcBoxDipole_; }
382 bool getCalcBoxQuadrupole() {
return calcBoxQuadrupole_; }
384 bool getUseAtomicVirial() {
return useAtomicVirial_; }
390 void addProperty(std::shared_ptr<GenericData> genData);
436 friend ostream& operator<<(ostream& o,
SimInfo& info);
438 void getCutoff(RealType& rcut, RealType& rsw);
442 void setupSimVariables();
448 void calcNConstraints();
461 Utils::RandNumGenPtr randNumGen_;
470 int nIntegrableObjects_;
474 int nFluctuatingCharges_;
480 int nGlobalCutoffGroups_;
482 int nGlobalIntegrableObjects_;
484 int nGlobalRigidBodies_;
486 int nGlobalFluctuatingCharges_;
490 int nGlobalTorsions_;
491 int nGlobalInversions_;
492 int nGlobalConstraints_;
493 bool hasNGlobalConstraints_;
508 bool usesPeriodicBoundaries_;
509 bool usesDirectionalAtoms_;
511 bool usesMetallicAtoms_;
512 bool usesElectrostaticAtoms_;
513 bool usesFluctuatingCharges_;
514 bool usesAtomicVirial_;
515 bool requiresPrepair_;
516 bool requiresSkipCorrection_;
518 bool requiresSelfCorrection_;
522 bool usesElectrostaticAtoms() {
return usesElectrostaticAtoms_; }
523 bool usesDirectionalAtoms() {
return usesDirectionalAtoms_; }
524 bool usesFluctuatingCharges() {
return usesFluctuatingCharges_; }
525 bool usesAtomicVirial() {
return usesAtomicVirial_; }
526 bool requiresPrepair() {
return requiresPrepair_; }
527 bool requiresSkipCorrection() {
return requiresSkipCorrection_; }
528 bool requiresSelfCorrection() {
return requiresSelfCorrection_; }
532 std::map<int, Molecule*>
540 std::vector<int> molStampIds_;
541 std::vector<MoleculeStamp*> moleculeStamps_;
549 std::vector<int> globalGroupMembership_;
552 std::vector<int> getGlobalGroupMembership() {
553 return globalGroupMembership_;
563 std::vector<int> globalMolMembership_;
569 std::vector<int> identArray_;
572 std::vector<int> getIdentArray() {
return identArray_; }
579 std::vector<int> regions_;
582 std::vector<int> getRegions() {
return regions_; }
592 std::vector<RealType> massFactors_;
595 std::vector<RealType> getMassFactors() {
return massFactors_; }
597 PairList* getExcludedInteractions() {
return &excludedInteractions_; }
598 PairList* getOneTwoInteractions() {
return &oneTwoInteractions_; }
599 PairList* getOneThreeInteractions() {
return &oneThreeInteractions_; }
600 PairList* getOneFourInteractions() {
return &oneFourInteractions_; }
605 PairList excludedInteractions_;
607 PairList oneTwoInteractions_;
608 PairList oneThreeInteractions_;
609 PairList oneFourInteractions_;
611 PropertyMap properties_;
615 int atomStorageLayout_;
617 int rigidBodyStorageLayout_;
618 int cutoffGroupStorageLayout_;
628 LocalIndexManager localIndexMan_;
631 std::string rawMetaData_;
634 std::string finalConfigFileName_;
635 std::string dumpFileName_;
636 std::string statFileName_;
637 std::string reportFileName_;
638 std::string restFileName_;
646 bool calcBoxQuadrupole_;
649 bool useAtomicVirial_;
659 void setIOIndexToIntegrableObject(
const std::vector<StuntDouble*>& v);
662 std::vector<StuntDouble*> IOIndexToIntegrableObject;
671 assert(globalIndex >= 0 && globalIndex < molToProcMap_.size());
672 return molToProcMap_[globalIndex];
679 molToProcMap_ = molToProcMap;
688 std::vector<int> molToProcMap_;
AtomType is what OpenMD looks to for unchanging data about an atom.
"utils/LocalIndexManager.hpp"
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.
"Don't move, or you're dead! Stand up! Captain, we've got them!"
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.