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

Detailed Description

A molecular dynamics simulation of a single MdSystem.

Definition at line 26 of file MdSimulation.h.

#include <MdSimulation.h>

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

Public Member Functions

 MdSimulation (MPI::Intracomm &communicator)
 Constructor. More...
 
 MdSimulation ()
 Constructor. More...
 
virtual ~MdSimulation ()
 Destructor. More...
 
Initialization
void setOptions (int argc, char **argv)
 Process command line options. More...
 
void readParam ()
 Read parameters from the default parameter istream. More...
 
void readParam (std::istream &in)
 Read parameter file. More...
 
virtual void readParameters (std::istream &in)
 Read parameters from stream, without begin and end lines. More...
 
Serialization and Restart Files
void load (const std::string &filename)
 Read a restart file. More...
 
virtual void loadParameters (Serializable::IArchive &ar)
 Load parameter file section of archive. More...
 
void save (const std::string &filename)
 Write a restart file. More...
 
virtual void save (Serializable::OArchive &ar)
 Save internal state to an archive. More...
 
Command Script
void readCommands ()
 Read and execute commands from a default command file. More...
 
void readCommands (std::istream &in)
 Read and execute commands from a specific input stream. More...
 
bool readCommand (std::string command, std::istream &in)
 Read and execute a single command from an input stream. More...
 
Simulation and Analysis Operations
void simulate (int endStep, bool isContinuation=false)
 Run an MD simulation of specified length. More...
 
void analyzeConfigs (int min, int max, std::string basename)
 Read and analyze a sequence of configuration files. More...
 
void analyzeTrajectory (int min, int max, std::string classname, std::string filename)
 Read and analyze a trajectory file. More...
 
Miscellaneous
const MdSystemsystem () const
 Get the MdSystem being simulated by const reference. More...
 
MdSystemsystem ()
 Get the MdSystem being simulated by reference. More...
 
virtual bool isValid () const
 Return true if this MdSimulation valid, or throw an Exception. More...
 
- Public Member Functions inherited from McMd::Simulation
 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...
 
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...
 
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...
 
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...
 
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...
 
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...
 
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 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...
 

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...
 
- Protected Member Functions inherited from McMd::Simulation
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 inherited from McMd::Simulation
int iStep_
 Step index for main MC or MD loop. More...
 
int nSystem_
 Number of Systems of interacting molecules (> 1 in Gibbs ensemble). More...
 

Constructor & Destructor Documentation

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

Destructor.

Definition at line 110 of file MdSimulation.cpp.

Member Function Documentation

void McMd::MdSimulation::setOptions ( int  argc,
char **  argv 
)

Process command line options.

Main options:

-q Query: Print list of enabled/disabled features

-e Echo: Enable echoing of parameter file on read

-r filename. Restart: restart from specified file

-p filename. Parameter: Specify a parameter file

-c filename. Command: Specify a command file

-i filename. Input: Specify path prefix for input files

-o filename. Input: Specify path prefix for output files

The -p and -r options are mutually exclusive: When a simulation is restarted, all information required from a parameter file is in the restart file.

Parameters
argcnumber of arguments
argvvector of pointers to char* string arguments

Definition at line 125 of file MdSimulation.cpp.

References Util::Log::file(), McMd::Simulation::fileMaster(), load(), McMd::Simulation::outputOptions(), Util::FileMaster::setCommandFileName(), Util::ParamComponent::setEcho(), McMd::System::setExpectPerturbation(), Util::FileMaster::setInputPrefix(), McMd::Simulation::setIoCommunicator(), Util::FileMaster::setOutputPrefix(), Util::FileMaster::setParamFileName(), system(), and UTIL_THROW.

void McMd::MdSimulation::readParam ( )

Read parameters from the default parameter istream.

Calls readParam(std::istream&) internally, with a default parameter file istream given by the return value of FileMaster::paramFile().

Single parameter file: If compiled as a serial program (ifndef UTIL_MPI) or as a parallel program in mode that uses a single parameter file (i.e., with option -f), the parameter file name is the argument passed to the -p command line option, if the main program is invoked with the -p option, or the parameter file is read from standard input, std::cin, if not invoked with a -p option.

