PSCF v1.5.0
Pscf::Rp::Simulator< D, T > Class Template Reference

Base class for field theoretic PS-FTS simulator. More...

#include <Simulator.h>

Inheritance diagram for Pscf::Rp::Simulator< D, T >:
Util::ParamComposite Util::ParamComponent Util::Serializable Util::MpiFileIo Pscf::Rp::BdSimulator< D, T > Pscf::Rp::McSimulator< D, T >

Public Types

using RFieldT = RField<D,T>
 Container for a real-valued periodic field.
Public Types inherited from Util::Serializable
typedef BinaryFileOArchive OArchive
 Type of output archive used by save method.
typedef BinaryFileIArchive IArchive
 Type of input archive used by load method.

Public Member Functions

Construction, destruction and initialization
 Simulator (System< D, T > &system)
 Constructor.
 ~Simulator ()
 Destructor.
virtual void readParameters (std::istream &in)
 Read parameters for a simulation.
void allocate ()
 Allocate required memory during initialization.
Primary Actions: Simulation and Analysis
virtual 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.
void clearData ()
 Clear field eigen-components and Hamiltonian components.
Projected Chi Matrix
void analyzeChi ()
 Perform eigenvalue analysis of projected chi matrix.
DArray< double > const & chiEvals () const
 Get an array of the eigenvalues of the projected chi matrix.
double chiEval (int a) const
 Get a single eigenvalue of the projected chi matrix.
DMatrix< double > const & chiEvecs () const
 Get the matrix of all eigenvectors of the projected chi matrix.
double chiEvecs (int a, int i) const
 Get one element of an eigenvector of the projected chi matrix.
DArray< double > const & sc () const
 Get all components of the vector S.
double sc (int a) const
 Get a single component of the S vector.
Field Theoretic Hamiltonian
void computeHamiltonian ()
 Compute the Hamiltonian used in PS-FTS.
double hamiltonian () const
 Get the Hamiltonian used in PS-FTS.
double idealHamiltonian () const
 Get an ideal contribution to the Hamiltonian.
double fieldHamiltonian () const
 Get the quadratic field contribution to the Hamiltonian.
double perturbationHamiltonian () const
 Get a perturbation to the standard Hamiltonian.
bool hasHamiltonian () const
 Has the Hamiltonian been computed for the current w and c fields?
Chemical Potential Field (W Field) Components
void computeWc ()
 Compute eigenvector components of the current w fields.
DArray< RField< D, T > > const & wc () const
 Get all eigenvector components of the current w fields.
RField< D, T > const & wc (int a) const
 Get one eigenvector component of the current w fields.
bool hasWc () const
 Are eigen-components of the current w fields valid ?
Monomer Concentration Field (C-Field) Components
void computeCc ()
 Compute eigenvector components of the current c fields.
DArray< RField< D, T > > const & cc () const
 Get all eigenvector components of the current c fields.
RField< D, T > const & cc (int a) const
 Get one eigenvector component of the current c fields.
bool hasCc () const
 Are eigen-components of the current c fields valid ?
Functional Derivatives of H[W]
void computeDc ()
 Compute functional derivatives of the Hamiltonian.
DArray< RField< D, T > > const & dc () const
 Get all of the current d fields.
RField< D, T > const & dc (int i) const
 Get one eigenvector component of the current d fields.
bool hasDc () const
 Are the current d fields valid ?
Save and Restore State
void saveState ()
 Save a copy of the current system state.
void restoreState ()
 Restore the system to the saved state.
void clearState ()
 Clear the saved copy of the system state.
Timers and Counters
virtual void outputTimers (std::ostream &out) const
 Output timing results.
virtual void outputMdeCounter (std::ostream &out) const
 Output MDE counter.
virtual void clearTimers ()
 Clear timers.
long iStep ()
 Return the current converged simulation step index.
long iTotalStep ()
 Return the current simulation step index.
Miscellaneous (Accessors and Boolean Flags)
System< D, T > & system ()
 Get the parent system by reference.
Random & random ()
 Get the scalar random number generator by reference.
VecRandom< T > & vecRandom ()
 Get the vector random number generator by reference.
bool hasCompressor () const
 Does this Simulator have a Compressor?
Compressor< D, T > const & compressor () const
 Get the Compressor by const reference.
Compressor< D, T > & compressor ()
 Get the Compressor by non-const reference.
bool hasPerturbation () const
 Does this Simulator have a Perturbation?
Perturbation< D, T > const & perturbation () const
 Get a Perturbation by const reference.
Perturbation< D, T > & perturbation ()
 Get a Perturbation by non-const reference.
bool hasRamp () const
 Does this Simulator have a Ramp?
Ramp< D, T > const & ramp () const
 Get a Ramp by const reference.
Ramp< D, T > & ramp ()
 Get a Ramp by non-const reference.
Public Member Functions inherited from Util::ParamComposite
 ParamComposite ()
 Constructor.
 ParamComposite (const ParamComposite &other)
 Copy constructor.
 ParamComposite (int capacity)
 Constructor.
virtual ~ParamComposite ()
 Virtual destructor.
void resetParam ()
 Resets ParamComposite to its empty state.
virtual void readParam (std::istream &in)
 Read the parameter file block.
virtual void readParamOptional (std::istream &in)
 Read optional parameter file block.
virtual void writeParam (std::ostream &out) const
 Write all parameters to an output stream.
virtual void load (Serializable::IArchive &ar)
 Load all parameters from an input archive.
virtual void loadOptional (Serializable::IArchive &ar)
 Load an optional ParamComposite.
virtual void loadParameters (Serializable::IArchive &ar)
 Load state from archive, without adding Begin and End lines.
virtual void save (Serializable::OArchive &ar)
 Saves all parameters to an archive.
void saveOptional (Serializable::OArchive &ar)
 Saves isActive flag, and then calls save() iff isActive is true.
void readParamComposite (std::istream &in, ParamComposite &child, bool next=true)
 Add and read a required child ParamComposite.
void readParamCompositeOptional (std::istream &in, ParamComposite &child, bool next=true)
 Add and attempt to read an optional child ParamComposite.
template<typename Type>
ScalarParam< Type > & read (std::istream &in, const char *label, Type &value)
 Add and read a new required ScalarParam < Type > object.
template<typename Type>
ScalarParam< Type > & readOptional (std::istream &in, const char *label, Type &value)
 Add and read a new optional ScalarParam < Type > object.
template<typename Type>
CArrayParam< Type > & readCArray (std::istream &in, const char *label, Type *value, int n)
 Add and read a required C array parameter.
template<typename Type>
CArrayParam< Type > & readOptionalCArray (std::istream &in, const char *label, Type *value, int n)
 Add and read an optional C array parameter.
template<typename Type>
DArrayParam< Type > & readDArray (std::istream &in, const char *label, DArray< Type > &array, int n)
 Add and read a required DArray < Type > parameter.
template<typename Type>
DArrayParam< Type > & readOptionalDArray (std::istream &in, const char *label, DArray< Type > &array, int n)
 Add and read an optional DArray < Type > parameter.
template<typename Type, int N>
FArrayParam< Type, N > & readFArray (std::istream &in, const char *label, FArray< Type, N > &array)
 Add and read a required FArray < Type, N > array parameter.
template<typename Type, int N>
FArrayParam< Type, N > & readOptionalFArray (std::istream &in, const char *label, FArray< Type, N > &array)
 Add and read an optional FArray < Type, N > array parameter.
template<typename Type, int N>
FSArrayParam< Type, N > & readFSArray (std::istream &in, const char *label, FSArray< Type, N > &array, int size)
 Add and read a required FSArray < Type, N > array parameter.
template<typename Type, int N>
FSArrayParam< Type, N > & readOptionalFSArray (std::istream &in, const char *label, FSArray< Type, N > &array, int size)
 Add and read an optional FSArray < Type, N > array parameter.
template<typename Type>
CArray2DParam< Type > & readCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np)
 Add and read a required CArray2DParam < Type > 2D C-array.
template<typename Type>
CArray2DParam< Type > & readOptionalCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np)
 Add and read an optional CArray2DParam < Type > 2D C-array parameter.
template<typename Type>
DMatrixParam< Type > & readDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n)
 Add and read a required DMatrix < Type > matrix parameter.
template<typename Type>
DMatrixParam< Type > & readOptionalDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n)
 Add and read an optional DMatrix < Type > matrix parameter.
template<typename Type>
DSymmMatrixParam< Type > & readDSymmMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int n)
 Add and read a required symmetrix DMatrix.
template<typename Type>
DSymmMatrixParam< Type > & readOptionalDSymmMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int n)
 Add and read an optional DMatrix matrix parameter.
Begin & readBegin (std::istream &in, const char *label, bool isRequired=true)
 Add and read a class label and opening bracket.
End & readEnd (std::istream &in)
 Add and read the closing bracket.
Blank & readBlank (std::istream &in)
 Add and read a new Blank object, representing a blank line.
void loadParamComposite (Serializable::IArchive &ar, ParamComposite &child, bool next=true)
 Add and load a required child ParamComposite.
void loadParamCompositeOptional (Serializable::IArchive &ar, ParamComposite &child, bool next=true)
 Add and load an optional child ParamComposite if isActive.
template<typename Type>
ScalarParam< Type > & loadParameter (Serializable::IArchive &ar, const char *label, Type &value, bool isRequired)
 Add and load a new ScalarParam < Type > object.
template<typename Type>
ScalarParam< Type > & loadParameter (Serializable::IArchive &ar, const char *label, Type &value)
 Add and load new required ScalarParam < Type > object.
template<typename Type>
CArrayParam< Type > & loadCArray (Serializable::IArchive &ar, const char *label, Type *value, int n, bool isRequired)
 Add a C array parameter and load its elements.
template<typename Type>
CArrayParam< Type > & loadCArray (Serializable::IArchive &ar, const char *label, Type *value, int n)
 Add and load a required CArrayParam< Type > array parameter.
template<typename Type>
DArrayParam< Type > & loadDArray (Serializable::IArchive &ar, const char *label, DArray< Type > &array, int n, bool isRequired)
 Add an load a DArray < Type > array parameter.
template<typename Type>
DArrayParam< Type > & loadDArray (Serializable::IArchive &ar, const char *label, DArray< Type > &array, int n)
 Add and load a required DArray< Type > array parameter.
template<typename Type, int N>
FArrayParam< Type, N > & loadFArray (Serializable::IArchive &ar, const char *label, FArray< Type, N > &array, bool isRequired)
 Add and load an FArray < Type, N > fixed-size array parameter.
template<typename Type, int N>
FArrayParam< Type, N > & loadFArray (Serializable::IArchive &ar, const char *label, FArray< Type, N > &array)
 Add and load a required FArray < Type > array parameter.
template<typename Type, int N>
FSArrayParam< Type, N > & loadFSArray (Serializable::IArchive &ar, const char *label, FSArray< Type, N > &array, int size, bool isRequired)
 Add and load an FSArray < Type, N > array parameter.
template<typename Type, int N>
FSArrayParam< Type, N > & loadFSArray (Serializable::IArchive &ar, const char *label, FSArray< Type, N > &array, int size)
 Add and load a required FSArray < Type > array parameter.
template<typename Type>
CArray2DParam< Type > & loadCArray2D (Serializable::IArchive &ar, const char *label, Type *value, int m, int n, int np, bool isRequired)
 Add and load a CArray2DParam < Type > C 2D array parameter.
template<typename Type>
CArray2DParam< Type > & loadCArray2D (Serializable::IArchive &ar, const char *label, Type *value, int m, int n, int np)
 Add and load a required < Type > matrix parameter.
template<typename Type>
DMatrixParam< Type > & loadDMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int m, int n, bool isRequired)
 Add and load a DMatrixParam < Type > matrix parameter.
template<typename Type>
DMatrixParam< Type > & loadDMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int m, int n)
 Add and load a required DMatrixParam < Type > matrix parameter.
template<typename Type>
DSymmMatrixParam< Type > & loadDSymmMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int n, bool isRequired)
 Add and load a symmetric DSymmMatrixParam < Type > matrix parameter.
template<typename Type>
DSymmMatrixParam< Type > & loadDSymmMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int n)
 Add and load a required DSymmMatrixParam < Type > matrix parameter.
void addParamComposite (ParamComposite &child, bool next=true)
 Add a child ParamComposite object to the format array.
Begin & addBegin (const char *label)
 Add a Begin object representing a class name and bracket.
End & addEnd ()
 Add a closing bracket.
Blank & addBlank ()
 Create and add a new Blank object, representing a blank line.
std::string className () const
 Get class name string.
bool isRequired () const
 Is this ParamComposite required in the input file?
bool isActive () const
 Is this parameter active?
Public Member Functions inherited from Util::ParamComponent
virtual ~ParamComponent ()
 Destructor.
void setIndent (const ParamComponent &parent, bool next=true)
 Set indent level.
std::string indent () const
 Return indent string for this object (string of spaces).
template<class Archive>
void serialize (Archive &ar, const unsigned int version)
 Serialize this ParamComponent as a string.
Public Member Functions inherited from Util::Serializable
virtual ~Serializable ()
 Destructor.
Public Member Functions inherited from Util::MpiFileIo
 MpiFileIo ()
 Constructor.
 MpiFileIo (const MpiFileIo &other)
 Copy constructor.
bool isIoProcessor () const
 Can this processor do file I/O ?

Protected Member Functions

void readRandomSeed (std::istream &in)
 Optionally read a random seed and initialize RNGs.
CompressorFactory< D, T > & compressorFactory ()
 Get the Compressor factory by reference.
void readCompressor (std::istream &in, bool &isEnd)
 Optionally read a Compressor parameter file block.
PerturbationFactory< D, T > & perturbationFactory ()
 Get the Perturbation factory by reference.
void readPerturbation (std::istream &in, bool &isEnd)
 Optionally read a Perturbation parameter file block.
void setPerturbation (Perturbation< D, T > *ptr)
 Set the associated Perturbation.
RampFactory< D, T > & rampFactory ()
 Get the Ramp factory by reference.
void readRamp (std::istream &in, bool &isEnd)
 Optionally read a Ramp parameter file block.
void setRamp (Ramp< D, T > *ptr)
 Set the associated Ramp.
SimState< D, T > & state ()
 Get the SimState stored internal state by reference.
void setClassName (const char *className)
 Set class name string.
void setIsRequired (bool isRequired)
 Set or unset the isActive flag.
void setIsActive (bool isActive)
 Set or unset the isActive flag.
void setParent (ParamComponent &param, bool next=true)
 Set this to the parent of a child component.
void addComponent (ParamComponent &param, bool isLeaf=true)
 Add a new ParamComponent object to the format array.
template<typename Type>
ScalarParam< Type > & add (std::istream &in, const char *label, Type &value, bool isRequired=true)
 Add a new required ScalarParam < Type > object.
template<typename Type>
CArrayParam< Type > & addCArray (std::istream &in, const char *label, Type *value, int n, bool isRequired=true)
 Add (but do not read) a required C array parameter.
template<typename Type>
DArrayParam< Type > & addDArray (std::istream &in, const char *label, DArray< Type > &array, int n, bool isRequired=true)
 Add (but do not read) a DArray < Type > parameter.
template<typename Type, int N>
FArrayParam< Type, N > & addFArray (std::istream &in, const char *label, FArray< Type, N > &array, bool isRequired=true)
 Add (but do not read) a FArray < Type, N > array parameter.
template<typename Type, int N>
FSArrayParam< Type, N > & addFSArray (std::istream &in, const char *label, FSArray< Type, N > &array, int size, bool isRequired=true)
 Add (but do not read) a FSArray < Type, N > array parameter.
template<typename Type>
CArray2DParam< Type > & addCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np, bool isRequired=true)
 Add (but do not read) a CArray2DParam < Type > 2D C-array.
template<typename Type>
DMatrixParam< Type > & addDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n, bool isRequired=true)
 Add and read a required DMatrix < Type > matrix parameter.
Protected Member Functions inherited from Util::ParamComponent
 ParamComponent ()
 Constructor.
 ParamComponent (const ParamComponent &other)
 Copy constructor.

Protected Attributes

DArray< RField< D, T > > wc_
 Eigenvector components of w fields on a real space grid.
DArray< RField< D, T > > cc_
 Eigenvector components of c fields on a real space grid.
DArray< RField< D, T > > dc_
 Components of d fields on a real space grid.
SimState< D, T > state_
 Previous state saved at the beginning of a step.
double hamiltonian_
 Total field theoretic Hamiltonian H[W] (extensive value).
double idealHamiltonian_
 Ideal gas contribution (-lnQ) to Hamiltonian.
double fieldHamiltonian_
 Quadratic field contribution to Hamiltonian.
double perturbationHamiltonian_
 Perturbation contribution to the Hamiltonian.
long iStep_
 Step counter - number of steps for which the compressor converged.
long iTotalStep_
 Step counter - total number of attempted BD or MC steps.
long seed_
 Random number generator seed (input value).
bool hasHamiltonian_
 Has the Hamiltonian been computed for the current w and c fields?
bool hasWc_
 Have eigen-components of the current w fields been computed ?
bool hasCc_
 Have eigen-components of the current c fields been computed ?
bool hasDc_
 Have functional derivatives of H[W] been computed ?

Additional Inherited Members

Static Public Member Functions inherited from Util::ParamComponent
static void initStatic ()
 Initialize static echo member to false.
static void setEcho (bool echo=true)
 Enable or disable echoing for all subclasses of ParamComponent.
static bool echo ()
 Get echo parameter.

Detailed Description

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

Base class for field theoretic PS-FTS simulator.

Template parameters :

D - integer dimensionality of space (D=1, 2, or 3) T - Backend identifier class (CppTp<D> or CudaTp<D>)

Purpose : A Simulator base class provides tools needed in field-theoretic simulations that are based on a partial saddle-point approximation for an incompressible system. Subclasses designed for field theoretic Monte Carlo (MC) and Brownian dynamics (BD) simulations, named McSimulator and BdSimulator, provide more specialized algorithms and data structures needed by these two sampling methods. Each specialization of the class templates BdSimulator<D, T> and McSimulator <D, T> is a thus derived from a corresponding specialization Simulator<D, T>.

The Simulator class template provides functions to:

  • Compute and diagonalize a projected chi matrix
  • Compute and return the field theoretic Hamiltonian and its components
  • Compute functional derivatives of the Hamiltonian with respect to chemical potential (w) field components
  • Compute and access components of several types of fields in a basis of eigenvectors of the projected chi matrix

Projected Chi Matrix :

The analyzeChi function constructs and diagonalizes the projected chi matrix. This is a singular nMonomer x nMonomer matrix defined by evaluating the orthogonal projection of the chi matrix into the subspace of fluctuations that preserves total monomer concentration. The eigenvalues and eigenvectors of this matrix are accessed via the chiEvals and chiEvecs functions, respectively.

Field Components :

The functions computeWc, computeCc and computeDc compute components of various types of multi-component fields (i.e., fields that are associated with a monomer type index) in a basis of eigenvectors of the projected chi matrix. Names such as wc, cc and dc that end with a suffix "c" refer to components of multi-component fields that are defined using this eigenvector basis.

See also
BdSimulator (manual page)
McSimulator (manual page)

Definition at line 92 of file Simulator.h.

Member Typedef Documentation

◆ RFieldT

template<int D, class T>
using Pscf::Rp::Simulator< D, T >::RFieldT = RField<D,T>

Container for a real-valued periodic field.

Definition at line 98 of file Simulator.h.

Constructor & Destructor Documentation

◆ Simulator()

◆ ~Simulator()

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

Destructor.

Definition at line 91 of file Simulator.tpp.

Member Function Documentation

◆ readParameters()

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

Read parameters for a simulation.

The default implementation reads an optional random seed, an optional Compressor block, an optional Perturbation, and an optional Ramp, in that order. This default is intended to be used only for unit testing.

Parameters
ininput parameter stream

Reimplemented from Util::ParamComposite.

Reimplemented in Pscf::Rp::BdSimulator< D, T >, Pscf::Rp::McSimulator< D, T >, Pscf::Rp::McSimulator< D, CPT >, and Pscf::Rp::McSimulator< D, CUT >.

Definition at line 170 of file Simulator.tpp.

References readRandomSeed().

◆ allocate()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::allocate ( )

Allocate required memory during initialization.

This function must be called by the readParameters method of any subclass. Declared as public to also allow use in unit tests.

Preconditions: Values of nMonomer and the mesh dimensions must be defined in Mixture and Domain members of the parent System on entry.

Definition at line 126 of file Simulator.tpp.

References UTIL_CHECK.

Referenced by Pscf::Rp::BdSimulator< D, T >::readParameters().

◆ simulate()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::simulate ( int nStep)
virtual

Perform a field theoretic Monte-Carlo simulation.

Perform a field theoretic simulation of nSteps using the partial saddle-point approximation.

The default implemention is a do-nothing placeholder that throws an error if called, and must be overridden by subclasses.

Parameters
nStepnumber of simulation steps

Reimplemented in Pscf::Rp::BdSimulator< D, T >, Pscf::Rp::McSimulator< D, T >, Pscf::Rp::McSimulator< D, CPT >, and Pscf::Rp::McSimulator< D, CUT >.

Definition at line 191 of file Simulator.tpp.

References UTIL_THROW.

◆ analyze()

template<int D, class T>
void Pscf::Rp::Simulator< 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 class specified by the "classname" argument to read a trajectory file with the specified filename. The function opens the file, performs the analysis, and closes the file before returning.

The default implemention is a do-nothing placeholder that throws an error if called, and must be overridden by subclasses.

Parameters
minfirst frame number
maxlast frame number
classnamename of TrajectoryReader class
filenamename of trajectory file

Reimplemented in Pscf::Rp::BdSimulator< D, T >, Pscf::Rp::McSimulator< D, T >, Pscf::Rp::McSimulator< D, CPT >, and Pscf::Rp::McSimulator< D, CUT >.

Definition at line 198 of file Simulator.tpp.

◆ clearData()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::clearData ( )

Clear field eigen-components and Hamiltonian components.

This function should be called whenever any of the inputs to the calculations of the fields or Hamiltonian is changed, to indicate that Hamiltonian and field data stored in this class is outdated. On return, the functions hasHamiltonian(), hasWc(), hasCc(), and hasDc() will all return false.

Definition at line 207 of file Simulator.tpp.

References hasCc_, hasDc_, hasHamiltonian_, and hasWc_.

Referenced by Pscf::Rp::BdSimulator< D, T >::analyze(), and Pscf::Rp::McSimulator< D, T >::analyze().

◆ analyzeChi()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::analyzeChi ( )

Perform eigenvalue analysis of projected chi matrix.

Uses a chi matrix obtained from the Interaction member of the parent System.

Definition at line 340 of file Simulator.tpp.

References Util::DMatrix< Data >::allocate(), system(), and UTIL_CHECK.

◆ chiEvals()

template<int D, class T>
DArray< double > const & Pscf::Rp::Simulator< D, T >::chiEvals ( ) const
inline

Get an array of the eigenvalues of the projected chi matrix.

The projected chi matrix is given by the matrix product P*chi*P, where P is the symmetric projection matrix that projects onto the subspace orthogonal to the vector e = (1,1,...,1). The projected chi matrix is singular, and has a zero eigenvalue with associated eigenvector e. By convention, this zero eigenvalue and its eigenvector e are listed last, with index nMonomer - 1.

Definition at line 1038 of file Simulator.h.

◆ chiEval()

template<int D, class T>
double Pscf::Rp::Simulator< D, T >::chiEval ( int a) const
inline

Get a single eigenvalue of the projected chi matrix.

Parameters
aindex of eigenvalue (0, ... , nMonomer - 1)

Definition at line 1043 of file Simulator.h.

◆ chiEvecs() [1/2]

template<int D, class T>
DMatrix< double > const & Pscf::Rp::Simulator< D, T >::chiEvecs ( ) const
inline

Get the matrix of all eigenvectors of the projected chi matrix.

This function returns the entire nMonomer x nMonomer matrix of the eigenvectors of the projected chi matrix, in which each row is an eigenvector. The first (row) index of this matrix thus identifies an eigenvector, while the second (column) index identifies the monomer type associated with one component of an eigen-vector.

Each eigenvector is normalized such that the sum of the squares of its elements is equal to nMonomer, the number of monomer types. The sign of each vector is chosen so as to make the first (0) component non-negative. The last eigenvector is always the null vector e = (1,1,...,1).

For the case nMonomer = 2 of an AB system, the resulting two eigenvectors are (1,-1) and (1,1).

Definition at line 1048 of file Simulator.h.

◆ chiEvecs() [2/2]

template<int D, class T>
double Pscf::Rp::Simulator< D, T >::chiEvecs ( int a,
int i ) const
inline

Get one element of an eigenvector of the projected chi matrix.

See documentation of chiEvecs(), which returns the entire matrix.

Parameters
aeigenvector index (0, ..., nMonomer - 1)
imonomoner type index (0, ..., nMonomer - 1)

Definition at line 1053 of file Simulator.h.

◆ sc() [1/2]

template<int D, class T>
DArray< double > const & Pscf::Rp::Simulator< D, T >::sc ( ) const
inline

Get all components of the vector S.

The value of component \( S_{a} \) may be expressed using Einstein summation convention as

\[ S_{a} \equiv \frac{1}{M^2} v_{ai}\chi_{ij}e_{j} \]

for any \( a = 0, \ldots, M - 1 \), where M = nMonomer (the number of monomer types), \( e_{j} =1 \) for any j, and \( v_{ai} \) is component associated with monomer type i of eigenvector a of the projected chi matrix, with the convention \( v_{ia} = e_{i} = 1 \) for a = nMonomer - 1.

Definition at line 1058 of file Simulator.h.

◆ sc() [2/2]

template<int D, class T>
double Pscf::Rp::Simulator< D, T >::sc ( int a) const
inline

Get a single component of the S vector.

This function retrieves on component of the vector defined in the documentation for function sc().

Parameters
aeigenvector index (0, ..., nMonomer - 1)

Definition at line 1063 of file Simulator.h.

◆ computeHamiltonian()

◆ hamiltonian()

template<int D, class T>
double Pscf::Rp::Simulator< D, T >::hamiltonian ( ) const
inline

Get the Hamiltonian used in PS-FTS.

This function returns the real, thermodynamically extensive Hamiltonian used in simulations based on partial saddle-point approximation (PS-FTS). The value returned by this function is equal to the sum of values returned by idealHamiltonian(), fieldHamiltonian() and perturbationHamiltonian() functions.

Definition at line 1075 of file Simulator.h.

References hamiltonian_, hasHamiltonian_, and UTIL_CHECK.

Referenced by saveState().

◆ idealHamiltonian()

template<int D, class T>
double Pscf::Rp::Simulator< D, T >::idealHamiltonian ( ) const
inline

Get an ideal contribution to the Hamiltonian.

The ideal Hamiltonian contribution returned by this function is given by the quantity denoted by \( \tilde{H}_{\rm id} \), as defined here, given by

\[ H_{\rm id} = \frac{V}{v} \sum_{a} \frac{\overline{\phi}_{a}}{N_{a}} \left [ \ln \left ( \frac{\overline{\phi}_{a}}{Q_{a}} \right ) - 1 \right ] - \frac{1}{v}\int W_{+}^{*}({\bf r}) \\ \]

Here, \( a \) is an index for molecular species, while \( \overline{\phi}_{a} \), \( N_{a} \) and \( Q_{a} \) are the volume fraction, number of monomers per molecule (i.e., ratio of molecular to monomer volume), and the normalized single-molecule partition function for polymer or solvent species \( a \), respectively.

Definition at line 1083 of file Simulator.h.

References hasHamiltonian_, idealHamiltonian_, and UTIL_CHECK.

Referenced by saveState().

◆ fieldHamiltonian()

template<int D, class T>
double Pscf::Rp::Simulator< D, T >::fieldHamiltonian ( ) const
inline

Get the quadratic field contribution to the Hamiltonian.

The field Hamiltonian contribution returned by this function is given by the quantity denoted by \( \tilde{H}_{\rm id} \), as defined here, given by

\[ H_{\rm f} = \frac{1}{v} \int \! d{\bf r} \; \left \{ \sum_{\alpha=0}^{M-2} \frac{M (W_{\alpha} - S_{\alpha})^2 }{ 2 |\lambda_{\alpha}|} + \frac{S_{+}}{2} \right \} \quad, \]

where \( \alpha \) is an index for eigenvectors of the projected \( \chi \) matrix, \( S_{\alpha} = v_{\alpha i} \chi_{ij} e_{j}/M^{2} \), and \( S_{+} = S_{M-1} = e_{i} \chi_{ij} e_{j}/M^{2} \).

Definition at line 1091 of file Simulator.h.

References fieldHamiltonian_, hasHamiltonian_, and UTIL_CHECK.

Referenced by saveState().

◆ perturbationHamiltonian()

template<int D, class T>
double Pscf::Rp::Simulator< D, T >::perturbationHamiltonian ( ) const
inline

Get a perturbation to the standard Hamiltonian.

A perturbation to the Hamiltonian, if any, is computed by an associated Perturbation object.

When no perturbation exists, this function returns zero.

Definition at line 1099 of file Simulator.h.

References hasHamiltonian_, perturbationHamiltonian_, and UTIL_CHECK.

Referenced by saveState().

◆ hasHamiltonian()

template<int D, class T>
bool Pscf::Rp::Simulator< D, T >::hasHamiltonian ( ) const
inline

Has the Hamiltonian been computed for the current w and c fields?

Definition at line 1070 of file Simulator.h.

References hasHamiltonian_.

Referenced by saveState().

◆ computeWc()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::computeWc ( )

Compute eigenvector components of the current w fields.

Compute and store the components of the values of the w fields on nodes of a real-space grid (r-grid) in a basis of the eigenvectors of the projected chi matrix. The component field \( W_{a}({\bf r}) \) at grid point \( {\bf r} \) is given using Einstein summation by

\[ W_{a}({\bf r}) = v_{ai} w_{i}({\bf r}) / M \]

where \( w_{i}({\bf r}) \) is the w-field associated with monomer type \( i \), \( v_{ai} \) is eigenvector a of the projected chi matrix, and M = nMonomer.

Exceptions
Exceptionif !system().w().hasData()

Definition at line 500 of file Simulator.tpp.

References Pscf::VecOp::eqS(), system(), UTIL_CHECK, and wc_.

Referenced by computeDc(), and computeHamiltonian().

◆ wc() [1/2]

template<int D, class T>
DArray< RField< D, T > > const & Pscf::Rp::Simulator< D, T >::wc ( ) const
inline

Get all eigenvector components of the current w fields.

This function returns a DArray of fields in which each field is a chemical field component \( W_{a}({\bf r}) \) as defined in the documentation of computeWc(), for a = 0, ..., nMonomer - 1.

Definition at line 1114 of file Simulator.h.

References wc_.

◆ wc() [2/2]

template<int D, class T>
RField< D, T > const & Pscf::Rp::Simulator< D, T >::wc ( int a) const
inline

Get one eigenvector component of the current w fields.

See documentation of functions computeWc() and wc() for details.

Parameters
aeigenvector index in range 0 , ..., nMonomer -1

Definition at line 1119 of file Simulator.h.

References wc_.

◆ hasWc()

template<int D, class T>
bool Pscf::Rp::Simulator< D, T >::hasWc ( ) const
inline

Are eigen-components of the current w fields valid ?

Definition at line 1109 of file Simulator.h.

References hasWc_.

Referenced by saveState().

◆ computeCc()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::computeCc ( )

Compute eigenvector components of the current c fields.

Compute and store the components of the values of the c fields on nodes of a real-space grid (r-grid) in a basis of the eigenvectors of the projected chi matrix.

Exceptions
Exceptionif !system().c().hasData()

Definition at line 531 of file Simulator.tpp.

References system(), and UTIL_CHECK.

Referenced by computeDc().

◆ cc() [1/2]

template<int D, class T>
DArray< RField< D, T > > const & Pscf::Rp::Simulator< D, T >::cc ( ) const
inline

Get all eigenvector components of the current c fields.

Each component \(C_{a}({\bf r}) \) is a point-wise projection of the monomer c fields onto a corresponding eigenvector of the projected chi matrix. The resulting value \( C_{a}({\bf r}) \) for eigen-component a at grid point \( {\bf r} \) is given using Einstein notation as

\[ C_{a}({\bf r}) = v_{ai} c_{i}({\bf r}) \]

where \( c_{i}({\bf r}) \) is the concentration / volume fraction field associated with monomer type i.

Note: The above definition \( C_{a} \) uses a different prefactor than that used to define the corresponding w-field component \( W_{a} \) given in the documentation of the function wc(), without the prefactor of 1/nMonomer. This is intentional, and is convenient for other aspects of the underlying theory.

Definition at line 1129 of file Simulator.h.

References cc_.

Referenced by saveState().

◆ cc() [2/2]

template<int D, class T>
RField< D, T > const & Pscf::Rp::Simulator< D, T >::cc ( int a) const
inline

Get one eigenvector component of the current c fields.

This returns a reference to a field \( C_{a}({\bf r}) \) as defined in the documentation of function cc().

Parameters
aeigenvector / eigenvalue index

Definition at line 1134 of file Simulator.h.

References cc_.

◆ hasCc()

template<int D, class T>
bool Pscf::Rp::Simulator< D, T >::hasCc ( ) const
inline

Are eigen-components of the current c fields valid ?

Definition at line 1124 of file Simulator.h.

References hasCc_.

Referenced by saveState().

◆ computeDc()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::computeDc ( )

Compute functional derivatives of the Hamiltonian.

Compute and store the functional derivatives of the field theoretic Hamiltonian with respect to eigenvector components of the w fields (i.e., with respect to components of wc).

This function requires eigenvector components wc and cc of the w and c, but will compute them from monomer components by calling computeWc and computeCc as needed.

Exceptions
Exceptionif !system().w().hasData()
Exceptionif !system().c().hasData()

Definition at line 563 of file Simulator.tpp.

References computeCc(), computeWc(), hasCc_, hasWc_, and UTIL_CHECK.

◆ dc() [1/2]

template<int D, class T>
DArray< RField< D, T > > const & Pscf::Rp::Simulator< D, T >::dc ( ) const
inline

Get all of the current d fields.

This function returns an array of fields in which element a is the functional derivative of the Hamiltonian H[W] with respect to the field component \( W_{a} \) that is returned by the member function wc(a).

Definition at line 1144 of file Simulator.h.

References dc_.

Referenced by saveState().

◆ dc() [2/2]

template<int D, class T>
RField< D, T > const & Pscf::Rp::Simulator< D, T >::dc ( int i) const
inline

Get one eigenvector component of the current d fields.

Parameters
ieigenvector / eigenvalue index

Definition at line 1149 of file Simulator.h.

References dc_.

◆ hasDc()

template<int D, class T>
bool Pscf::Rp::Simulator< D, T >::hasDc ( ) const
inline

Are the current d fields valid ?

Definition at line 1139 of file Simulator.h.

References hasDc_.

Referenced by saveState().

◆ saveState()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::saveState ( )

Save a copy of the current system state.

This function and restoreState() are intended for use in the implementation of field theoretic moves. This function stores the current w fields and the corresponding Hamiltonian value. Current cc fields and dc fields are saved based on save policy. This is normally the first step of a Monte-Carlo (MC) move, prior to an attempted modification of the fields stored in the system w field container.

Definition at line 600 of file Simulator.tpp.

References cc(), cc_, dc(), dc_, fieldHamiltonian(), hamiltonian(), hasCc(), hasDc(), hasHamiltonian(), hasPerturbation(), hasWc(), idealHamiltonian(), perturbation(), perturbationHamiltonian(), state(), system(), UTIL_CHECK, and wc_.

◆ restoreState()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::restoreState ( )

Restore the system to the saved state.

This function and saveState() are intended to be used together in the implementation of MC moves. If an attempted Monte-Carlo move is rejected, or if the compressor fails to converge after any attempted FTS move, restoreState() is called to restore the fields and Hamiltonian value that were saved by a previous call to the function saveState().

Definition at line 656 of file Simulator.tpp.

◆ clearState()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::clearState ( )

Clear the saved copy of the system state.

This function, restoreState(), and saveState() are intended to be used together in the implementation of reversible FTS moves. If an attempted move is accepted, clearState() is called to clear the stored state and indicate acceptance.

Definition at line 711 of file Simulator.tpp.

◆ outputTimers()

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

Output timing results.

Empty default implementation.

Parameters
outoutput stream

Reimplemented in Pscf::Rp::McSimulator< D, T >, Pscf::Rp::McSimulator< D, CPT >, and Pscf::Rp::McSimulator< D, CUT >.

Definition at line 718 of file Simulator.tpp.

◆ outputMdeCounter()

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

Output MDE counter.

Output the number of times the modified diffusion equation has been solved.

Parameters
outoutput stream

Definition at line 729 of file Simulator.tpp.

References UTIL_CHECK.

Referenced by Pscf::Rp::McSimulator< D, T >::simulate().

◆ clearTimers()

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

Clear timers.

Empty default implementation.

Reimplemented in Pscf::Rp::McSimulator< D, T >, Pscf::Rp::McSimulator< D, CPT >, and Pscf::Rp::McSimulator< D, CUT >.

Definition at line 741 of file Simulator.tpp.

References compressor(), and hasCompressor().

◆ iStep()

template<int D, class T>
long Pscf::Rp::Simulator< D, T >::iStep ( )
inline

Return the current converged simulation step index.

Definition at line 1154 of file Simulator.h.

References iStep_.

◆ iTotalStep()

template<int D, class T>
long Pscf::Rp::Simulator< D, T >::iTotalStep ( )
inline

Return the current simulation step index.

Definition at line 1159 of file Simulator.h.

References iTotalStep_.

◆ system()

◆ random()

template<int D, class T>
Random & Pscf::Rp::Simulator< D, T >::random ( )
inline

Get the scalar random number generator by reference.

Definition at line 952 of file Simulator.h.

