11#include <util/param/ParamComposite.h>
12#include <util/misc/Timer.h>
42 template <
int D,
class T>
196 typename T::System
const &
system()
const;
206 typename T::McSimulator
const &
simulator()
const;
238 Timer compressorTimer_;
239 Timer componentTimer_;
240 Timer hamiltonianTimer_;
241 Timer decisionTimer_;
247 typename T::McSimulator* simulatorPtr_;
250 typename T::System* systemPtr_;
256 typename T::VecRandom* vecRandomPtr_;
277 template <
int D,
class T>
inline
279 {
return nAttempt_; }
284 template <
int D,
class T>
inline
291 template <
int D,
class T>
inline
300 template <
int D,
class T>
307 template <
int D,
class T>
314 template <
int D,
class T>
321 template <
int D,
class T>
inline
323 {
return *systemPtr_; }
328 template <
int D,
class T>
inline
330 {
return *systemPtr_; }
335 template <
int D,
class T>
inline
337 {
return *simulatorPtr_; }
342 template <
int D,
class T>
inline
344 {
return *simulatorPtr_; }
349 template <
int D,
class T>
inline
351 {
return *randomPtr_; }
356 template <
int D,
class T>
inline
358 {
return *vecRandomPtr_; }
363 template <
int D,
class T>
inline
365 {
return probability_; }
370 template <
int D,
class T>
inline
Random & random()
Get the scalar random number generator.
virtual void clearTimers()
Clear timers.
virtual void attemptMove()
Attempt unconstrained move.
~McMove()=default
Destructor.
double probability() const
Types< D >::McSimulator & simulator()
void incrementNFail()
Increment the number of failed moves.
virtual void outputTimers(std::ostream &out)
Write timing results to a file.
void setProbability(double probability)
Set the probability for this McMove.
void readProbability(std::istream &in)
Read the probability from file.
T::VecRandom & vecRandom()
Get the vector random number generator.
void outputTimerData(std::ostream &out)
Write timing data to a file, without a class label.
McMove(typename T::McSimulator &simulator)
Constructor.
long nFail() const
Return number of moves that failed to converge.
void incrementNAccept()
Increment the number of accepted moves.
T::System & system()
Get parent System object (non-const ref).
virtual void output()
Output statistics for this move (at the end of simulation)
virtual bool needsCc()
Decide whether cc fields need to be saved for move.
virtual void setup()
Setup before the beginning of each simulation run.
Timer attemptMoveTimer_
Timers for McMove.
virtual void readParameters(std::istream &in)
Read required parameters from file.
long nAttempt() const
Return number of moves that have been attempted.
virtual bool move()
Generate, attempt, and accept or reject a Monte Carlo move.
virtual bool needsDc()
Decide whether dc fields need to be saved for move.
void incrementNAttempt()
Increment the number of attempted moves.
long nAccept() const
Return number of moves that have been accepted.
ParamComposite()
Constructor.
File containing preprocessor macros for error handling.
Class templates for real-valued periodic fields.
PSCF package top-level namespace.
Utility classes for scientific computation.