PSCF v1.4.0

Monte-Carlo simulation coordinator. More...

#include <McSimulator.h>

Inheritance diagram for Pscf::Rp::McSimulator< D, T >:

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.

Detailed Description

template<int D, class T>
class Pscf::Rp::McSimulator< D, T >

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:

See also
Manual Page

Definition at line 45 of file fts/montecarlo/McSimulator.h.

Member Typedef Documentation

◆ SystemT

template<int D, class T>
using Pscf::Rp::McSimulator< D, T >::SystemT = typename T::System
protected

Alias for System class in program-level namespace.

Definition at line 160 of file fts/montecarlo/McSimulator.h.

◆ SimulatorT

template<int D, class T>
using Pscf::Rp::McSimulator< D, T >::SimulatorT = typename T::Simulator
protected

Alias for Simulator class in program-level namespace.

Definition at line 163 of file fts/montecarlo/McSimulator.h.

◆ McSimulatorT

template<int D, class T>
using Pscf::Rp::McSimulator< D, T >::McSimulatorT = typename T::McSimulator
protected

Alias for McSimulator class in program-level namespace.

Definition at line 166 of file fts/montecarlo/McSimulator.h.

Constructor & Destructor Documentation

◆ McSimulator()

template<int D, class T>
Pscf::Rp::McSimulator< D, T >::McSimulator ( SystemT & system,
McSimulatorT & mcSimulator )
protected

Constructor.

Parameters
systemparent System
mcSimulatorinstance of enclosing McSimulator subclass

Definition at line 29 of file McSimulator.tpp.

References Util::ParamComposite::setClassName().

◆ ~McSimulator()

template<int D, class T>
Pscf::Rp::McSimulator< D, T >::~McSimulator ( )
protected

Destructor.

Definition at line 49 of file McSimulator.tpp.

Member Function Documentation

◆ readParameters()

template<int D, class T>
void Pscf::Rp::McSimulator< D, T >::readParameters ( std::istream & in)
virtual

Read parameter file block.

Parameters
ininput parameter stream

Definition at line 62 of file McSimulator.tpp.

References mcMoveManager(), and Util::ParamComposite::readParamCompositeOptional().

◆ simulate()

template<int D, class T>
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.

Parameters
nStepnumber of attempted Monte-Carlo steps

Definition at line 159 of file McSimulator.tpp.

References Util::Log::file(), hasMcMoves(), and UTIL_CHECK.

◆ analyze()

template<int D, class T>
void Pscf::Rp::McSimulator< D, T >::analyze ( int min,
int max,
std::string classname,
std::string filename )
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.

Parameters
minstart at this frame number
maxend at this frame number
classnamename of the TrajectoryReader subclass to use
filenamename 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.

◆ outputTimers()

template<int D, class T>
void Pscf::Rp::McSimulator< D, T >::outputTimers ( std::ostream & out) const
virtual

Output timing results.

Definition at line 353 of file McSimulator.tpp.

References mcMoveManager().

◆ clearTimers()

template<int D, class T>
void Pscf::Rp::McSimulator< D, T >::clearTimers ( )
virtual

Clear timers.

Definition at line 365 of file McSimulator.tpp.

References mcMoveManager().

◆ mcMoveManager() [1/2]

template<int D, class T>
T::McMoveManager const & Pscf::Rp::McSimulator< D, T >::mcMoveManager ( ) const
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().

◆ mcMoveManager() [2/2]

template<int D, class T>
T::McMoveManager & Pscf::Rp::McSimulator< D, T >::mcMoveManager ( )
inline

Get the McMoveManager (non-const).

Definition at line 235 of file fts/montecarlo/McSimulator.h.

References UTIL_ASSERT.

◆ analyzerManager() [1/2]

template<int D, class T>
T::AnalyzerManager const & Pscf::Rp::McSimulator< D, T >::analyzerManager ( ) const
inline

Get the AnalyzerManager (const).

Definition at line 243 of file fts/montecarlo/McSimulator.h.

References UTIL_ASSERT.

Referenced by analyze().

◆ analyzerManager() [2/2]

template<int D, class T>
T::AnalyzerManager & Pscf::Rp::McSimulator< D, T >::analyzerManager ( )
inline

Get the AnalyzerManager (non-const).

Definition at line 252 of file fts/montecarlo/McSimulator.h.

References UTIL_ASSERT.

◆ trajectoryReaderFactory()

template<int D, class T>
Factory< typename T::TrajectoryReader > & Pscf::Rp::McSimulator< D, T >::trajectoryReaderFactory ( )
inline

Get the trajectory reader factory by reference.

Definition at line 261 of file fts/montecarlo/McSimulator.h.

References UTIL_ASSERT.

Referenced by analyze().

◆ hasMcMoves()

template<int D, class T>
bool Pscf::Rp::McSimulator< D, T >::hasMcMoves ( ) const
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().

◆ needsCc()

template<int D, class T>
bool Pscf::Rp::McSimulator< D, T >::needsCc ( )
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.

◆ needsDc()

template<int D, class T>
bool Pscf::Rp::McSimulator< D, T >::needsDc ( )
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.


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