References UTIL_ASSERT.

Referenced by readRandomSeed(), and Simulator().

◆ vecRandom()

template<int D, class T>
VecRandom< T > & Pscf::Rp::Simulator< D, T >::vecRandom ( )
inline

Get the vector random number generator by reference.

Definition at line 960 of file Simulator.h.

References UTIL_ASSERT.

Referenced by readRandomSeed(), and Simulator().

◆ hasCompressor()

◆ compressor() [1/2]

template<int D, class T>
Compressor< D, T > const & Pscf::Rp::Simulator< D, T >::compressor ( ) const
inline

Get the Compressor by const reference.

Definition at line 981 of file Simulator.h.

References UTIL_CHECK.

Referenced by clearTimers(), Pscf::Rp::McSimulator< D, T >::outputTimers(), and Pscf::Rp::BdSimulator< D, T >::simulate().

◆ compressor() [2/2]

template<int D, class T>
Compressor< D, T > & Pscf::Rp::Simulator< D, T >::compressor ( )
inline

Get the Compressor by non-const reference.

Definition at line 973 of file Simulator.h.

References UTIL_CHECK.

◆ hasPerturbation()

template<int D, class T>
bool Pscf::Rp::Simulator< D, T >::hasPerturbation ( ) const
inline

Does this Simulator have a Perturbation?

Definition at line 989 of file Simulator.h.

Referenced by readPerturbation(), and saveState().

◆ perturbation() [1/2]

template<int D, class T>
Perturbation< D, T > const & Pscf::Rp::Simulator< D, T >::perturbation ( ) const
inline

Get a Perturbation by const reference.

Definition at line 994 of file Simulator.h.

References UTIL_CHECK.

Referenced by saveState().

◆ perturbation() [2/2]

template<int D, class T>
Perturbation< D, T > & Pscf::Rp::Simulator< D, T >::perturbation ( )
inline

Get a Perturbation by non-const reference.

Definition at line 1002 of file Simulator.h.

References UTIL_CHECK.

◆ hasRamp()

template<int D, class T>
bool Pscf::Rp::Simulator< D, T >::hasRamp ( ) const
inline

◆ ramp() [1/2]

template<int D, class T>
Ramp< D, T > const & Pscf::Rp::Simulator< D, T >::ramp ( ) const
inline

Get a Ramp by const reference.

Definition at line 1015 of file Simulator.h.

References UTIL_CHECK.

Referenced by Pscf::Rp::BdSimulator< D, T >::simulate(), and Pscf::Rp::McSimulator< D, T >::simulate().

◆ ramp() [2/2]

template<int D, class T>
Ramp< D, T > & Pscf::Rp::Simulator< D, T >::ramp ( )
inline

Get a Ramp by non-const reference.

Definition at line 1023 of file Simulator.h.

References UTIL_CHECK.

◆ readRandomSeed()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::readRandomSeed ( std::istream & in)
protected

Optionally read a random seed and initialize RNGs.

Parameters
ininput parameter stream

Definition at line 754 of file Simulator.tpp.

References random(), Util::ParamComposite::readOptional(), seed_, and vecRandom().

Referenced by Pscf::Rp::BdSimulator< D, T >::readParameters(), Pscf::Rp::McSimulator< D, T >::readParameters(), and readParameters().

◆ compressorFactory()

template<int D, class T>
CompressorFactory< D, T > & Pscf::Rp::Simulator< D, T >::compressorFactory ( )
protected

Get the Compressor factory by reference.

Definition at line 793 of file Simulator.tpp.

References UTIL_CHECK.

Referenced by readCompressor().

◆ readCompressor()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::readCompressor ( std::istream & in,
bool & isEnd )
protected

Optionally read a Compressor parameter file block.

If isEnd is true on entry, this function returns without attempting to read the Compressor block.

Parameters
ininput parameter stream
isEndHas the end bracket of the Simulator block been read?

Definition at line 774 of file Simulator.tpp.

References Util::ParamComposite::className(), compressorFactory(), Util::ParamComponent::echo(), Util::Log::file(), hasCompressor(), Util::ParamComponent::indent(), and UTIL_CHECK.

Referenced by Pscf::Rp::BdSimulator< D, T >::readParameters(), and Pscf::Rp::McSimulator< D, T >::readParameters().

◆ perturbationFactory()

template<int D, class T>
PerturbationFactory< D, T > & Pscf::Rp::Simulator< D, T >::perturbationFactory ( )
protected

Get the Perturbation factory by reference.

Definition at line 824 of file Simulator.tpp.

References UTIL_CHECK.

Referenced by readPerturbation().

◆ readPerturbation()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::readPerturbation ( std::istream & in,
bool & isEnd )
protected

Optionally read a Perturbation parameter file block.

If isEnd is true on entry, this function returns without attempting to read the Perturbation block.

Parameters
ininput parameter stream
isEndHas the end bracket of the Simulator block been read?

Definition at line 805 of file Simulator.tpp.

References Util::ParamComposite::className(), Util::ParamComponent::echo(), Util::Log::file(), hasPerturbation(), Util::ParamComponent::indent(), perturbationFactory(), and UTIL_CHECK.

Referenced by Pscf::Rp::BdSimulator< D, T >::readParameters().

◆ setPerturbation()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::setPerturbation ( Perturbation< D, T > * ptr)
protected

Set the associated Perturbation.

Parameters
ptrpointer to a new Perturbation

Definition at line 834 of file Simulator.tpp.

References UTIL_CHECK.

◆ rampFactory()

template<int D, class T>
RampFactory< D, T > & Pscf::Rp::Simulator< D, T >::rampFactory ( )
protected

Get the Ramp factory by reference.

Definition at line 864 of file Simulator.tpp.

References UTIL_CHECK.

Referenced by readRamp().

◆ readRamp()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::readRamp ( std::istream & in,
bool & isEnd )
protected

Optionally read a Ramp parameter file block.

If isEnd is true on entry, this function returns without attempting to read the Ramp block.

Parameters
ininput parameter stream
isEndHas the end bracket of the Simulator block been read?

Definition at line 846 of file Simulator.tpp.

References Util::ParamComposite::className(), Util::ParamComponent::echo(), Util::Log::file(), hasRamp(), Util::ParamComponent::indent(), rampFactory(), and UTIL_CHECK.

Referenced by Pscf::Rp::BdSimulator< D, T >::readParameters().

◆ setRamp()

template<int D, class T>
void Pscf::Rp::Simulator< D, T >::setRamp ( Ramp< D, T > * ptr)
protected

