Simpatico
v1.10
|
The main object in a simulation, which coordinates others.
A Simulation object is the main object in a simulation. Which is instantiated in the main program, and coordinates creation and actions of other objects. Simulation is a base class, which has subclasses McSimulation and MdSimulation designed for MC and MD simulations.
A Simulation has the following publicly accessible members:
A Simulation also contains several global data structures.
Each Molecule is associated with a block of Atom objects, and blocks of Group objects (Bond, Angle, and Dihedral). These associations are created during initialization, and are permanent.
Each subclass of Simulation also has one or more System objects. An MdSimulation has one MdSystem. An McSimulation has one McSystem. A System represents a set of molecules surrounded by a Boundary. A System holds a set of pointers to Molecule objects in the array of Molecules owned by parent Simulation.
Definition at line 101 of file mcMd/simulation/Simulation.h.
#include <Simulation.h>
Public Member Functions | |
Simulation (MPI::Intracomm &communicator) | |
Constructor. More... | |
Simulation () | |
Constructor. More... | |
virtual | ~Simulation () |
Destructor. More... | |
void | outputOptions (std::ostream &out) const |
Output a list of options enabled and disabled during compilation. More... | |
Initialization | |
virtual void | setIoCommunicator (MPI::Intracomm &communicator) |
Set MPI job to read one parameter file and one command file. More... | |
void | setIoCommunicator () |
Set MPI job to read one parameter file and one command file. More... | |
virtual void | readParameters (std::istream &in) |
Read parameter file block and initialize simulation. More... | |
void | writeParam (std::string filename) |
Open output, write and close an output parameter file. More... | |
void | allocateMoleculeSet (Util::ArraySet< Molecule > &set, int speciesId) const |
Allocate and initialize a molecule set for one Species. More... | |
Serialization (Load / Save) | |
virtual void | loadParameters (Serializable::IArchive &ar) |
Load internal state from an archive. More... | |
virtual void | save (Serializable::OArchive &ar) |
Save internal state to an archive. More... | |
Molecule Management | |
Molecule & | getMolecule (int speciesId) |
Get a new molecule from a reservoir of unused Molecule objects. More... | |
void | returnMolecule (Molecule &molecule) |
Return a molecule to a reservoir of unused molecules. More... | |
Read-write accessors (return by non-const reference) | |
Random & | random () |
Get the random number generator by reference. More... | |
Species & | species (int i) |
Get a specific Species by reference. More... | |
Factory< Analyzer > & | analyzerFactory () |
Return the Analyzer factory by reference. More... | |
Factory< Species > & | speciesFactory () |
Return the Species Factory by reference. More... | |
FileMaster & | fileMaster () |
Get the FileMaster object. More... | |
MPI::Intracomm & | communicator () |
Get the MPI communicator by reference. More... | |
Read-only accessors (return by value or const reference) | |
int | iStep () const |
Get value of step index for main MC or MD loop. More... | |
int | nAtomType () const |
Get the number of atom types. More... | |
const AtomType & | atomType (int i) const |
Get a single AtomType object by const reference. More... | |
const Array< AtomType > & | atomTypes () const |
Get a const Array of all AtomType objects. More... | |
int | nSpecies () const |
Get the number of Species in this Simulation. More... | |
const Species & | species (int i) const |
Get a specific Species by const reference. More... | |
int | moleculeCapacity () const |
Get the total number of Molecules allocated. More... | |
int | atomCapacity () const |
Get the total number of Atoms allocated. More... | |
int | nSystem () const |
Get the number of Systems in this Simulation. More... | |
virtual bool | isValid () const |
Return true if Simulation is valid, or throw an Exception. More... | |
bool | hasSpecies () const |
Has data for all species structures and capacities. More... | |
MaskPolicy | maskedPairPolicy () const |
Return the value of the mask policy (MaskNone or MaskBonded). More... | |
int | nBondType () const |
Get the number of bond types. More... | |
int | bondCapacity () const |
Get the total number of Bonds allocated. More... | |
int | nAngleType () const |
Get the number of angle types. More... | |
int | angleCapacity () const |
Get the total number of Angles allocated. More... | |
int | nDihedralType () const |
Get the number of dihedral types. More... | |
int | dihedralCapacity () const |
Get the total number of Dihedrals allocated. More... | |
int | hasCoulomb () const |
Does a Coulomb potential exist? More... | |
int | hasExternal () const |
Does an external potential exist? More... | |
int | nLinkType () const |
Get the number of link types. More... | |
bool | hasCommunicator () const |
Does the simulation have an associated MPI communicator? 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... | |
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 | |
void | setAnalyzerManager (AnalyzerManager *ptr) |
Set the associated AnalyzerManager. More... | |
AnalyzerManager & | analyzerManager () |
Get the associated AnalyzerManager by reference. More... | |
void | setCommandManager (CommandManager *ptr) |
Set the associated CommandManager. More... | |
CommandManager & | commandManager () |
Get the associated CommandManager by reference. 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... | |
Protected Attributes | |
int | iStep_ |
Step index for main MC or MD loop. More... | |
int | nSystem_ |
Number of Systems of interacting molecules (> 1 in Gibbs ensemble). More... | |
Additional Inherited Members | |
![]() | |
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::Simulation::Simulation | ( | MPI::Intracomm & | communicator | ) |
Constructor.
Definition at line 39 of file mcMd/simulation/Simulation.cpp.
References McMd::commitMpiTypes(), Util::initStatic(), McMd::Analyzer::initStatic(), McMd::Atom::initStatic(), Util::FileMaster::openOutputFile(), Util::ParamComposite::setClassName(), Util::FileMaster::setDirectoryId(), Util::Log::setFile(), and UTIL_THROW.
McMd::Simulation::Simulation | ( | ) |
Constructor.
Definition at line 107 of file mcMd/simulation/Simulation.cpp.
References Util::initStatic(), McMd::Analyzer::initStatic(), McMd::Atom::initStatic(), and Util::ParamComposite::setClassName().
|
virtual |
Destructor.
Definition at line 161 of file mcMd/simulation/Simulation.cpp.
References McMd::Atom::deallocate().
|
virtual |
Set MPI job to read one parameter file and one command file.
Call this function before readParam() to allow a single parameter and command file to be used in multi-processor free energy perturbation simulations, and to read the parameter file from std in. It calls Util::ParamComposite:setIoCommunicator() and Util::FileMaster::setCommonControl().
communicator | MPI communicator used for parameter file. |
Definition at line 190 of file mcMd/simulation/Simulation.cpp.
References hasCommunicator(), Util::FileMaster::setCommonControl(), Util::MpiFileIo::setIoCommunicator(), and UTIL_THROW.
void McMd::Simulation::setIoCommunicator | ( | ) |
Set MPI job to read one parameter file and one command file.
Equivalent to Simulation::setIoCommunicator(communicator()).
Definition at line 205 of file mcMd/simulation/Simulation.cpp.
References communicator().
Referenced by McMd::McSimulation::load(), McMd::MdSimulation::setOptions(), and McMd::McSimulation::setOptions().
|
virtual |
Read parameter file block and initialize simulation.
in | parameter input stream |
Reimplemented from Util::ParamComposite.
Reimplemented in McMd::McSimulation, and McMd::MdSimulation.
Definition at line 212 of file mcMd/simulation/Simulation.cpp.
References hasSpecies(), nSpecies(), Util::ParamComposite::readParamComposite(), Simp::Species::setId(), species(), UTIL_ASSERT, and UTIL_THROW.
Referenced by McMd::MdSimulation::readParameters(), and McMd::McSimulation::readParameters().
void McMd::Simulation::writeParam | ( | std::string | filename | ) |
Open output, write and close an output parameter file.
Calls ParamComposite::writeParam internally. Opens file using FileMaster::openOutputFile function, with adds output prefix to filename.
filename | name of output parameter file |
Definition at line 313 of file mcMd/simulation/Simulation.cpp.
References fileMaster(), and Util::FileMaster::openOutputFile().
Referenced by McMd::McCommandManager::readStandardCommand(), and McMd::MdCommandManager::readStandardCommand().
void McMd::Simulation::allocateMoleculeSet | ( | Util::ArraySet< Molecule > & | set, |
int | speciesId | ||
) | const |
Allocate and initialize a molecule set for one Species.
This function is called during initialization by the readParam() function of an associated System.
set | molecule set for one Species in a System. |
speciesId | integer index of the relevant Species. |
Definition at line 901 of file mcMd/simulation/Simulation.cpp.
References Simp::Species::capacity(), and species().
Referenced by McMd::System::allocateMoleculeSets().
|
virtual |
Load internal state from an archive.
ar | input/loading archive |
Reimplemented from Util::ParamComposite.
Reimplemented in McMd::McSimulation, and McMd::MdSimulation.
Definition at line 324 of file mcMd/simulation/Simulation.cpp.
References hasSpecies(), Util::ParamComposite::loadParamComposite(), nSpecies(), Simp::Species::setId(), species(), and UTIL_ASSERT.
Referenced by McMd::McSimulation::loadParameters(), and McMd::MdSimulation::loadParameters().
|
virtual |
Save internal state to an archive.
ar | output/saving archive |
Reimplemented from Util::ParamComposite.
Reimplemented in McMd::MdSimulation, and McMd::McSimulation.
Definition at line 386 of file mcMd/simulation/Simulation.cpp.
References Util::DArray< Data >::allocate(), McMd::Atom::allocate(), McMd::Mask::append(), McMd::Molecule::atom(), Simp::SpeciesGroup< NAtom >::atomId(), Simp::Species::atomTypeId(), Simp::Species::capacity(), Simp::Species::id(), McMd::Atom::mask(), Simp::Species::nAngle(), Simp::Species::nAtom(), Simp::Species::nBond(), Simp::Species::nDihedral(), nSpecies(), Util::Random::save(), Util::FileMaster::save(), Util::Parameter::saveOptional(), McMd::Group< NAtom >::setAtom(), McMd::Molecule::setFirstAngle(), McMd::Molecule::setFirstAtom(), McMd::Molecule::setFirstBond(), McMd::Molecule::setFirstDihedral(), McMd::Molecule::setId(), McMd::Atom::setMolecule(), McMd::Molecule::setNAngle(), McMd::Molecule::setNAtom(), McMd::Molecule::setNBond(), McMd::Molecule::setNDihedral(), McMd::Molecule::setSpecies(), McMd::Group< NAtom >::setTypeId(), McMd::Atom::setTypeId(), species(), Simp::Species::speciesAngle(), Simp::Species::speciesBond(), Simp::Species::speciesDihedral(), Simp::SpeciesGroup< NAtom >::typeId(), and UTIL_THROW.
Referenced by McMd::McSimulation::save(), and McMd::MdSimulation::save().
Molecule & McMd::Simulation::getMolecule | ( | int | speciesId | ) |
Get a new molecule from a reservoir of unused Molecule objects.
speciesId | integer index of the relevant Species. |
Definition at line 912 of file mcMd/simulation/Simulation.cpp.
References McMd::Activate::activate().
Referenced by McMd::TrajectoryReader::addMolecules(), McMd::Generator::generate(), McMd::System::loadConfig(), McMd::McMdConfigIo::read(), McMd::SmpConfigIo::read(), McMd::DdMdConfigIo::read(), McMd::LammpsConfigIo::read(), and McMd::McNVTChemicalPotential::sample().
void McMd::Simulation::returnMolecule | ( | Molecule & | molecule | ) |
Return a molecule to a reservoir of unused molecules.
molecule | Molecule object to be returned. |
Definition at line 922 of file mcMd/simulation/Simulation.cpp.
References Simp::Species::id(), and McMd::Molecule::species().
Referenced by McMd::System::removeAllMolecules(), and McMd::McNVTChemicalPotential::sample().
|
inline |
Get the random number generator by reference.
Definition at line 837 of file mcMd/simulation/Simulation.h.
Referenced by McMd::LinearGenerator::attemptPlaceMolecule(), McMd::HybridNphMdMove::move(), McMd::ReplicaMove::move(), McMd::System::randomMolecule(), McMd::MdSystem::setBoltzmannVelocities(), and McMd::NvtLangevinIntegrator::step().
Species & McMd::Simulation::species | ( | int | i | ) |
Get a specific Species by reference.
i | integer index of desired Species |
Definition at line 939 of file mcMd/simulation/Simulation.cpp.
Referenced by McMd::BondPotentialImpl< Interaction >::addForces(), McMd::DihedralPotentialImpl< Interaction >::addForces(), McMd::AnglePotentialImpl< Interaction >::addForces(), McMd::TrajectoryReader::addMolecules(), allocateMoleculeSet(), McMd::BondPotentialImpl< Interaction >::computeEnergy(), McMd::DihedralPotentialImpl< Interaction >::computeEnergy(), McMd::AnglePotentialImpl< Interaction >::computeEnergy(), McMd::Generator::generate(), McMd::ClusterIdentifier::initialize(), isValid(), McMd::System::loadConfig(), McMd::HomopolymerSemiGrandMove::loadParameters(), McMd::CfbDoubleRebridgeMove::loadParameters(), McMd::AtomMSD::loadParameters(), McMd::RingOctaRebridgeMove::loadParameters(), McMd::SemiGrandDistribution::loadParameters(), McMd::CfbEndMove::loadParameters(), McMd::RigidDisplaceMove::loadParameters(), McMd::CfbLinearEndMove::loadParameters(), McMd::CfbRebridgeMove::loadParameters(), McMd::TypeDistribution::loadParameters(), McMd::CfbReptationMove::loadParameters(), McMd::EndSwapMove::loadParameters(), McMd::CfbRingRebridgeMove::loadParameters(), McMd::CfbReptateMove::loadParameters(), McMd::RingTetraRebridgeMove::loadParameters(), McMd::ComMSD::loadParameters(), McMd::RingRouseAutoCorr::loadParameters(), McMd::LinearRouseAutoCorr::loadParameters(), McMd::MdPairEnergyCoefficients::loadParameters(), McMd::McMuExchange::loadParameters(), McMd::IntraPairAutoCorr::loadParameters(), McMd::RadiusGyration::loadParameters(), McMd::BlockRadiusGyration::loadParameters(), loadParameters(), McMd::SystemInterface::nAtom(), McMd::System::nAtom(), McMd::LinkLTPos::output(), McMd::SmpConfigIo::read(), McMd::McMdConfigIo::read(), McMd::DdMdConfigIo::read(), McMd::LammpsConfigIo::read(), McMd::LammpsDumpReader::readFrame(), McMd::DdMdTrajectoryReader::readFrame(), McMd::DCDTrajectoryReader::readFrame(), McMd::HomopolymerSemiGrandMove::readParameters(), McMd::CfbDoubleRebridgeMove::readParameters(), McMd::RigidDisplaceMove::readParameters(), McMd::SemiGrandDistribution::readParameters(), McMd::RingOctaRebridgeMove::readParameters(), McMd::CfbEndMove::readParameters(), McMd::AtomMSD::readParameters(), McMd::RingTetraRebridgeMove::readParameters(), McMd::CfbLinearEndMove::readParameters(), McMd::CfbRebridgeMove::readParameters(), McMd::G1MSD::readParameters(), McMd::TypeDistribution::readParameters(), McMd::CfbReptationMove::readParameters(), McMd::CfbRingRebridgeMove::readParameters(), McMd::EndSwapMove::readParameters(), McMd::CfbReptateMove::readParameters(), McMd::ComMSD::readParameters(), McMd::RingRouseAutoCorr::readParameters(), McMd::McMuExchange::readParameters(), McMd::MdPairEnergyCoefficients::readParameters(), McMd::LinearRouseAutoCorr::readParameters(), McMd::EndtoEndXYZ::readParameters(), McMd::IntraPairAutoCorr::readParameters(), McMd::RadiusGyration::readParameters(), McMd::EndtoEnd::readParameters(), McMd::BlockRadiusGyration::readParameters(), readParameters(), McMd::LinkLTPos::sample(), McMd::MdPairEnergyCoefficients::sample(), save(), McMd::System::saveConfig(), McMd::LinkLTPos::setup(), McMd::SmpConfigIo::write(), McMd::McMdConfigIo::write(), McMd::DdMdConfigIo::write(), McMd::LammpsConfigIo::write(), McMd::CfbLinear::~CfbLinear(), and McMd::MdPairEnergyCoefficients::~MdPairEnergyCoefficients().
Return the Analyzer factory by reference.
Definition at line 1330 of file mcMd/simulation/Simulation.cpp.
References Util::Manager< Data >::factory(), and UTIL_CHECK.
Referenced by McMd::SliplinkMcModule::SliplinkMcModule().
Return the Species Factory by reference.
Definition at line 1321 of file mcMd/simulation/Simulation.cpp.
References Util::Manager< Data >::factory(), and UTIL_CHECK.
|
inline |
Get the FileMaster object.
Definition at line 859 of file mcMd/simulation/Simulation.h.
Referenced by McMd::MdSimulation::analyzeConfigs(), McMd::McSimulation::analyzeConfigs(), McMd::MdSimulation::load(), McMd::McSimulation::load(), McMd::McSimulation::McSimulation(), McMd::MdSimulation::MdSimulation(), McMd::LammpsDumpReader::open(), McMd::DdMdTrajectoryReader::open(), McMd::McEnergyAnalyzer::output(), McMd::MdEnergyAnalyzer::output(), McMd::MdSimulation::readCommands(), McMd::McSimulation::readCommands(), McMd::MdSimulation::readParam(), McMd::McSimulation::readParam(), McMd::MdSimulation::save(), McMd::McSimulation::save(), McMd::MdSimulation::setOptions(), McMd::McSimulation::setOptions(), McMd::McEnergyAnalyzer::setup(), McMd::MdEnergyAnalyzer::setup(), and writeParam().
|
inline |
Get the MPI communicator by reference.
Definition at line 847 of file mcMd/simulation/Simulation.h.
Referenced by McMd::BennettsMethod::BennettsMethod(), McMd::McPerturbationFactory::factory(), McMd::MdSimulation::readCommands(), McMd::McSimulation::readCommands(), McMd::ReplicaMove::ReplicaMove(), and setIoCommunicator().
|
inline |
Get value of step index for main MC or MD loop.
Definition at line 856 of file mcMd/simulation/Simulation.h.
Referenced by McMd::VelProf::output(), McMd::LinkLifeTime::sample(), and McMd::LinkLTPos::sample().
|
inline |
Get the number of atom types.
Definition at line 768 of file mcMd/simulation/Simulation.h.
Referenced by McMd::NveVvIntegrator::loadParameters(), McMd::NvtLangevinIntegrator::loadParameters(), McMd::RDF::loadParameters(), McMd::CompositionProfile::loadParameters(), McMd::StructureFactor::loadParameters(), McMd::StructureFactorP::loadParameters(), McMd::IntraStructureFactor::loadParameters(), McMd::NveVvIntegrator::readParameters(), McMd::NvtLangevinIntegrator::readParameters(), McMd::NvtNhIntegrator::readParameters(), McMd::RDF::readParameters(), McMd::CompositionProfile::readParameters(), McMd::NphIntegrator::readParameters(), McMd::StructureFactor::readParameters(), McMd::BlockRadiusGyration::readParameters(), McMd::StructureFactorPGrid::readParameters(), McMd::StructureFactorGrid::readParameters(), McMd::IntraStructureFactorGrid::readParameters(), McMd::VanHove::readParameters(), McMd::StructureFactorP::readParameters(), McMd::IntraStructureFactor::readParameters(), McMd::McCommandManager::readStandardCommand(), McMd::MdCommandManager::readStandardCommand(), McMd::NvtDpdVvIntegrator::setup(), McMd::NvtNhIntegrator::setup(), and McMd::LammpsConfigIo::write().
|
inline |
Get a single AtomType object by const reference.
i | integer index of desired AtomType |
Definition at line 780 of file mcMd/simulation/Simulation.h.
Referenced by McMd::MdSystem::kineticEnergy(), McMd::MdSystem::setBoltzmannVelocities(), McMd::NveVvIntegrator::setup(), McMd::NvtLangevinIntegrator::setup(), McMd::NvtDpdVvIntegrator::setup(), McMd::NvtNhIntegrator::setup(), and McMd::NphIntegrator::setup().
Get a const Array of all AtomType objects.
Definition at line 777 of file mcMd/simulation/Simulation.h.
int McMd::Simulation::nSpecies | ( | ) | const |
Get the number of Species in this Simulation.
Definition at line 933 of file mcMd/simulation/Simulation.cpp.
References Util::Manager< Data >::size().
Referenced by McMd::ExternalPotentialImpl< Interaction >::addForces(), McMd::MdSpmePotential::addForces(), McMd::MdEwaldPotential::addForces(), McMd::BondPotentialImpl< Interaction >::addForces(), McMd::DihedralPotentialImpl< Interaction >::addForces(), McMd::AnglePotentialImpl< Interaction >::addForces(), McMd::TrajectoryReader::addMolecules(), McMd::System::allocateMoleculeSets(), McMd::McPairPotential::buildCellList(), McMd::MdPairPotential::buildPairList(), McMd::ExternalPotentialImpl< Interaction >::computeEnergy(), McMd::MdEwaldPotential::computeEnergy(), McMd::MdSpmePotential::computeEnergy(), McMd::BondPotentialImpl< Interaction >::computeEnergy(), McMd::DihedralPotentialImpl< Interaction >::computeEnergy(), McMd::AnglePotentialImpl< Interaction >::computeEnergy(), McMd::McExternalPerturbation< Interaction >::derivative(), McMd::McPairExternalPerturbation< PairInteraction, ExternalInteraction >::derivative(), McMd::DeformCommand::execute(), McMd::McSystem::generateMolecules(), McMd::MdSystem::generateMolecules(), McMd::SystemInterface::isEmpty(), McMd::System::isEmpty(), isValid(), McMd::System::isValid(), McMd::MdSystem::kineticEnergy(), McMd::System::loadConfig(), McMd::SemiGrandDistribution::loadParameters(), McMd::TypeDistribution::loadParameters(), loadParameters(), McMd::MdEwaldPotential::makeWaves(), McMd::MdSpmePotential::makeWaves(), McMd::HybridMdMove::move(), McMd::HybridNphMdMove::move(), McMd::ReplicaMove::move(), McMd::SystemInterface::nAtom(), McMd::System::nAtom(), McMd::McMdConfigIo::read(), McMd::SmpConfigIo::read(), McMd::DdMdConfigIo::read(), McMd::LammpsConfigIo::read(), McMd::LammpsDumpReader::readFrame(), McMd::DdMdTrajectoryReader::readFrame(), McMd::DCDTrajectoryReader::readFrame(), readParameters(), McMd::McCommandManager::readStandardCommand(), McMd::MdCommandManager::readStandardCommand(), McMd::System::removeAllMolecules(), McMd::MdSystem::removeDriftVelocity(), McMd::Crosslinker::sample(), McMd::McExternalEnergyAverage::sample(), McMd::CompositionProfile::sample(), McMd::RDF::sample(), McMd::StructureFactor::sample(), McMd::VanHove::sample(), McMd::StructureFactorP::sample(), save(), McMd::System::saveConfig(), McMd::MdSystem::setBoltzmannVelocities(), McMd::VelProf::setup(), McMd::MdSystem::setZeroForces(), McMd::MdSystem::setZeroVelocities(), McMd::MdSystem::shiftAtoms(), McMd::NveVvIntegrator::step(), McMd::NvtLangevinIntegrator::step(), McMd::NvtDpdVvIntegrator::step(), McMd::NvtNhIntegrator::step(), McMd::NphIntegrator::step(), McMd::SmpConfigIo::write(), McMd::McMdConfigIo::write(), McMd::DdMdConfigIo::write(), and McMd::LammpsConfigIo::write().
const Species & McMd::Simulation::species | ( | int | i | ) | const |
Get a specific Species by const reference.
i | integer index of desired Species |
Definition at line 945 of file mcMd/simulation/Simulation.cpp.
|
inline |
Get the total number of Molecules allocated.
Definition at line 771 of file mcMd/simulation/Simulation.h.
|
inline |
Get the total number of Atoms allocated.
Definition at line 774 of file mcMd/simulation/Simulation.h.
Referenced by McMd::Generator::generate(), McMd::ClusterIdentifier::initialize(), McMd::ReplicaMove::loadParameters(), McMd::SliplinkerAll::move(), McMd::Sliplinker::move(), McMd::ReplicaMove::readParameters(), and McMd::ReplicaMove::save().
|
inline |
Get the number of Systems in this Simulation.
This will return 1 for an McSimulation or MdSimulation.
Definition at line 765 of file mcMd/simulation/Simulation.h.
|
virtual |
Return true if Simulation is valid, or throw an Exception.
Reimplemented in McMd::McSimulation, and McMd::MdSimulation.
Definition at line 951 of file mcMd/simulation/Simulation.cpp.
References McMd::Molecule::angle(), McMd::Group< NAtom >::atom(), McMd::Molecule::atom(), Simp::SpeciesGroup< NAtom >::atomId(), Simp::Species::atomTypeId(), McMd::Molecule::bond(), Simp::Species::capacity(), McMd::Molecule::dihedral(), McMd::Molecule::id(), McMd::Group< NAtom >::isActive(), McMd::Atom::isActive(), McMd::Mask::isMasked(), Simp::Species::isMutable(), Simp::Species::isValid(), McMd::Atom::mask(), McMd::Atom::molecule(), McMd::Molecule::nAngle(), Simp::Species::nAngle(), Simp::Species::nAtom(), McMd::Molecule::nBond(), Simp::Species::nBond(), McMd::Molecule::nDihedral(), Simp::Species::nDihedral(), nSpecies(), McMd::Molecule::species(), species(), Simp::Species::speciesAngle(), Simp::Species::speciesBond(), Simp::Species::speciesDihedral(), McMd::Group< NAtom >::typeId(), Simp::SpeciesGroup< NAtom >::typeId(), McMd::Atom::typeId(), and UTIL_THROW.
Referenced by McMd::MdSimulation::isValid(), and McMd::McSimulation::isValid().
|
inline |
Has data for all species structures and capacities.
Definition at line 840 of file mcMd/simulation/Simulation.h.
Referenced by loadParameters(), and readParameters().
|
inline |
Return the value of the mask policy (MaskNone or MaskBonded).
Definition at line 833 of file mcMd/simulation/Simulation.h.
Referenced by McMd::CfbReptationMove::readParameters(), and McMd::CfbReptateMove::readParameters().
|
inline |
Get the number of bond types.
Definition at line 784 of file mcMd/simulation/Simulation.h.
Referenced by McMd::System::loadPotentialStyles(), McMd::System::readPotentialStyles(), and McMd::LammpsConfigIo::write().
|
inline |
Get the total number of Bonds allocated.
Definition at line 787 of file mcMd/simulation/Simulation.h.
|
inline |
Get the number of angle types.
Definition at line 792 of file mcMd/simulation/Simulation.h.
Referenced by McMd::System::loadPotentialStyles(), McMd::System::readPotentialStyles(), and McMd::LammpsConfigIo::write().
|
inline |
Get the total number of Angles allocated.
Definition at line 795 of file mcMd/simulation/Simulation.h.
|
inline |
Get the number of dihedral types.
Definition at line 800 of file mcMd/simulation/Simulation.h.
Referenced by McMd::System::loadPotentialStyles(), McMd::System::readPotentialStyles(), and McMd::LammpsConfigIo::write().
|
inline |
Get the total number of Dihedrals allocated.
Definition at line 803 of file mcMd/simulation/Simulation.h.
|
inline |
Does a Coulomb potential exist?
Definition at line 808 of file mcMd/simulation/Simulation.h.
Referenced by McMd::System::loadPotentialStyles(), McMd::PairFactory::mdFactory(), and McMd::System::readPotentialStyles().
|
inline |
Does an external potential exist?
Definition at line 813 of file mcMd/simulation/Simulation.h.
Referenced by McMd::System::loadPotentialStyles(), and McMd::System::readPotentialStyles().
|
inline |
Get the number of link types.
Definition at line 818 of file mcMd/simulation/Simulation.h.
Referenced by McMd::System::loadPotentialStyles(), and McMd::System::readPotentialStyles().
|
inline |
Does the simulation have an associated MPI communicator?
Definition at line 844 of file mcMd/simulation/Simulation.h.
Referenced by setIoCommunicator().
void McMd::Simulation::outputOptions | ( | std::ostream & | out | ) | const |
Output a list of options enabled and disabled during compilation.
out | output stream |
Definition at line 1257 of file mcMd/simulation/Simulation.cpp.
Referenced by McMd::MdSimulation::setOptions(), and McMd::McSimulation::setOptions().
|
protected |
Set the associated AnalyzerManager.
This should be called in the constructor for each subclass of Simulation (e.g., in McSimulation and MdSimulation) by register an instance of an appropriate subclass of AnalyzerManager.
Definition at line 177 of file mcMd/simulation/Simulation.cpp.
Referenced by McMd::McSimulation::McSimulation(), and McMd::MdSimulation::MdSimulation().
|
inlineprotected |
Get the associated AnalyzerManager by reference.
Definition at line 862 of file mcMd/simulation/Simulation.h.
References UTIL_CHECK.
Referenced by McMd::MdSimulation::analyzeConfigs(), McMd::McSimulation::analyzeConfigs(), McMd::MdSimulation::analyzeTrajectory(), McMd::McSimulation::analyzeTrajectory(), McMd::MdSimulation::loadParameters(), McMd::McSimulation::loadParameters(), McMd::MdSimulation::readParameters(), McMd::McSimulation::readParameters(), McMd::McSimulation::save(), McMd::MdSimulation::save(), McMd::MdSimulation::simulate(), and McMd::McSimulation::simulate().
|
protected |
Set the associated CommandManager.
Definition at line 183 of file mcMd/simulation/Simulation.cpp.
Referenced by McMd::McSimulation::McSimulation(), and McMd::MdSimulation::MdSimulation().
|
inlineprotected |
Get the associated CommandManager by reference.
Definition at line 868 of file mcMd/simulation/Simulation.h.
References UTIL_CHECK.
Referenced by McMd::McSimulation::loadParameters(), McMd::MdSimulation::loadParameters(), McMd::MdSimulation::readCommand(), McMd::McSimulation::readCommand(), McMd::MdSimulation::readCommands(), McMd::McSimulation::readCommands(), McMd::MdSimulation::readParameters(), McMd::McSimulation::readParameters(), McMd::McSimulation::save(), and McMd::MdSimulation::save().
|
protected |
Step index for main MC or MD loop.
Definition at line 422 of file mcMd/simulation/Simulation.h.
Referenced by McMd::MdSimulation::analyzeConfigs(), McMd::McSimulation::analyzeConfigs(), McMd::MdSimulation::analyzeTrajectory(), McMd::McSimulation::analyzeTrajectory(), McMd::McSimulation::loadParameters(), McMd::MdSimulation::loadParameters(), McMd::MdSimulation::readCommands(), McMd::McSimulation::readCommands(), McMd::McSimulation::save(), McMd::MdSimulation::save(), McMd::MdSimulation::simulate(), and McMd::McSimulation::simulate().
|
protected |
Number of Systems of interacting molecules (> 1 in Gibbs ensemble).
Protected so it can be read from file and modified by a Gibbs ensemble subclass. Initialized to nSystem_ = 1 in constructor.
Definition at line 430 of file mcMd/simulation/Simulation.h.