Simpatico  v1.10
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
McMd::Simulation Class Reference

Detailed Description

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>

Inheritance diagram for McMd::Simulation:
Util::ParamComposite Util::ParamComponent Util::Serializable Util::MpiFileIo McMd::McSimulation McMd::MdSimulation

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
MoleculegetMolecule (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)
Randomrandom ()
 Get the random number generator by reference. More...
 
Speciesspecies (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...
 
FileMasterfileMaster ()
 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 AtomTypeatomType (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 Speciesspecies (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...
 
- Public Member Functions inherited from Util::ParamComposite
 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...
 
BeginreadBegin (std::istream &in, const char *label, bool isRequired=true)
 Add and read a class label and opening bracket. More...
 
EndreadEnd (std::istream &in)
 Add and read the closing bracket. More...
 
BlankreadBlank (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...
 
BeginaddBegin (const char *label)
 Add a Begin object representing a class name and bracket. More...
 
EndaddEnd ()
 Add a closing bracket. More...
 
BlankaddBlank ()
 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...
 
- Public Member Functions inherited from Util::ParamComponent
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...
 
- Public Member Functions inherited from Util::Serializable
virtual ~Serializable ()
 Destructor. More...
 
- Public Member Functions inherited from Util::MpiFileIo
 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...
 
AnalyzerManageranalyzerManager ()
 Get the associated AnalyzerManager by reference. More...
 
void setCommandManager (CommandManager *ptr)
 Set the associated CommandManager. More...
 
CommandManagercommandManager ()
 Get the associated CommandManager by reference. More...
 
- Protected Member Functions inherited from Util::ParamComposite
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 &param, bool next=true)
 Set this to the parent of a child component. More...
 
void addComponent (ParamComponent &param, 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...
 
- Protected Member Functions inherited from Util::ParamComponent
 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

- Public Types inherited from Util::Serializable
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 Public Member Functions inherited from Util::ParamComponent
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...
 

Constructor & Destructor Documentation

McMd::Simulation::Simulation ( MPI::Intracomm &  communicator)
McMd::Simulation::Simulation ( )
McMd::Simulation::~Simulation ( )
virtual

Destructor.

Definition at line 161 of file mcMd/simulation/Simulation.cpp.

References McMd::Atom::deallocate().

Member Function Documentation

void McMd::Simulation::setIoCommunicator ( MPI::Intracomm &  communicator)
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().

Parameters
communicatorMPI 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().

void McMd::Simulation::readParameters ( std::istream &  in)
virtual

Read parameter file block and initialize simulation.

Parameters
inparameter 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.

Parameters
filenamename 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.

Parameters
setmolecule set for one Species in a System.
speciesIdinteger 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().

void McMd::Simulation::loadParameters ( Serializable::IArchive ar)
virtual

Load internal state from an archive.

Parameters
arinput/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().

void McMd::Simulation::save ( Serializable::OArchive ar)
virtual
Molecule & McMd::Simulation::getMolecule ( int  speciesId)
void McMd::Simulation::returnMolecule ( Molecule molecule)

Return a molecule to a reservoir of unused molecules.

Parameters
moleculeMolecule 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().

Random & McMd::Simulation::random ( )
inline
Species & McMd::Simulation::species ( int  i)

Get a specific Species by reference.

Parameters
iinteger index of desired Species
Returns
reference to species with index i

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().

Factory< Analyzer > & McMd::Simulation::analyzerFactory ( )

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().

Factory< Species > & McMd::Simulation::speciesFactory ( )

Return the Species Factory by reference.

Definition at line 1321 of file mcMd/simulation/Simulation.cpp.

References Util::Manager< Data >::factory(), and UTIL_CHECK.

FileMaster & McMd::Simulation::fileMaster ( )
inline
MPI::Intracomm & McMd::Simulation::communicator ( )
inline
int McMd::Simulation::iStep ( ) const
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().

int McMd::Simulation::nAtomType ( ) const
inline
const AtomType & McMd::Simulation::atomType ( int  i) const
inline
const Array< AtomType > & McMd::Simulation::atomTypes ( ) const
inline

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.

Parameters
iinteger index of desired Species

Definition at line 945 of file mcMd/simulation/Simulation.cpp.

int McMd::Simulation::moleculeCapacity ( ) const
inline

Get the total number of Molecules allocated.

Definition at line 771 of file mcMd/simulation/Simulation.h.

int McMd::Simulation::atomCapacity ( ) const
inline
int McMd::Simulation::nSystem ( ) const
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.

bool McMd::Simulation::isValid ( ) const
virtual
bool McMd::Simulation::hasSpecies ( ) const
inline

Has data for all species structures and capacities.

Definition at line 840 of file mcMd/simulation/Simulation.h.

Referenced by loadParameters(), and readParameters().

MaskPolicy McMd::Simulation::maskedPairPolicy ( ) const
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().

int McMd::Simulation::nBondType ( ) const
inline
int McMd::Simulation::bondCapacity ( ) const
inline

Get the total number of Bonds allocated.

Definition at line 787 of file mcMd/simulation/Simulation.h.

int McMd::Simulation::nAngleType ( ) const
inline
int McMd::Simulation::angleCapacity ( ) const
inline

Get the total number of Angles allocated.

Definition at line 795 of file mcMd/simulation/Simulation.h.

int McMd::Simulation::nDihedralType ( ) const
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().

int McMd::Simulation::dihedralCapacity ( ) const
inline

Get the total number of Dihedrals allocated.

Definition at line 803 of file mcMd/simulation/Simulation.h.

int McMd::Simulation::hasCoulomb ( ) const
inline
int McMd::Simulation::hasExternal ( ) const
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().

int McMd::Simulation::nLinkType ( ) const
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().

bool McMd::Simulation::hasCommunicator ( ) const
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.

Parameters
outoutput stream

Definition at line 1257 of file mcMd/simulation/Simulation.cpp.

Referenced by McMd::MdSimulation::setOptions(), and McMd::McSimulation::setOptions().

void McMd::Simulation::setAnalyzerManager ( AnalyzerManager ptr)
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().

AnalyzerManager & McMd::Simulation::analyzerManager ( )
inlineprotected
void McMd::Simulation::setCommandManager ( CommandManager ptr)
protected
CommandManager & McMd::Simulation::commandManager ( )
inlineprotected

Member Data Documentation

int McMd::Simulation::iStep_
protected
int McMd::Simulation::nSystem_
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.


The documentation for this class was generated from the following files: