|
PSCF v1.4.0
|
Monte-Carlo simulation coordinator. More...
#include <McSimulator.h>
Public Member Functions | |
Initialization | |
| virtual void | readParameters (std::istream &in) |
| Read parameter file block. | |
Primary Actions: Simulation and Analysis | |
| void | simulate (int nStep) |
| Perform a field theoretic Monte-Carlo simulation. | |
| virtual void | analyze (int min, int max, std::string classname, std::string filename) |
| Read and analyze a trajectory file. | |
| virtual void | outputTimers (std::ostream &out) const |
| Output timing results. | |
| virtual void | clearTimers () |
| Clear timers. | |
Miscellaneous | |
| T::McMoveManager const & | mcMoveManager () const |
| Get the McMoveManager (const). | |
| T::McMoveManager & | mcMoveManager () |
| Get the McMoveManager (non-const). | |
| T::AnalyzerManager const & | analyzerManager () const |
| Get the AnalyzerManager (const). | |
| T::AnalyzerManager & | analyzerManager () |
| Get the AnalyzerManager (non-const). | |
| Factory< typename T::TrajectoryReader > & | trajectoryReaderFactory () |
| Get the trajectory reader factory by reference. | |
| bool | hasMcMoves () const |
| Have any MC moves been defined? | |
| bool | needsCc () |
| Does the stored state need to include Cc fields? | |
| bool | needsDc () |
| Does the stored state need to include Dc fields? | |
Protected Types | |
| using | SystemT = typename T::System |
| Alias for System class in program-level namespace. | |
| using | SimulatorT = typename T::Simulator |
| Alias for Simulator class in program-level namespace. | |
| using | McSimulatorT = typename T::McSimulator |
| Alias for McSimulator class in program-level namespace. | |
Protected Member Functions | |
| McSimulator (SystemT &system, McSimulatorT &mcSimulator) | |
| Constructor. | |
| ~McSimulator () | |
| Destructor. | |
Monte-Carlo simulation coordinator.
An McSimulator provides tools that are specific to MC simulation, in addition to those inherited from the Simulator base class. An McSimulator has an McMoveManager and an AnalyzerManager, in addition data members inherited from the Simulator class.
Specializations of this class template are used as base classes for two closely analogous class templates, also named McSimulator, that are defined in Rpc and Rpg namespaces for use in the pscf_rpc and pscf_rpg programs, respectively.
Template parameters:
Definition at line 45 of file fts/montecarlo/McSimulator.h.
|
protected |
Alias for System class in program-level namespace.
Definition at line 160 of file fts/montecarlo/McSimulator.h.
|
protected |
Alias for Simulator class in program-level namespace.
Definition at line 163 of file fts/montecarlo/McSimulator.h.
|
protected |
Alias for McSimulator class in program-level namespace.
Definition at line 166 of file fts/montecarlo/McSimulator.h.
|
protected |
Constructor.
| system | parent System |
| mcSimulator | instance of enclosing McSimulator subclass |
Definition at line 29 of file McSimulator.tpp.
References Util::ParamComposite::setClassName().
|
protected |
Destructor.
Definition at line 49 of file McSimulator.tpp.
|
virtual |
Read parameter file block.
| in | input parameter stream |
Definition at line 62 of file McSimulator.tpp.
References mcMoveManager(), and Util::ParamComposite::readParamCompositeOptional().
| void Pscf::Rp::McSimulator< D, T >::simulate | ( | int | nStep | ) |
Perform a field theoretic Monte-Carlo simulation.
Perform a field theoretic Monte-Carlo simulation using the partial saddle-point approximation.
| nStep | number of attempted Monte-Carlo steps |
Definition at line 159 of file McSimulator.tpp.
References Util::Log::file(), hasMcMoves(), and UTIL_CHECK.
|
virtual |
Read and analyze a trajectory file.
This function uses an instance of the TrajectoryReader subclass specified by the "classname" argument to read a trajectory file.
| min | start at this frame number |
| max | end at this frame number |
| classname | name of the TrajectoryReader subclass to use |
| filename | name of the trajectory file |
Definition at line 284 of file McSimulator.tpp.
References analyzerManager(), Util::Log::file(), Util::Timer::start(), Util::Timer::stop(), Util::Timer::time(), trajectoryReaderFactory(), UTIL_CHECK, and UTIL_THROW.
|
virtual |
|
virtual |
|
inline |
Get the McMoveManager (const).
Definition at line 227 of file fts/montecarlo/McSimulator.h.
References UTIL_ASSERT.
Referenced by clearTimers(), hasMcMoves(), outputTimers(), and readParameters().
|
inline |
Get the McMoveManager (non-const).
Definition at line 235 of file fts/montecarlo/McSimulator.h.
References UTIL_ASSERT.
|
inline |
Get the AnalyzerManager (const).
Definition at line 243 of file fts/montecarlo/McSimulator.h.
References UTIL_ASSERT.
Referenced by analyze().
|
inline |
Get the AnalyzerManager (non-const).
Definition at line 252 of file fts/montecarlo/McSimulator.h.
References UTIL_ASSERT.
|
inline |
Get the trajectory reader factory by reference.
Definition at line 261 of file fts/montecarlo/McSimulator.h.
References UTIL_ASSERT.
Referenced by analyze().
|
inline |
Have any MC moves been defined?
Equivalent to a test for mcMoveManager().size() > 0.
Definition at line 269 of file fts/montecarlo/McSimulator.h.
References mcMoveManager().
Referenced by simulate().
|
inline |
Does the stored state need to include Cc fields?
This returns if McMove::needsCc returns true for one or more MC moves ih the McMoveManager. Most MC moves require storage of components of the c fields.
Definition at line 274 of file fts/montecarlo/McSimulator.h.
|
inline |
Does the stored state need to include Dc fields?
This returns if McMove::needsDc returns true for one or more MC moves in the McMoveManager. Only moves that uses forces to generate a proposed change in the fields, such as a "smart" MC force bias move, will require storage of these fields.
Definition at line 279 of file fts/montecarlo/McSimulator.h.