Set the associated Ramp.

Parameters
ptrpointer to a new Ramp

Definition at line 874 of file Simulator.tpp.

References UTIL_CHECK.

◆ state()

template<int D, class T>
SimState< D, T > & Pscf::Rp::Simulator< D, T >::state ( )
inlineprotected

Get the SimState stored internal state by reference.

The T::SimState object is used to store the previous internal state of the system. This allows restoration after a rejected MC move or failure of the Compressor to converge during either a BD or MC move.

Definition at line 1031 of file Simulator.h.

References state_.

Referenced by Pscf::Rp::McSimulator< D, T >::needsCc(), Pscf::Rp::McSimulator< D, T >::needsDc(), Pscf::Rp::BdSimulator< D, T >::readParameters(), and saveState().

Member Data Documentation

◆ wc_

template<int D, class T>
DArray< RField<D,T> > Pscf::Rp::Simulator< D, T >::wc_
protected

Eigenvector components of w fields on a real space grid.

Each field component corresponds to a point-wise projection of the monomer w fields onto an eigenvector of the projected chi matrix. The number of components is equal to the number of monomer types, nMonomer. The last component is a pressure-like field.

Definition at line 742 of file Simulator.h.

Referenced by computeWc(), saveState(), wc(), and wc().

◆ cc_

template<int D, class T>
DArray< RField<D,T> > Pscf::Rp::Simulator< D, T >::cc_
protected

Eigenvector components of c fields on a real space grid.

Each field component corresponds to a point-wise projection of the monomer c fields onto an eigenvector of the projected chi matrix. The number of components is equal to the number of monomer types, nMonomer. The last component must satisfy an incompressibility constraint.

Definition at line 753 of file Simulator.h.

Referenced by cc(), cc(), and saveState().

◆ dc_

template<int D, class T>
DArray< RField<D,T> > Pscf::Rp::Simulator< D, T >::dc_
protected

Components of d fields on a real space grid.

Each field component is the functional derivative of H[W] with respect to one eigenvector w-field component.

Definition at line 761 of file Simulator.h.

Referenced by dc(), dc(), and saveState().

◆ state_

template<int D, class T>
SimState<D,T> Pscf::Rp::Simulator< D, T >::state_
mutableprotected

Previous state saved at the beginning of a step.

This data structure is used to restore a previous state if the compressor fails to converge or if a MC move is rejected.

Definition at line 769 of file Simulator.h.

Referenced by state().

◆ hamiltonian_

template<int D, class T>
double Pscf::Rp::Simulator< D, T >::hamiltonian_
protected

Total field theoretic Hamiltonian H[W] (extensive value).

Definition at line 774 of file Simulator.h.

Referenced by hamiltonian(), and Simulator().

◆ idealHamiltonian_

template<int D, class T>
double Pscf::Rp::Simulator< D, T >::idealHamiltonian_
protected

Ideal gas contribution (-lnQ) to Hamiltonian.

Definition at line 779 of file Simulator.h.

Referenced by computeHamiltonian(), idealHamiltonian(), and Simulator().

◆ fieldHamiltonian_

template<int D, class T>
double Pscf::Rp::Simulator< D, T >::fieldHamiltonian_
protected

Quadratic field contribution to Hamiltonian.

Definition at line 784 of file Simulator.h.

Referenced by fieldHamiltonian(), and Simulator().

◆ perturbationHamiltonian_

template<int D, class T>
double Pscf::Rp::Simulator< D, T >::perturbationHamiltonian_
protected

Perturbation contribution to the Hamiltonian.

A perturbation Hamiltonian component, if any, is computed by an associated Perturbation object and added to the ideal and field components to obtain the total hamiltonian_ value.

Definition at line 793 of file Simulator.h.

Referenced by perturbationHamiltonian(), and Simulator().

◆ iStep_

template<int D, class T>
long Pscf::Rp::Simulator< D, T >::iStep_
protected

Step counter - number of steps for which the compressor converged.

Steps for which the compressor fails to converge are returned to the previous state so that another random displacement can be chosen. Attempted MC moves for which the compressor converges but which are then rejected based on a Metropolis criterion are included in iStep_. The difference iTotalStep_ - iStep_ is the number of moves that failed because the compressor failed to converge.

Definition at line 806 of file Simulator.h.

Referenced by Pscf::Rp::BdSimulator< D, T >::analyze(), Pscf::Rp::McSimulator< D, T >::analyze(), iStep(), Pscf::Rp::BdSimulator< D, T >::simulate(), Pscf::Rp::McSimulator< D, T >::simulate(), and Simulator().

◆ iTotalStep_

template<int D, class T>
long Pscf::Rp::Simulator< D, T >::iTotalStep_
protected

Step counter - total number of attempted BD or MC steps.

Definition at line 811 of file Simulator.h.

Referenced by iTotalStep(), Pscf::Rp::BdSimulator< D, T >::simulate(), Pscf::Rp::McSimulator< D, T >::simulate(), and Simulator().

◆ seed_

template<int D, class T>
long Pscf::Rp::Simulator< D, T >::seed_
protected

Random number generator seed (input value).

Definition at line 816 of file Simulator.h.

Referenced by readRandomSeed(), and Simulator().

◆ hasHamiltonian_

template<int D, class T>
bool Pscf::Rp::Simulator< D, T >::hasHamiltonian_
protected

Has the Hamiltonian been computed for the current w and c fields?

Definition at line 823 of file Simulator.h.

Referenced by clearData(), computeHamiltonian(), fieldHamiltonian(), hamiltonian(), hasHamiltonian(), idealHamiltonian(), perturbationHamiltonian(), and Simulator().

◆ hasWc_

template<int D, class T>
bool Pscf::Rp::Simulator< D, T >::hasWc_
protected

Have eigen-components of the current w fields been computed ?

Definition at line 828 of file Simulator.h.

Referenced by clearData(), computeDc(), computeHamiltonian(), hasWc(), and Simulator().

◆ hasCc_

template<int D, class T>
bool Pscf::Rp::Simulator< D, T >::hasCc_
protected

Have eigen-components of the current c fields been computed ?

Definition at line 833 of file Simulator.h.

Referenced by clearData(), computeDc(), hasCc(), and Simulator().

◆ hasDc_

template<int D, class T>
bool Pscf::Rp::Simulator< D, T >::hasDc_
protected

Have functional derivatives of H[W] been computed ?

Definition at line 838 of file Simulator.h.

Referenced by clearData(), hasDc(), and Simulator().


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