Simpatico
v1.10
|
A System for use in a Markov chain Monte Carlo simulation.
McSystem provides methods to evaluate energies of individual atoms, and other functions needed in MC simulations.
Definition at line 52 of file McSystem.h.
#include <McSystem.h>
Public Member Functions | |
McSystem () | |
Constructor. More... | |
virtual | ~McSystem () |
Destructor. More... | |
Parameter IO | |
virtual void | readParameters (std::istream &in) |
Read parameters from input file. More... | |
virtual void | loadParameters (Serializable::IArchive &ar) |
Load parameters from an archive, without configuration. More... | |
virtual void | saveParameters (Serializable::OArchive &ar) |
Save parameters to an archive, without configuration. More... | |
Initial Configurations | |
virtual void | readConfig (std::istream &in) |
Read system configuration from file. More... | |
virtual void | loadConfig (Serializable::IArchive &ar) |
Load the system configuration from an archive. More... | |
virtual void | generateMolecules (Array< int > const &capacities, Array< double > const &diameters) |
Generate molecules for all species. More... | |
Energy and Stress calculators | |
double | atomPotentialEnergy (const Atom &atom) const |
Calculate the total potential energy for one Atom. More... | |
double | potentialEnergy () const |
Return total potential energy of this System. More... | |
template<typename T > | |
void | computeVirialStress (T &stress) const |
Compute total virial stress (excludes kinetic contribution). More... | |
template<typename T > | |
void | computeStress (T &stress) const |
Compute total pressure (T=double), xyz pressures (T=Vector) or stress (T=Tensor). More... | |
void | unsetPotentialEnergies () |
Unset potential precomputed potential energy components. More... | |
void | unsetVirialStress () |
Unset precomputed virial stress components. More... | |
Potential Energy Accessors | |
McPairPotential & | pairPotential () const |
Return the McPairPotential by reference. More... | |
bool | hasBondPotential () const |
Does a bond potential exist?. More... | |
BondPotential & | bondPotential () const |
Return the BondPotential by reference. More... | |
bool | hasAnglePotential () const |
Does angle potential exist?. More... | |
AnglePotential & | anglePotential () const |
Return AnglePotential by reference. More... | |
bool | hasDihedralPotential () const |
Does a dihedral potential exist?. More... | |
DihedralPotential & | dihedralPotential () const |
Return the DihedralPotential by reference. More... | |
bool | hasCoulombPotential () const |
Does a Coulomb potential exist?. More... | |
CoulombPotential & | coulombPotential () const |
Return CoulombPotential by reference. More... | |
bool | hasExternalPotential () const |
Does an external potential exist?. More... | |
ExternalPotential & | externalPotential () const |
Return ExternalPotential by reference. More... | |
bool | hasLinkPotential () const |
Does a link potential exist?. More... | |
BondPotential & | linkPotential () const |
Return the McLinkPotential by reference. More... | |
Miscellaneous | |
Signal & | positionSignal () |
Signal to indicate change in atomic positions. More... | |
virtual bool | isValid () const |
Return true if McSystem is valid, or throw Exception. More... | |
![]() | |
System () | |
Default constructor. More... | |
System (const System &other) | |
Copy constructor. More... | |
virtual | ~System () |
Destructor. More... | |
void | setId (int Id) |
Set the integer Id for this System. More... | |
void | setSimulation (Simulation &simulation) |
Set the parent Simulation. More... | |
void | setFileMaster (FileMaster &filemaster) |
Set the FileMaster. More... | |
void | saveParameters (Serializable::OArchive &ar) |
Save internal state from an archive. More... | |
Factory< ConfigIo > & | configIoFactory () |
Get the configuration file reader/writer factory by reference. More... | |
void | setConfigIo (std::string &classname) |
Create a new configuration file reader/writer. More... | |
void | readConfig (std::string filename) |
Open, read and close configuration file. More... | |
void | writeConfig (std::ostream &out) |
Write system configuration to a specified ostream. More... | |
void | writeConfig (std::string filename) |
Open, write and close a configuration file. More... | |
void | saveConfig (Serializable::OArchive &ar) |
Save configuration. More... | |
Factory< TrajectoryReader > & | trajectoryReaderFactory () |
Get the trajectory reader/writer factory by reference. More... | |
void | addMolecule (Molecule &molecule) |
Add a Molecule to this System. More... | |
void | removeMolecule (Molecule &molecule) |
Remove a specific molecule from this System. More... | |
void | removeAllMolecules () |
Remove all molecules from this System. More... | |
void | subscribeMoleculeSetChange (MoleculeSetObserver &observer) |
Subscribe to moleculeSet change signal. More... | |
void | unsubscribeMoleculeSetChange (MoleculeSetObserver &observer) |
Unsubscribe from moleculeSet change signal. More... | |
int | nMolecule (int speciesId) const |
Get the number of molecules of one Species in this System. More... | |
int | nAtom () const |
Return the total number of atoms in this System. More... | |
bool | isEmpty () const |
Is this an empty System (i.e., one with no molecules) ? More... | |
int | moleculeId (const Molecule &molecule) const |
Get the index of a Molecule within its Species in this System. More... | |
Molecule & | molecule (int speciesId, int moleculeId) |
Get a specific Molecule in this System, by integer index. More... | |
Molecule & | randomMolecule (int speciesId) |
Get a random Molecule of a specified species in this System. More... | |
void | begin (int speciesId, MoleculeIterator &iterator) |
Initialize an iterator for molecules of one species in this System. More... | |
void | begin (int speciesId, ConstMoleculeIterator &iterator) const |
Initialize a const iterator for molecules of one species in this System. More... | |
PairFactory & | pairFactory () |
Get the PairFactory by reference. More... | |
std::string | pairStyle () const |
Return nonbonded pair style string. More... | |
Factory< BondPotential > & | bondFactory () |
Get the associated Factory<BondPotential> by reference. More... | |
std::string | bondStyle () const |
Return covalent bond style string. More... | |
Factory< AnglePotential > & | angleFactory () |
Get the associated AngleFactory by reference. More... | |
std::string | angleStyle () const |
Return angle potential style string. More... | |
Factory< DihedralPotential > & | dihedralFactory () |
Get the associated Dihedral Factory by reference. More... | |
std::string | dihedralStyle () const |
Return dihedral potential style string. More... | |
CoulombFactory & | coulombFactory () |
Get the associated Coulomb Factory by reference. More... | |
std::string | coulombStyle () const |
Return coulomb potential style string. More... | |
Factory< ExternalPotential > & | externalFactory () |
Get the associated ExternalPotential factory by reference. More... | |
std::string | externalStyle () const |
Return external potential style string. More... | |
Factory< BondPotential > & | linkFactory () |
Get the associated Link factory by reference. More... | |
std::string | linkStyle () const |
Return link potential style string. More... | |
LinkMaster & | linkMaster () const |
Get the LinkMaster by reference. More... | |
Factory< Perturbation > & | perturbationFactory () |
Get the perturbation factory by reference. More... | |
void | setExpectPerturbation () |
Set to expect a Perturbation in the parameter file. More... | |
bool | expectPerturbation () const |
Return true if we expect a perturbation. More... | |
bool | hasPerturbation () const |
Does this system have an associated Perturbation? More... | |
Perturbation & | perturbation () const |
Get the associated Perturbation by reference. More... | |
bool | hasReplicaMove () const |
Does this system have an associated ReplicaMove? More... | |
ReplicaMove & | replicaMove () const |
Get the associated ReplicaMove by reference. More... | |
int | id () const |
Get integer index for this System. More... | |
Simulation & | simulation () const |
Get the parent Simulation by reference. More... | |
Boundary & | boundary () const |
Get the Boundary by reference. More... | |
EnergyEnsemble & | energyEnsemble () const |
Get the EnergyEnsemble by reference. More... | |
BoundaryEnsemble & | boundaryEnsemble () const |
Get the BoundaryEnsemble by reference. More... | |
FileMaster & | fileMaster () const |
Get the associated FileMaster by reference. More... | |
bool | isCopy () const |
Was this System instantiated with the copy constructor? More... | |
![]() | |
ParamComposite () | |
Constructor. More... | |
ParamComposite (const ParamComposite &other) | |
Copy constructor. More... | |
ParamComposite (int capacity) | |
Constructor. More... | |
virtual | ~ParamComposite () |
Virtual destructor. More... | |
void | resetParam () |
Resets ParamComposite to its empty state. More... | |
virtual void | readParam (std::istream &in) |
Read the parameter file block. More... | |
virtual void | readParamOptional (std::istream &in) |
Read optional parameter file block. More... | |
virtual void | writeParam (std::ostream &out) |
Write all parameters to an output stream. More... | |
virtual void | load (Serializable::IArchive &ar) |
Load all parameters from an input archive. More... | |
virtual void | loadOptional (Serializable::IArchive &ar) |
Load an optional ParamComposite. More... | |
virtual void | save (Serializable::OArchive &ar) |
Saves all parameters to an archive. More... | |
void | saveOptional (Serializable::OArchive &ar) |
Saves isActive flag, and then calls save() iff isActive is true. More... | |
void | readParamComposite (std::istream &in, ParamComposite &child, bool next=true) |
Add and read a required child ParamComposite. More... | |
void | readParamCompositeOptional (std::istream &in, ParamComposite &child, bool next=true) |
Add and attempt to read an optional child ParamComposite. More... | |
template<typename Type > | |
ScalarParam< Type > & | read (std::istream &in, const char *label, Type &value) |
Add and read a new required ScalarParam < Type > object. More... | |
template<typename Type > | |
ScalarParam< Type > & | readOptional (std::istream &in, const char *label, Type &value) |
Add and read a new optional ScalarParam < Type > object. More... | |
template<typename Type > | |
CArrayParam< Type > & | readCArray (std::istream &in, const char *label, Type *value, int n) |
Add and read a required C array parameter. More... | |
template<typename Type > | |
CArrayParam< Type > & | readOptionalCArray (std::istream &in, const char *label, Type *value, int n) |
Add and read an optional C array parameter. More... | |
template<typename Type > | |
DArrayParam< Type > & | readDArray (std::istream &in, const char *label, DArray< Type > &array, int n) |
Add and read a required DArray < Type > parameter. More... | |
template<typename Type > | |
DArrayParam< Type > & | readOptionalDArray (std::istream &in, const char *label, DArray< Type > &array, int n) |
Add and read an optional DArray < Type > parameter. More... | |
template<typename Type , int N> | |
FArrayParam< Type, N > & | readFArray (std::istream &in, const char *label, FArray< Type, N > &array) |
Add and read a required FArray < Type, N > array parameter. More... | |
template<typename Type , int N> | |
FArrayParam< Type, N > & | readOptionalFArray (std::istream &in, const char *label, FArray< Type, N > &array) |
Add and read an optional FArray < Type, N > array parameter. More... | |
template<typename Type > | |
CArray2DParam< Type > & | readCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np) |
Add and read a required CArray2DParam < Type > 2D C-array. More... | |
template<typename Type > | |
CArray2DParam< Type > & | readOptionalCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np) |
Add and read an optional CArray2DParam < Type > 2D C-array parameter. More... | |
template<typename Type > | |
DMatrixParam< Type > & | readDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n) |
Add and read a required DMatrix < Type > matrix parameter. More... | |
template<typename Type > | |
DMatrixParam< Type > & | readOptionalDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n) |
Add and read an optional DMatrix < Type > matrix parameter. More... | |
template<typename Type > | |
DSymmMatrixParam< Type > & | readDSymmMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int n) |
Add and read a required symmetrix DMatrix. More... | |
template<typename Type > | |
DSymmMatrixParam< Type > & | readOptionalDSymmMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int n) |
Add and read an optional DMatrix matrix parameter. More... | |
Begin & | readBegin (std::istream &in, const char *label, bool isRequired=true) |
Add and read a class label and opening bracket. More... | |
End & | readEnd (std::istream &in) |
Add and read the closing bracket. More... | |
Blank & | readBlank (std::istream &in) |
Add and read a new Blank object, representing a blank line. More... | |
void | loadParamComposite (Serializable::IArchive &ar, ParamComposite &child, bool next=true) |
Add and load a required child ParamComposite. More... | |
void | loadParamCompositeOptional (Serializable::IArchive &ar, ParamComposite &child, bool next=true) |
Add and load an optional child ParamComposite if isActive. More... | |
template<typename Type > | |
ScalarParam< Type > & | loadParameter (Serializable::IArchive &ar, const char *label, Type &value, bool isRequired) |
Add and load a new ScalarParam < Type > object. More... | |
template<typename Type > | |
ScalarParam< Type > & | loadParameter (Serializable::IArchive &ar, const char *label, Type &value) |
Add and load new required ScalarParam < Type > object. More... | |
template<typename Type > | |
CArrayParam< Type > & | loadCArray (Serializable::IArchive &ar, const char *label, Type *value, int n, bool isRequired) |
Add a C array parameter and load its elements. More... | |
template<typename Type > | |
CArrayParam< Type > & | loadCArray (Serializable::IArchive &ar, const char *label, Type *value, int n) |
Add and load a required CArrayParam< Type > array parameter. More... | |
template<typename Type > | |
DArrayParam< Type > & | loadDArray (Serializable::IArchive &ar, const char *label, DArray< Type > &array, int n, bool isRequired) |
Add an load a DArray < Type > array parameter. More... | |
template<typename Type > | |
DArrayParam< Type > & | loadDArray (Serializable::IArchive &ar, const char *label, DArray< Type > &array, int n) |
Add and load a required DArray< Type > array parameter. More... | |
template<typename Type , int N> | |
FArrayParam< Type, N > & | loadFArray (Serializable::IArchive &ar, const char *label, FArray< Type, N > &array, bool isRequired) |
Add and load an FArray < Type, N > fixed-size array parameter. More... | |
template<typename Type , int N> | |
FArrayParam< Type, N > & | loadFArray (Serializable::IArchive &ar, const char *label, FArray< Type, N > &array) |
Add and load a required FArray < Type > array parameter. More... | |
template<typename Type > | |
CArray2DParam< Type > & | loadCArray2D (Serializable::IArchive &ar, const char *label, Type *value, int m, int n, int np, bool isRequired) |
Add and load a CArray2DParam < Type > C 2D array parameter. More... | |
template<typename Type > | |
CArray2DParam< Type > & | loadCArray2D (Serializable::IArchive &ar, const char *label, Type *value, int m, int n, int np) |
Add and load a required < Type > matrix parameter. More... | |
template<typename Type > | |
DMatrixParam< Type > & | loadDMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int m, int n, bool isRequired) |
Add and load a DMatrixParam < Type > matrix parameter. More... | |
template<typename Type > | |
DMatrixParam< Type > & | loadDMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int m, int n) |
Add and load a required DMatrixParam < Type > matrix parameter. More... | |
template<typename Type > | |
DSymmMatrixParam< Type > & | loadDSymmMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int n, bool isRequired) |
Add and load a symmetric DSymmMatrixParam < Type > matrix parameter. More... | |
template<typename Type > | |
DSymmMatrixParam< Type > & | loadDSymmMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int n) |
Add and load a required DSymmMatrixParam < Type > matrix parameter. More... | |
void | addParamComposite (ParamComposite &child, bool next=true) |
Add a child ParamComposite object to the format array. More... | |
Begin & | addBegin (const char *label) |
Add a Begin object representing a class name and bracket. More... | |
End & | addEnd () |
Add a closing bracket. More... | |
Blank & | addBlank () |
Create and add a new Blank object, representing a blank line. More... | |
std::string | className () const |
Get class name string. More... | |
bool | isRequired () const |
Is this ParamComposite required in the input file? More... | |
bool | isActive () const |
Is this parameter active? More... | |
![]() | |
virtual | ~ParamComponent () |
Destructor. More... | |
void | setIndent (const ParamComponent &parent, bool next=true) |
Set indent level. More... | |
std::string | indent () const |
Return indent string for this object (string of spaces). More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize this ParamComponent as a string. More... | |
![]() | |
virtual | ~Serializable () |
Destructor. More... | |
![]() | |
MpiFileIo () | |
Constructor. More... | |
MpiFileIo (const MpiFileIo &other) | |
Copy constructor. More... | |
bool | isIoProcessor () const |
Can this processor do file I/O ? More... | |
void | setIoCommunicator (MPI::Intracomm &communicator) |
Set the communicator. More... | |
void | clearCommunicator () |
Clear (nullify) the communicator. More... | |
bool | hasIoCommunicator () const |
Does this object have an associated MPI communicator? More... | |
MPI::Intracomm & | ioCommunicator () const |
Get the MPI communicator by reference. More... | |
Protected Member Functions | |
virtual Factory< Perturbation > * | newDefaultPerturbationFactory () |
Return a pointer to a new McPerturbationFactory. More... | |
void | setPairPotential (McPairPotential *pairPotentialPtr) |
Set the PairPotential. More... | |
![]() | |
Boundary & | maxBoundary () const |
Get the maximum Boundary by reference. More... | |
virtual ConfigIo * | newDefaultConfigIo () |
Return a pointer to a new default ConfigIo. More... | |
virtual Factory< ConfigIo > * | newDefaultConfigIoFactory () |
Return a pointer to a new default ConfigIoFactory. More... | |
virtual Factory< TrajectoryReader > * | newDefaultTrajectoryReaderFactory () |
Return a pointer to a new default TrajectoryReaderFactory. More... | |
void | readPerturbation (std::istream &in) |
Read the perturbation parameter block (if any) More... | |
void | loadPerturbation (Serializable::IArchive &ar) |
Load the perturbation parameter block (if any) More... | |
void | savePerturbation (Serializable::OArchive &ar) |
Save the perturbation parameter block (if any) More... | |
void | readReplicaMove (std::istream &in) |
Read the ReplicaMove parameter block (if any) More... | |
void | loadReplicaMove (Serializable::IArchive &ar) |
Read the ReplicaMove parameter block (if any) More... | |
void | saveReplicaMove (Serializable::OArchive &ar) |
Save the ReplicaMove parameter block (if any) More... | |
void | allocateMoleculeSets () |
Allocate and initialize molecule sets for all species. More... | |
void | readFileMaster (std::istream &in) |
Read FileMaster parameters, if none yet exists. More... | |
void | loadFileMaster (Serializable::IArchive &ar) |
Load FileMaster data from archive, if necessary. More... | |
void | saveFileMaster (Serializable::OArchive &ar) |
If necessary, save FileMaster to archive. More... | |
void | readPotentialStyles (std::istream &in) |
Read potential style parameter strings. More... | |
void | loadPotentialStyles (Serializable::IArchive &ar) |
Load potential style strings from an archive. More... | |
void | savePotentialStyles (Serializable::OArchive &ar) |
Save potential style strings. More... | |
void | readEnsembles (std::istream &in) |
Read energy and boundary ensemble parameters. More... | |
void | loadEnsembles (Serializable::IArchive &ar) |
Load energy and boundary ensembles from archive. More... | |
void | saveEnsembles (Serializable::OArchive &ar) |
Save energy and boundary ensembles. More... | |
void | readLinkMaster (std::istream &in) |
Read the LinkMaster parameters. More... | |
void | loadLinkMaster (Serializable::IArchive &ar) |
Load the LinkMaster. More... | |
void | saveLinkMaster (Serializable::OArchive &ar) |
Save the LinkMaster. More... | |
![]() | |
void | setClassName (const char *className) |
Set class name string. More... | |
void | setIsRequired (bool isRequired) |
Set or unset the isActive flag. More... | |
void | setIsActive (bool isActive) |
Set or unset the isActive flag. More... | |
void | setParent (ParamComponent ¶m, bool next=true) |
Set this to the parent of a child component. More... | |
void | addComponent (ParamComponent ¶m, bool isLeaf=true) |
Add a new ParamComponent object to the format array. More... | |
template<typename Type > | |
ScalarParam< Type > & | add (std::istream &in, const char *label, Type &value, bool isRequired=true) |
Add a new required ScalarParam < Type > object. More... | |
template<typename Type > | |
CArrayParam< Type > & | addCArray (std::istream &in, const char *label, Type *value, int n, bool isRequired=true) |
Add (but do not read) a required C array parameter. More... | |
template<typename Type > | |
DArrayParam< Type > & | addDArray (std::istream &in, const char *label, DArray< Type > &array, int n, bool isRequired=true) |
Add (but do not read) a DArray < Type > parameter. More... | |
template<typename Type , int N> | |
FArrayParam< Type, N > & | addFArray (std::istream &in, const char *label, FArray< Type, N > &array, bool isRequired=true) |
Add (but do not read) a FArray < Type, N > array parameter. More... | |
template<typename Type > | |
CArray2DParam< Type > & | addCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np, bool isRequired=true) |
Add (but do not read) a CArray2DParam < Type > 2D C-array. More... | |
template<typename Type > | |
DMatrixParam< Type > & | addDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n, bool isRequired=true) |
Add and read a required DMatrix < Type > matrix parameter. More... | |
![]() | |
ParamComponent () | |
Constructor. More... | |
ParamComponent (const ParamComponent &other) | |
Copy constructor. More... | |
Additional Inherited Members | |
![]() | |
typedef ArraySet< Molecule > | MoleculeSet |
A set of molecules of one Species in a System. More... | |
typedef PArrayIterator< Molecule > | MoleculeIterator |
Iterator for a MoleculeSet. More... | |
typedef ConstPArrayIterator< Molecule > | ConstMoleculeIterator |
Const Iterator for a MoleculeSet. More... | |
![]() | |
typedef BinaryFileOArchive | OArchive |
Type of output archive used by save method. More... | |
typedef BinaryFileIArchive | IArchive |
Type of input archive used by load method. More... | |
![]() | |
static void | initStatic () |
Initialize static echo member to false. More... | |
static void | setEcho (bool echo=true) |
Enable or disable echoing for all subclasses of ParamComponent. More... | |
static bool | echo () |
Get echo parameter. More... | |
McMd::McSystem::McSystem | ( | ) |
Constructor.
Definition at line 64 of file McSystem.cpp.
References Util::Signal< T >::addObserver(), McMd::System::isCopy(), positionSignal(), Util::ParamComposite::setClassName(), unsetPotentialEnergies(), unsetVirialStress(), and UTIL_CHECK.
|
virtual |
Destructor.
Definition at line 101 of file McSystem.cpp.
|
virtual |
Read parameters from input file.
This method first calls System::readParameters(in).
Finally, it allocates a CellList, and builds the new CellList if an initial configuration has been read previously by System::readParam. The number of cells allocated for the CellList is determined by the dimensions of maxBoundary and the maximum nonbonded cutoff distance.
in | file stream. |
Reimplemented from McMd::System.
Definition at line 132 of file McSystem.cpp.
References McMd::System::allocateMoleculeSets(), McMd::System::angleFactory(), McMd::System::angleStyle(), McMd::System::bondFactory(), McMd::System::bondStyle(), McMd::System::dihedralFactory(), McMd::System::dihedralStyle(), McMd::System::expectPerturbation(), McMd::System::externalFactory(), McMd::System::externalStyle(), Util::Factory< Data >::factory(), McMd::System::hasPerturbation(), McMd::System::linkFactory(), McMd::System::linkStyle(), McMd::PairFactory::mcFactory(), McMd::System::pairFactory(), McMd::System::pairStyle(), McMd::System::readEnsembles(), McMd::System::readFileMaster(), McMd::System::readLinkMaster(), Util::ParamComposite::readParamComposite(), McMd::System::readPerturbation(), McMd::System::readPotentialStyles(), McMd::System::readReplicaMove(), McMd::System::simulation(), and UTIL_THROW.
|
virtual |
Load parameters from an archive, without configuration.
ar | input/loading archive |
Reimplemented from McMd::System.
Definition at line 233 of file McSystem.cpp.
References McMd::System::allocateMoleculeSets(), McMd::System::angleFactory(), McMd::System::angleStyle(), McMd::System::bondFactory(), McMd::System::bondStyle(), McMd::System::dihedralFactory(), McMd::System::dihedralStyle(), McMd::System::externalFactory(), McMd::System::externalStyle(), Util::Factory< Data >::factory(), McMd::System::hasPerturbation(), McMd::System::linkFactory(), McMd::System::linkStyle(), McMd::System::loadEnsembles(), McMd::System::loadFileMaster(), McMd::System::loadLinkMaster(), Util::ParamComposite::loadParamComposite(), McMd::System::loadPerturbation(), McMd::System::loadPotentialStyles(), McMd::System::loadReplicaMove(), McMd::PairFactory::mcFactory(), McMd::System::pairFactory(), McMd::System::pairStyle(), McMd::System::simulation(), and UTIL_THROW.
|
virtual |
Save parameters to an archive, without configuration.
ar | output/saving archive |
Definition at line 331 of file McSystem.cpp.
References anglePotential(), bondPotential(), dihedralPotential(), McMd::System::hasPerturbation(), pairPotential(), Util::ParamComposite::save(), McMd::System::saveEnsembles(), McMd::System::saveFileMaster(), McMd::System::saveLinkMaster(), McMd::System::savePerturbation(), McMd::System::savePotentialStyles(), McMd::System::saveReplicaMove(), and McMd::System::simulation().
Referenced by McMd::McSimulation::save().
|
virtual |
Read system configuration from file.
Calls System::readConfig() and then builds CellList.
in | configuration file input stream |
Reimplemented from McMd::System.
Definition at line 393 of file McSystem.cpp.
References McMd::McPairPotential::buildCellList(), pairPotential(), and McMd::System::readConfig().
Referenced by McMd::McSimulation::analyzeConfigs(), and McMd::McCommandManager::readStandardCommand().
|
virtual |
Load the system configuration from an archive.
ar | input (loading) archive object. |
Reimplemented from McMd::System.
Definition at line 404 of file McSystem.cpp.
References McMd::McPairPotential::buildCellList(), McMd::System::loadConfig(), and pairPotential().
Referenced by McMd::McSimulation::loadParameters().
|
virtual |
Generate molecules for all species.
The array capacities contains at least nSpecies elements, in which element i contains the number of molecules to generate for species i.
The array capacities contains at least nAtomType elements, in which element i contains the steric diameter used for atom i in the packing algorithm.
capacities | number of molecules in each species |
diameters | diameter of each atom type |
Definition at line 415 of file McSystem.cpp.
References McMd::System::boundary(), McMd::McPairPotential::buildCellList(), Util::Log::file(), McMd::Generator::generate(), McMd::generatorFactory(), isValid(), McMd::Simulation::nSpecies(), pairPotential(), McMd::Generator::setupCellList(), McMd::System::simulation(), and UTIL_CHECK.
Referenced by McMd::McCommandManager::readStandardCommand().
double McMd::McSystem::atomPotentialEnergy | ( | const Atom & | atom | ) | const |
Calculate the total potential energy for one Atom.
atom | Atom object of interest |
Definition at line 459 of file McSystem.cpp.
References anglePotential(), McMd::McPairPotential::atomEnergy(), McMd::ExternalPotential::atomEnergy(), McMd::BondPotential::atomEnergy(), McMd::DihedralPotential::atomEnergy(), McMd::AnglePotential::atomEnergy(), bondPotential(), dihedralPotential(), externalPotential(), hasAnglePotential(), hasBondPotential(), hasDihedralPotential(), hasExternalPotential(), hasLinkPotential(), linkPotential(), and pairPotential().
Referenced by McMd::AtomDisplaceMove::move(), and McMd::RingOctaRebridgeMove::move().
double McMd::McSystem::potentialEnergy | ( | ) | const |
Return total potential energy of this System.
Definition at line 503 of file McSystem.cpp.
References anglePotential(), bondPotential(), dihedralPotential(), McMd::PairPotential::energy(), McMd::BondPotential::energy(), McMd::AnglePotential::energy(), McMd::ExternalPotential::energy(), McMd::DihedralPotential::energy(), externalPotential(), hasAnglePotential(), hasBondPotential(), hasDihedralPotential(), hasExternalPotential(), hasLinkPotential(), linkPotential(), and pairPotential().
Referenced by McMd::McEnergyPerturbation::derivative().
void McMd::McSystem::computeVirialStress | ( | T & | stress | ) | const |
Compute total virial stress (excludes kinetic contribution).
The virial stress is the sum of all pair and bonded stress components. It excludes the kinetic stress.
stress | (output) pressure, pressures or Tensor. |
Referenced by McMd::McVirialStressTensorAverage::sample(), unsetPotentialEnergies(), and McMd::McStressAutoCorrelation::~McStressAutoCorrelation().
void McMd::McSystem::computeStress | ( | T & | stress | ) | const |
Compute total pressure (T=double), xyz pressures (T=Vector) or stress (T=Tensor).
In this and all other stress / pressure calculators, typename T must be double to obtain total pressure, Util::Vector to obtain the diagonal pressure components, or Util::Tensor to obtain the full stress tensor. These templates work only for these three types. The parameter stress contains the desired value when the function returns.
The total stress is the sum of the virial stress arising from interatomic forces and an ideal gas kinetic stress.
stress | (output) pressure, xyz pressures or stress Tensor. |
Referenced by McMd::McStressAutoCorrelation::~McStressAutoCorrelation().
void McMd::McSystem::unsetPotentialEnergies | ( | ) |
Unset potential precomputed potential energy components.
Definition at line 545 of file McSystem.cpp.
References anglePotential(), bondPotential(), McMd::System::boundary(), McMd::StressCalculator::computeStress(), computeVirialStress(), dihedralPotential(), Util::Dimension, McMd::System::energyEnsemble(), externalPotential(), hasAnglePotential(), hasBondPotential(), hasDihedralPotential(), hasExternalPotential(), hasLinkPotential(), linkPotential(), McMd::System::nAtom(), pairPotential(), Util::setToZero(), Simp::EnergyEnsemble::temperature(), McMd::EnergyCalculator::unsetEnergy(), and Simp::OrthorhombicBoundary::volume().
Referenced by McSystem().
void McMd::McSystem::unsetVirialStress | ( | ) |
Unset precomputed virial stress components.
Definition at line 685 of file McSystem.cpp.
References anglePotential(), bondPotential(), dihedralPotential(), hasAnglePotential(), hasBondPotential(), hasDihedralPotential(), pairPotential(), and McMd::StressCalculator::unsetStress().
Referenced by McSystem().
|
inline |
Return the McPairPotential by reference.
Definition at line 388 of file McSystem.h.
Referenced by McMd::CfbLinear::addAtom(), McMd::CfbEndBase::addEndAtom(), McMd::CfbRebridgeBase::addMiddleAtom(), McMd::CfbRebridgeBase::addSequence(), McMd::McSimulation::analyzeConfigs(), McMd::McSimulation::analyzeTrajectory(), atomPotentialEnergy(), McMd::CfbLinear::deleteAtom(), McMd::CfbEndBase::deleteEndAtom(), McMd::CfbRebridgeBase::deleteMiddleAtom(), McMd::CfbRebridgeBase::deleteSequence(), McMd::McPairExternalPerturbation< PairInteraction, ExternalInteraction >::derivative(), McMd::McPairPerturbation< Interaction >::derivative(), McMd::McPerturbationFactory::factory(), generateMolecules(), McMd::McPairPerturbation< Interaction >::interaction(), isValid(), McMd::McNVTChemicalPotential::load(), loadConfig(), McMd::McSystemInterface::McSystemInterface(), McMd::MdSystem::MdSystem(), McMd::GcSliplinkMove::move(), McMd::SliplinkerAll::move(), McMd::SliplinkerEnd::move(), McMd::SliplinkMove::move(), McMd::RingTetraRebridgeMove::move(), McMd::AtomDisplaceMove::move(), McMd::CfbDoubleRebridgeMove::move(), McMd::CfbEndMove::move(), McMd::RingOctaRebridgeMove::move(), McMd::CfbLinearEndMove::move(), McMd::CfbRebridgeMove::move(), McMd::HomopolymerSemiGrandMove::move(), McMd::CfbReptationMove::move(), McMd::CfbRingRebridgeMove::move(), McMd::EndSwapMove::move(), McMd::CfbReptateMove::move(), McMd::HybridMdMove::move(), McMd::HybridNphMdMove::move(), McMd::RigidDisplaceMove::move(), McMd::MdMove::move(), McMd::DpdMove::move(), McMd::GroupRebridgeBase::octaEnergy(), potentialEnergy(), readConfig(), McMd::McPairExternalPerturbation< PairInteraction, ExternalInteraction >::readParameters(), McMd::McCommandManager::readStandardCommand(), McMd::McNVTChemicalPotential::sample(), McMd::McMuExchange::sample(), McMd::McEnergyOutput::sample(), McMd::McPairEnergyAverage::sample(), McMd::McEnergyAnalyzer::sample(), saveParameters(), McMd::RingOctaRebridgeMove::scanBridge(), McMd::McSimulation::simulate(), McMd::GroupRebridgeBase::tetraEnergy(), unsetPotentialEnergies(), and unsetVirialStress().
|
inline |
Does a bond potential exist?.
Definition at line 399 of file McSystem.h.
Referenced by atomPotentialEnergy(), McMd::McEnergyAnalyzer::clear(), McMd::MdSystem::MdSystem(), McMd::McEnergyAnalyzer::output(), potentialEnergy(), McMd::McEnergyAnalyzer::sample(), McMd::McEnergyAnalyzer::save(), McMd::McEnergyAnalyzer::setup(), unsetPotentialEnergies(), and unsetVirialStress().
|
inline |
Return the BondPotential by reference.
Definition at line 405 of file McSystem.h.
Referenced by McMd::CfbLinear::addAtom(), McMd::CfbEndBase::addEndAtom(), McMd::CfbRebridgeBase::addMiddleAtom(), atomPotentialEnergy(), McMd::CfbLinear::deleteAtom(), McMd::CfbEndBase::deleteEndAtom(), McMd::CfbRebridgeBase::deleteMiddleAtom(), McMd::generatorFactory(), McMd::McNVTChemicalPotential::load(), McMd::McSystemInterface::McSystemInterface(), McMd::MdSystem::MdSystem(), McMd::GroupRebridgeBase::octaEnergy(), potentialEnergy(), McMd::McCommandManager::readStandardCommand(), McMd::McNVTChemicalPotential::sample(), McMd::McEnergyOutput::sample(), McMd::McEnergyAnalyzer::sample(), saveParameters(), McMd::GroupRebridgeBase::tetraEnergy(), unsetPotentialEnergies(), and unsetVirialStress().
|
inline |
Does angle potential exist?.
Definition at line 416 of file McSystem.h.
Referenced by atomPotentialEnergy(), McMd::McEnergyAnalyzer::clear(), McMd::EndSwapMove::EndSwapMove(), McMd::MdSystem::MdSystem(), McMd::McEnergyAnalyzer::output(), potentialEnergy(), McMd::McEnergyAnalyzer::sample(), McMd::McEnergyAnalyzer::save(), McMd::McEnergyAnalyzer::setup(), unsetPotentialEnergies(), unsetVirialStress(), and McMd::CfbLinear::~CfbLinear().
|
inline |
Return AnglePotential by reference.
Definition at line 422 of file McSystem.h.
Referenced by McMd::CfbLinear::addAtom(), McMd::CfbEndBase::addEndAtom(), McMd::CfbRebridgeBase::addMiddleAtom(), atomPotentialEnergy(), McMd::CfbLinear::deleteAtom(), McMd::CfbEndBase::deleteEndAtom(), McMd::CfbRebridgeBase::deleteMiddleAtom(), McMd::McNVTChemicalPotential::load(), McMd::McSystemInterface::McSystemInterface(), McMd::MdSystem::MdSystem(), potentialEnergy(), McMd::McCommandManager::readStandardCommand(), McMd::McNVTChemicalPotential::sample(), McMd::McEnergyOutput::sample(), McMd::McEnergyAnalyzer::sample(), saveParameters(), unsetPotentialEnergies(), and unsetVirialStress().
|
inline |
Does a dihedral potential exist?.
Definition at line 433 of file McSystem.h.
Referenced by atomPotentialEnergy(), McMd::CfbEndBase::CfbEndBase(), McMd::CfbRebridgeBase::CfbRebridgeBase(), McMd::McEnergyAnalyzer::clear(), McMd::EndSwapMove::EndSwapMove(), McMd::GroupRebridgeBase::GroupRebridgeBase(), McMd::MdSystem::MdSystem(), McMd::McEnergyAnalyzer::output(), potentialEnergy(), McMd::McEnergyAnalyzer::sample(), McMd::McEnergyAnalyzer::save(), McMd::McEnergyAnalyzer::setup(), unsetPotentialEnergies(), unsetVirialStress(), and McMd::CfbLinear::~CfbLinear().
|
inline |
Return the DihedralPotential by reference.
Definition at line 439 of file McSystem.h.
Referenced by atomPotentialEnergy(), McMd::McNVTChemicalPotential::load(), McMd::McSystemInterface::McSystemInterface(), McMd::MdSystem::MdSystem(), potentialEnergy(), McMd::McCommandManager::readStandardCommand(), McMd::McEnergyOutput::sample(), McMd::McEnergyAnalyzer::sample(), saveParameters(), unsetPotentialEnergies(), and unsetVirialStress().
|
inline |
Does a Coulomb potential exist?.
Definition at line 450 of file McSystem.h.
Referenced by McMd::MdSystem::MdSystem(), and McMd::McEnergyAnalyzer::setup().
|
inline |
Return CoulombPotential by reference.
Definition at line 456 of file McSystem.h.
Referenced by McMd::MdSystem::MdSystem().
|
inline |
Does an external potential exist?.
Definition at line 467 of file McSystem.h.
Referenced by atomPotentialEnergy(), McMd::McEnergyAnalyzer::clear(), McMd::MdSystem::MdSystem(), McMd::McEnergyAnalyzer::output(), potentialEnergy(), McMd::McEnergyAnalyzer::sample(), McMd::McEnergyAnalyzer::save(), McMd::McEnergyAnalyzer::setup(), unsetPotentialEnergies(), and McMd::CfbLinear::~CfbLinear().
|
inline |
Return ExternalPotential by reference.
Definition at line 473 of file McSystem.h.
Referenced by McMd::CfbLinear::addAtom(), McMd::CfbEndBase::addEndAtom(), McMd::CfbRebridgeBase::addMiddleAtom(), atomPotentialEnergy(), McMd::CfbLinear::deleteAtom(), McMd::CfbEndBase::deleteEndAtom(), McMd::CfbRebridgeBase::deleteMiddleAtom(), McMd::McPairExternalPerturbation< PairInteraction, ExternalInteraction >::derivative(), McMd::McPerturbationFactory::factory(), McMd::McExternalPerturbation< Interaction >::interaction(), McMd::McNVTChemicalPotential::load(), McMd::McSystemInterface::McSystemInterface(), McMd::MdSystem::MdSystem(), McMd::CfbReptationMove::move(), McMd::EndSwapMove::move(), McMd::CfbReptateMove::move(), McMd::RigidDisplaceMove::move(), potentialEnergy(), McMd::McPairExternalPerturbation< PairInteraction, ExternalInteraction >::readParameters(), McMd::McExternalEnergyAverage::sample(), McMd::McNVTChemicalPotential::sample(), McMd::McEnergyOutput::sample(), McMd::McEnergyAnalyzer::sample(), and unsetPotentialEnergies().
|
inline |
Does a link potential exist?.
Definition at line 484 of file McSystem.h.
Referenced by atomPotentialEnergy(), McMd::MdSystem::MdSystem(), potentialEnergy(), and unsetPotentialEnergies().
|
inline |
Return the McLinkPotential by reference.
Definition at line 493 of file McSystem.h.
Referenced by atomPotentialEnergy(), McMd::MdSystem::MdSystem(), McMd::SliplinkerAll::move(), McMd::SliplinkerEnd::move(), McMd::Sliplinker::move(), McMd::SliplinkMove::move(), McMd::GcSliplinkMove::move(), potentialEnergy(), McMd::McEnergyOutput::sample(), and unsetPotentialEnergies().
|
inline |
Signal to indicate change in atomic positions.
Definition at line 519 of file McSystem.h.
Referenced by McSystem(), and McMd::McSimulation::simulate().
|
virtual |
Return true if McSystem is valid, or throw Exception.
Reimplemented from McMd::System.
Definition at line 721 of file McSystem.cpp.
References McMd::McPairPotential::cellList(), McMd::CellList::isValid(), McMd::System::isValid(), pairPotential(), and UTIL_CHECK.
Referenced by generateMolecules(), and McMd::McSimulation::isValid().
|
protectedvirtual |
Return a pointer to a new McPerturbationFactory.
Reimplemented from McMd::System.
Definition at line 714 of file McSystem.cpp.
|
inlineprotected |
Set the PairPotential.
pairPotentialPtr | pointer to pair potential |
Definition at line 512 of file McSystem.h.