Multiple parameter files: If compiled as a parallel program (ifdef UITL_MPI) and used in a mode with separate parameter files for independent simulations (i.e., without the -f option), then the parameter file for the simulation performed by processor number n is file named n/filename, where "filename" is either the argument of the -p command line option, if invoked with that option, or the default string filename = "param".

Precondition
: Call after setOptions().

Definition at line 289 of file MdSimulation.cpp.

References McMd::Simulation::fileMaster().

void McMd::MdSimulation::readParam ( std::istream &  in)
virtual

Read parameter file.

Returns and does nothing if in process of restarting (i.e., if the main program was invoked with -r option).

Precondition
: Call after setOptions().
Parameters
inparameter file stream

Reimplemented from Util::ParamComposite.

Definition at line 297 of file MdSimulation.cpp.

References Util::ParamComposite::className(), Util::ParamComposite::readBegin(), Util::ParamComposite::readEnd(), and readParameters().

void McMd::MdSimulation::readParameters ( std::istream &  in)
virtual
void McMd::MdSimulation::load ( const std::string &  filename)

Read a restart file.

Open, load, and close binary restart file.

Parameters
filenamebase file name for all restart files.

Definition at line 687 of file MdSimulation.cpp.

References Util::BinaryFileIArchive::file(), McMd::Simulation::fileMaster(), Util::FileMaster::openRestartIFile(), and UTIL_THROW.

Referenced by setOptions().

void McMd::MdSimulation::loadParameters ( Serializable::IArchive ar)
virtual
void McMd::MdSimulation::save ( const std::string &  filename)

Write a restart file.

Calls save(Serializable::OArchive) internally.

Parameters
filenamerestart file name

Definition at line 708 of file MdSimulation.cpp.

References Util::BinaryFileOArchive::file(), McMd::Simulation::fileMaster(), and Util::FileMaster::openRestartOFile().

Referenced by simulate().

void McMd::MdSimulation::save ( Serializable::OArchive ar)
virtual
void McMd::MdSimulation::readCommands ( )

Read and execute commands from a default command file.

This function calls readCommands(fileMaster().commandFile()).

Definition at line 419 of file MdSimulation.cpp.

References McMd::Simulation::fileMaster(), and UTIL_THROW.

void McMd::MdSimulation::readCommands ( std::istream &  in)
bool McMd::MdSimulation::readCommand ( std::string  command,
std::istream &  in 
)

Read and execute a single command from an input stream.

Usage: The capitalized command name must have been read from istream "in" and passed as the "command" argument. If the command name is recognized, any additional arguments are read from stream "in", the command is executed, and a value of true is returned. A value of false is returned iff the command name string is not recognized.

Calls commandManager().readCommand(command, in) internally.

Parameters
commandcommand name string
incommand input stream

Definition at line 431 of file MdSimulation.cpp.

References McMd::Simulation::commandManager(), and McMd::CommandManager::readCommand().

void McMd::MdSimulation::simulate ( int  endStep,
bool  isContinuation = false 
)

Run an MD simulation of specified length.

This method implements the main MD loop. The step counter iStep_ is incremented until it reaches endStep. Upon exit, iStep_ = endStep.

If isContinuation is false, the step counter iStep_ is initialized to zero, and analyzers and MdIntegrator are set to default initial states before entering the main loop. If isContinuation is true, no initialization is done before entering the main loop.

Preconditions: Atomic positions, velocities, and forces must all be initialized before this function is entered. If isContinuation is false, positions and forces must have been initialized by calling the readConfig() or load() method. The readconfig() method initializes velocities only for file formats that contain velocities. Otherwise, velocities can be initialized by the system().setBoltzmannVelocities() function, which can be invoked by a THERMALIZE command in the command script.

Parameters
endStepFinal value of MD step counter iStep_.
isContinuationIs this a continuation of previous run?

Definition at line 437 of file MdSimulation.cpp.

References McMd::Simulation::analyzerManager(), McMd::Analyzer::baseInterval, McMd::PairList::buildCounter(), McMd::MdSystem::calculateForces(), McMd::MdSystem::coulombPotential(), Util::Log::file(), McMd::Simulation::iStep_, McMd::MdCoulombPotential::makeWaves(), McMd::PairList::maxNAtom(), McMd::PairList::maxNPair(), McMd::MdSystem::mdIntegrator(), McMd::AnalyzerManager::output(), McMd::MdPairPotential::pairList(), McMd::MdSystem::pairPotential(), McMd::AnalyzerManager::sample(), save(), McMd::MdIntegrator::setup(), McMd::AnalyzerManager::setup(), McMd::MdSystem::shiftAtoms(), Util::Timer::start(), McMd::MdIntegrator::step(), Util::Timer::stop(), system(), Util::Timer::time(), and UTIL_CHECK.

Referenced by readCommands(), and McMd::MdCommandManager::readStandardCommand().

void McMd::MdSimulation::analyzeConfigs ( int  min,
int  max,
std::string  basename 
)

Read and analyze a sequence of configuration files.

This function reads and analyzes a sequence of configuration files that were normally generated by running a previous simulation using the ConfigWriter analyzer to periodically dump configurations. This function applies the sample() method of every Analyzer to each such stored configuration.

The function reads a sequence of configuration files with names of the form inputPrefix + basename + n , for integer suffixes in the range min <= n <= max. This is consistent with the output format format used by the WriteConfig class. The inputPrefix used in an analysis simulation is often a directory name, with a trailing directory separator "/", that is the same as the outputPrefix used in the earlier simulation run.

In parallel mode, for processor with MPI rank m, the path "m/" is prepended to the fileMaster input prefix, so that paths to all files associated with processor m begin with the string "m/inputPrefix" + basename.

Parameters
mininteger index of first configuration file
maxinteger index of last configuration file
basenameprefix string for configuration files.

Definition at line 549 of file MdSimulation.cpp.

References McMd::Simulation::analyzerManager(), McMd::Analyzer::baseInterval, McMd::MdPairPotential::buildPairList(), Util::Log::file(), McMd::Simulation::fileMaster(), McMd::Simulation::iStep_, isValid(), Util::FileMaster::openInputFile(), McMd::AnalyzerManager::output(), McMd::MdSystem::pairPotential(), McMd::MdSystem::readConfig(), McMd::System::removeAllMolecules(), McMd::AnalyzerManager::sample(), McMd::AnalyzerManager::setup(), Util::Timer::start(), Util::Timer::stop(), system(), Util::Timer::time(), and UTIL_CHECK.

Referenced by McMd::MdCommandManager::readStandardCommand().

void McMd::MdSimulation::analyzeTrajectory ( int  min,
int  max,
std::string  classname,
std::string  filename 
)

Read and analyze a trajectory file.

This function reads and analyzes a trajectory file, which is a single file containing a sequence of configuration snapshots.

Parameters
minstart at this frame number
maxend at this frame number
classnamename of the TrajectoryReader class to use
filenamename of the trajectory file

Definition at line 619 of file MdSimulation.cpp.

References McMd::Simulation::analyzerManager(), McMd::Analyzer::baseInterval, McMd::MdPairPotential::buildPairList(), McMd::TrajectoryReader::close(), Util::Factory< Data >::factory(), Util::Log::file(), McMd::Simulation::iStep_, isValid(), McMd::TrajectoryReader::open(), McMd::AnalyzerManager::output(), McMd::MdSystem::pairPotential(), McMd::TrajectoryReader::readFrame(), McMd::AnalyzerManager::sample(), McMd::AnalyzerManager::setup(), Util::Timer::start(), Util::Timer::stop(), system(), Util::Timer::time(), McMd::System::trajectoryReaderFactory(), UTIL_CHECK, and UTIL_THROW.

Referenced by McMd::MdCommandManager::readStandardCommand().

const MdSystem & McMd::MdSimulation::system ( ) const
inline

Get the MdSystem being simulated by const reference.

Definition at line 318 of file MdSimulation.h.

Referenced by analyzeConfigs(), analyzeTrajectory(), setOptions(), and simulate().

MdSystem & McMd::MdSimulation::system ( )
inline

Get the MdSystem being simulated by reference.

Definition at line 322 of file MdSimulation.h.

bool McMd::MdSimulation::isValid ( ) const
virtual

Return true if this MdSimulation valid, or throw an Exception.

Reimplemented from McMd::Simulation.

Definition at line 720 of file MdSimulation.cpp.

References McMd::Simulation::isValid(), McMd::MdSystem::isValid(), McMd::System::simulation(), and UTIL_THROW.

Referenced by analyzeConfigs(), analyzeTrajectory(), loadParameters(), and readParameters().


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