11#include <util/param/ParamComposite.h>
12#include <util/containers/DArray.h>
13#include <util/containers/DMatrix.h>
72 template <
int D,
class T>
142 std::string classname,
143 std::string filename);
278 double sc(
int a)
const;
587 typename T::Ramp
const &
ramp()
const;
607 typename T::Simulator& simulator);
863 typename T::System* systemPtr_;
868 typename T::Simulator* simulatorPtr_;
878 typename T::VecRandom* vecRandomPtr_;
883 typename T::CompressorFactory* compressorFactoryPtr_;
888 typename T::Compressor* compressorPtr_;
893 typename T::PerturbationFactory* perturbationFactoryPtr_;
898 typename T::Perturbation* perturbationPtr_;
903 typename T::RampFactory* rampFactoryPtr_;
908 typename T::Ramp* rampPtr_;
922 template <
int D,
class T>
inline
930 template <
int D,
class T>
inline
938 template <
int D,
class T>
inline
942 return *vecRandomPtr_;
946 template <
int D,
class T>
inline
948 {
return (
bool)compressorPtr_; }
951 template <
int D,
class T>
inline
955 return *compressorPtr_;
959 template <
int D,
class T>
inline
963 return *compressorPtr_;
967 template <
int D,
class T>
inline
969 {
return (
bool)perturbationPtr_; }
972 template <
int D,
class T>
inline
976 return *perturbationPtr_;
980 template <
int D,
class T>
inline
984 return *perturbationPtr_;
988 template <
int D,
class T>
inline
990 {
return (
bool)rampPtr_; }
993 template <
int D,
class T>
inline
1001 template <
int D,
class T>
inline
1009 template <
int D,
class T>
inline
1016 template <
int D,
class T>
inline
1018 {
return chiEvals_; }
1021 template <
int D,
class T>
inline
1023 {
return chiEvals_[a]; }
1026 template <
int D,
class T>
inline
1028 {
return chiEvecs_; }
1031 template <
int D,
class T>
inline
1033 {
return chiEvecs_(a, i); }
1036 template <
int D,
class T>
inline
1041 template <
int D,
class T>
inline
1048 template <
int D,
class T>
inline
1053 template <
int D,
class T>
inline
1061 template <
int D,
class T>
inline
1069 template <
int D,
class T>
inline
1077 template <
int D,
class T>
inline
1087 template <
int D,
class T>
inline
1092 template <
int D,
class T>
inline
1097 template <
int D,
class T>
inline
1102 template <
int D,
class T>
inline
1107 template <
int D,
class T>
inline
1112 template <
int D,
class T>
inline
1117 template <
int D,
class T>
1122 template <
int D,
class T>
inline
1127 template <
int D,
class T>
inline
1132 template <
int D,
class T>
1137 template <
int D,
class T>
long iTotalStep()
Return the current simulation step index.
virtual void clearTimers()
Clear timers.
Random & random()
Get the scalar random number generator by reference.
double chiEval(int a) const
Get a single eigenvalue of the projected chi matrix.
void saveState()
Save a copy of the current system state.
RFieldT const & wc(int a) const
Get one eigenvector component of the current w fields.
T::CompressorFactory & compressorFactory()
Get the Compressor factory by reference.
virtual void simulate(int nStep)
Perform a field theoretic Monte-Carlo simulation.
T::PerturbationFactory & perturbationFactory()
Get the Perturbation factory by reference.
Types< D >::SimState state_
T::Perturbation & perturbation()
Get a Perturbation by non-const reference.
void computeHamiltonian()
Compute the Hamiltonian used in PS-FTS.
DArray< RFieldT > const & wc() const
Get all eigenvector components of the current w fields.
T::System & system()
Get the parent system by reference.
void readRamp(std::istream &in, bool &isEnd)
Optionally read a Ramp parameter file block.
double sc(int a) const
Get a single component of the S vector.
double chiEvecs(int a, int i) const
Get one element of an eigenvector of the projected chi matrix.
void clearData()
Clear field eigen-components and Hamiltonian components.
DArray< RFieldT > const & dc() const
Get all of the current d fields.
T::SimState & state()
Get the SimState stored internal state by reference.
void readPerturbation(std::istream &in, bool &isEnd)
Optionally read a Perturbation parameter file block.
T::Compressor & compressor()
Get the Compressor by non-const reference.
DArray< RFieldT > const & cc() const
Get all eigenvector components of the current c fields.
bool hasCc() const
Are eigen-components of the current c fields valid ?
DMatrix< double > const & chiEvecs() const
Get the matrix of all eigenvectors of the projected chi matrix.
void computeWc()
Compute eigenvector components of the current w fields.
void readCompressor(std::istream &in, bool &isEnd)
Optionally read a Compressor parameter file block.
bool hasDc() const
Are the current d fields valid ?
void computeCc()
Compute eigenvector components of the current c fields.
RFieldT const & cc(int a) const
Get one eigenvector component of the current c fields.
RFieldT const & dc(int i) const
Get one eigenvector component of the current d fields.
bool hasWc() const
Are eigen-components of the current w fields valid ?
void allocate()
Allocate required memory during initialization.
void readRandomSeed(std::istream &in)
Optionally read a random seed and initialize RNGs.
virtual void outputMdeCounter(std::ostream &out) const
Output MDE counter.
Simulator(typename T::System &system, typename T::Simulator &simulator)
Constructor.
double idealHamiltonian() const
Get an ideal contribution to the Hamiltonian.
void restoreState()
Restore the system to the saved state.
void setPerturbation(typename T::Perturbation *ptr)
Set the associated Perturbation.
T::VecRandom & vecRandom()
Get the vector random number generator by reference.
virtual void outputTimers(std::ostream &out) const
Output timing results.
void computeDc()
Compute functional derivatives of the Hamiltonian.
T::Ramp const & ramp() const
Get a Ramp by const reference.
bool hasPerturbation() const
Does this Simulator have a Perturbation?
T::RampFactory & rampFactory()
Get the Ramp factory by reference.
bool hasRamp() const
Does this Simulator have a Ramp?
double perturbationHamiltonian() const
Get a perturbation to the standard Hamiltonian.
typename T::RField RFieldT
Container for a real-valued periodic field.
T::Compressor const & compressor() const
Get the Compressor by const reference.
double hamiltonian() const
Get the Hamiltonian used in PS-FTS.
bool hasCompressor() const
Does this Simulator have a Compressor?
virtual void analyze(int min, int max, std::string classname, std::string filename)
Read and analyze a trajectory file.
virtual void readParameters(std::istream &in)
Read parameters for a simulation.
T::Perturbation const & perturbation() const
Get a Perturbation by const reference.
virtual void initializeVecRandom()
Initialize the vector RNG.
DArray< double > const & sc() const
Get all components of the vector S.
T::Ramp & ramp()
Get a Ramp by non-const reference.
void clearState()
Clear the saved copy of the system state.
DArray< double > const & chiEvals() const
Get an array of the eigenvalues of the projected chi matrix.
long iStep()
Return the current converged simulation step index.
double perturbationHamiltonian_
void analyzeChi()
Perform eigenvalue analysis of projected chi matrix.
bool hasHamiltonian() const
Has the Hamiltonian been computed for the current w and c fields?
double fieldHamiltonian() const
Get the quadratic field contribution to the Hamiltonian.
void setRamp(typename T::Ramp *ptr)
Set the associated Ramp.
Dynamically allocatable contiguous array template.
Dynamically allocated Matrix.
ParamComposite()
Constructor.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
#define UTIL_ASSERT(condition)
Assertion macro suitable for debugging serial or parallel code.
Class templates for real-valued periodic fields.
PSCF package top-level namespace.
Utility classes for scientific computation.