11#include <util/param/ParamComposite.h>
12#include <rp/fts/simulator/SimState.h>
13#include <pscf/field/RField.h>
14#include <util/containers/DArray.h>
15#include <util/containers/DMatrix.h>
16#include <pscf/backend/TmplDeclare.h>
26 template <
int D,
class T>
class System;
31 template <
int D,
class T>
class Ramp;
91 template <
int D,
class T>
176 virtual void analyze(
int min,
int max,
177 std::string classname,
178 std::string filename);
250 double chiEvecs(
int a,
int i)
const;
276 double sc(
int a)
const;
712 void readRamp(std::istream& in,
bool& isEnd);
943 template <
int D,
class T>
inline
951 template <
int D,
class T>
inline
959 template <
int D,
class T>
inline
963 return *vecRandomPtr_;
967 template <
int D,
class T>
inline
969 {
return (
bool)compressorPtr_; }
972 template <
int D,
class T>
inline
976 return *compressorPtr_;
980 template <
int D,
class T>
inline
984 return *compressorPtr_;
988 template <
int D,
class T>
inline
990 {
return (
bool)perturbationPtr_; }
993 template <
int D,
class T>
inline
997 return *perturbationPtr_;
1001 template <
int D,
class T>
inline
1005 return *perturbationPtr_;
1009 template <
int D,
class T>
inline
1011 {
return (
bool)rampPtr_; }
1014 template <
int D,
class T>
inline
1022 template <
int D,
class T>
inline
1030 template <
int D,
class T>
inline
1037 template <
int D,
class T>
inline
1039 {
return chiEvals_; }
1042 template <
int D,
class T>
inline
1044 {
return chiEvals_[a]; }
1047 template <
int D,
class T>
inline
1049 {
return chiEvecs_; }
1052 template <
int D,
class T>
inline
1054 {
return chiEvecs_(a, i); }
1057 template <
int D,
class T>
inline
1062 template <
int D,
class T>
inline
1069 template <
int D,
class T>
inline
1074 template <
int D,
class T>
inline
1082 template <
int D,
class T>
inline
1090 template <
int D,
class T>
inline
1098 template <
int D,
class T>
inline
1108 template <
int D,
class T>
inline
1113 template <
int D,
class T>
inline
1118 template <
int D,
class T>
inline
1123 template <
int D,
class T>
inline
1128 template <
int D,
class T>
inline
1133 template <
int D,
class T>
inline
1138 template <
int D,
class T>
1143 template <
int D,
class T>
inline
1148 template <
int D,
class T>
inline
1153 template <
int D,
class T>
1158 template <
int D,
class T>
Factory for subclasses of Compressor.
Base class for iterators that impose incompressibility.
Factory for subclasses of Perturbation.
Base class for additive perturbations of standard FTS Hamiltonian.
Factory for subclasses of Ramp.
Class that varies parameters during a simulation (abstract).
SimState stores the state used by a FTS simulation.
Base class for field theoretic PS-FTS simulator.
long iTotalStep()
Return the current simulation step index.
virtual void clearTimers()
Random & random()
Get the scalar random number generator by reference.
double chiEval(int a) const
Get a single eigenvalue of the projected chi matrix.
Simulator(System< D, T > &system)
Constructor.
virtual void simulate(int nStep)
Perform a field theoretic Monte-Carlo simulation.
bool hasDc_
Have functional derivatives of H[W] been computed ?
void computeHamiltonian()
void readRamp(std::istream &in, bool &isEnd)
bool hasWc_
Have eigen-components of the current w fields been computed ?
void clearData()
Clear field eigen-components and Hamiltonian components.
CompressorFactory< D, CPT > & compressorFactory()
double fieldHamiltonian_
Quadratic field contribution to Hamiltonian.
void readPerturbation(std::istream &in, bool &isEnd)
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.
bool hasHamiltonian_
Has the Hamiltonian been computed for the current w and c fields?
void readCompressor(std::istream &in, bool &isEnd)
SimState< D, T > state_
Previous state saved at the beginning of a step.
VecRandom< T > & vecRandom()
Get the vector random number generator by reference.
bool hasDc() const
Are the current d fields valid ?
RampFactory< D, CPT > & rampFactory()
System< D, T > & system()
Get the parent system by reference.
bool hasWc() const
Are eigen-components of the current w fields valid ?
void setRamp(Ramp< D, CPT > *ptr)
void allocate()
Allocate required memory during initialization.
PerturbationFactory< D, CPT > & perturbationFactory()
void readRandomSeed(std::istream &in)
virtual void outputMdeCounter(std::ostream &out) const
void setPerturbation(Perturbation< D, CPT > *ptr)
DArray< RField< D, T > > dc_
Components of d fields on a real space grid.
Perturbation< D, T > const & perturbation() const
Get a Perturbation by const reference.
DArray< RField< D, T > > const & wc() const
Get all eigenvector components of the current w fields.
double idealHamiltonian() const
Get an ideal contribution to the Hamiltonian.
virtual void outputTimers(std::ostream &out) const
DArray< RField< D, T > > wc_
Eigenvector components of w fields on a real space grid.
long iTotalStep_
Step counter - total number of attempted BD or MC steps.
bool hasPerturbation() const
Does this Simulator have a Perturbation?
bool hasRamp() const
Does this Simulator have a Ramp?
double perturbationHamiltonian() const
Get a perturbation to the standard Hamiltonian.
double hamiltonian() const
Get the Hamiltonian used in PS-FTS.
SimState< D, T > & state()
Get the SimState stored internal state by reference.
bool hasCompressor() const
Does this Simulator have a Compressor?
Compressor< D, T > const & compressor() const
Get the Compressor by const reference.
bool hasCc_
Have eigen-components of the current c fields been computed ?
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.
long iStep_
Step counter - number of steps for which the compressor converged.
DArray< double > const & sc() const
Get all components of the vector S.
double idealHamiltonian_
Ideal gas contribution (-lnQ) to Hamiltonian.
RField< D, T > RFieldT
Container for a real-valued periodic field.
DArray< double > const & chiEvals() const
Get an array of the eigenvalues of the projected chi matrix.
DArray< RField< D, T > > cc_
Eigenvector components of c fields on a real space grid.
long iStep()
Return the current converged simulation step index.
double perturbationHamiltonian_
Perturbation contribution to the Hamiltonian.
long seed_
Random number generator seed (input value).
DArray< RField< D, T > > const & dc() const
Get all of the current d fields.
double hamiltonian_
Total field theoretic Hamiltonian H[W] (extensive value).
void analyzeChi()
Perform eigenvalue analysis of projected chi matrix.
bool hasHamiltonian() const
Has the Hamiltonian been computed for the current w and c fields?
DArray< RField< D, T > > const & cc() const
Get all eigenvector components of the current c fields.
double fieldHamiltonian() const
Get the quadratic field contribution to the Hamiltonian.
Ramp< D, T > const & ramp() const
Get a Ramp by const reference.
Base class template for classes that represent a complete system.
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.
Code for programs that simulate real-valued periodic fields.
PSCF package top-level namespace.
Utility classes for scientific computation.