PSCF v1.4.0

Simulator for complex Langevin field theoretic simulation. More...

#include <Simulator.h>

Inheritance diagram for Pscf::Cpc::Simulator< D >:
Util::ParamComposite Util::ParamComponent Util::Serializable Util::MpiFileIo

Public Member Functions

 Simulator (System< D > &system)
 Constructor.
 ~Simulator ()
 Destructor.
void allocate ()
 Allocate required memory.
virtual void readParameters (std::istream &in)
 Read parameters for a simulation.
Primary Actions: Simulation and Analysis
virtual void simulate (int nStep)
 Perform a complex Langevin field theoretic simulation.
void clearData ()
 Clear field eigen-components and hamiltonian components.
Timers and Counters
virtual void outputTimers (std::ostream &out) const
 Output timing results.
virtual void clearTimers ()
 Clear timers.
long iStep ()
 Return the current converged simulation step index.
long iTotalStep ()
 Return the current simulation step index.
Interaction Matrix
void analyzeInteraction ()
 Perform eigenvalue analysis of the interaction matrix U.
DMatrix< double > const & u () const
 Get the interaction matrix U by const reference.
DArray< double > const & evals () const
 Get an array of the eigenvalues of the interaction matrix U.
double eval (int i) const
 Get a single eigenvalue of the interaction matrix.
bool isPositiveEval (int i) const
 Is the associated eigenvalue of U positive?
DMatrix< double > const & evecs () const
 Get the matrix of all eigenvectors of the interaction matrix.
double evecs (int a, int i) const
 Get one element of an eigenvector of the interaction matrix.
Field Theoretic Hamiltonian
void computeHamiltonian ()
 Compute the Hamiltonian used in PS-FTS.
std::complex< double > hamiltonian () const
 Get the Hamiltonian used in PS-FTS.
std::complex< double > idealHamiltonian () const
 Get ideal gas contribution to the Hamiltonian.
std::complex< double > fieldHamiltonian () const
 Get the quadratic field contribution to the Hamiltonian.
bool hasHamiltonian () const
 Has the Hamiltonian been computed for current w and c fields?
Chemical Potential Field (W Field) Components
void computeWc ()
 Compute eigenvector components of the current w fields.
DArray< CField< D > > const & wc () const
 Get all eigenvector components of the current w fields.
CField< D > const & wc (int a) const
 Get one eigenvector component of the current w fields.
bool hasWc () const
 Are eigen-components of current w fields valid ?
Monomer Concentration Field (C-Field) Components
void computeCc ()
 Compute eigenvector components of the current c fields.
DArray< CField< D > > const & cc () const
 Get all eigenvector components of the current c fields.
CField< D > const & cc (int a) const
 Get one eigenvector component of the current c fields.
bool hasCc () const
 Are eigen-components of current c fields valid ?
Functional Derivatives of H[W]
void computeDc ()
 Compute functional derivatives of the Hamiltonian.
DArray< CField< D > > const & dc () const
 Get all of the current d fields.
CField< D > const & dc (int i) const
 Get one eigenvector component of the current d fields.
bool hasDc () const
 Are the current d fields valid ?
Miscellaneous
System< D > & system ()
 Get parent system by reference.
Randomrandom ()
 Get random number generator by reference.
bool hasStep () const
 Does this Simulator have a Step object?
Step< D > & step ()
 Get the Step by 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.
BeginreadBegin (std::istream &in, const char *label, bool isRequired=true)
 Add and read a class label and opening bracket.
EndreadEnd (std::istream &in)
 Add and read the closing bracket.
BlankreadBlank (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.
BeginaddBegin (const char *label)
 Add a Begin object representing a class name and bracket.
EndaddEnd ()
 Add a closing bracket.
BlankaddBlank ()
 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 ?

Additional Inherited Members

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.
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.
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.

Detailed Description

template<int D>
class Pscf::Cpc::Simulator< D >

Simulator for complex Langevin field theoretic simulation.

The Simulator class provides functions to compute and diagonalze a pairwise interction matrix, functions to access components of several types of fields in a basis of eigenvectors of the interaction matrix, and functions to compute and return contributions to the field theoretic Hamiltonian.

The analyzeU function constructs and diagonalizes the interaction matrix U. The computeWc, computeCc and computeDc functions 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 M 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.

Definition at line 50 of file cpc/fts/Simulator.h.

Constructor & Destructor Documentation

◆ Simulator()

template<int D>
Pscf::Cpc::Simulator< D >::Simulator ( System< D > & system)

Constructor.

Parameters
systemparent System

Definition at line 46 of file cpc/fts/Simulator.tpp.

References Util::ParamComposite::setClassName(), and system().

◆ ~Simulator()

template<int D>
Pscf::Cpc::Simulator< D >::~Simulator ( )

Destructor.

Definition at line 82 of file cpc/fts/Simulator.tpp.

Member Function Documentation

◆ allocate()

template<int D>
void Pscf::Cpc::Simulator< D >::allocate ( )

Allocate required memory.

Values of nMonomer and the mesh dimensions must be defined in Mixture and Domain members of the parent System on entry. This function must be called by the readParameters method of any subclass.

Definition at line 101 of file cpc/fts/Simulator.tpp.

References system(), and UTIL_CHECK.

◆ readParameters()

template<int D>
void Pscf::Cpc::Simulator< D >::readParameters ( std::istream & in)
virtual

Read parameters for a simulation.

Parameters
ininput parameter stream

Reimplemented from Util::ParamComposite.

Definition at line 131 of file cpc/fts/Simulator.tpp.

References Util::ParamComposite::className(), Util::ParamComponent::echo(), Util::Log::file(), hasStep(), Util::ParamComponent::indent(), and Util::ParamComposite::readParamCompositeOptional().

◆ simulate()

template<int D>
void Pscf::Cpc::Simulator< D >::simulate ( int nStep)
virtual

Perform a complex Langevin field theoretic simulation.

The default implemention is a do-nothing placeholder that throws an error if called, and must be re-implemented by subclasses. A do-nothing placeholder is provided to make this a concrete class simplify unit testing.

Parameters
nStepnumber of simulation steps

Definition at line 187 of file cpc/fts/Simulator.tpp.

References UTIL_THROW.

◆ clearData()

template<int D>
void Pscf::Cpc::Simulator< D >::clearData ( )

Clear field eigen-components and hamiltonian components.

On return from this function, hasHamiltonian(), hasWc(), hasCc(), and hasDc() all return false.

Definition at line 353 of file cpc/fts/Simulator.tpp.

◆ outputTimers()

template<int D>
virtual void Pscf::Cpc::Simulator< D >::outputTimers ( std::ostream & out) const
virtual

Output timing results.

Empty default implementation.

Parameters
outoutput stream

◆ clearTimers()

template<int D>
virtual void Pscf::Cpc::Simulator< D >::clearTimers ( )
virtual

Clear timers.

Empty default implementation.

◆ iStep()

template<int D>
long Pscf::Cpc::Simulator< D >::iStep ( )
inline

Return the current converged simulation step index.

Definition at line 797 of file cpc/fts/Simulator.h.

◆ iTotalStep()

template<int D>
long Pscf::Cpc::Simulator< D >::iTotalStep ( )
inline

Return the current simulation step index.

Definition at line 802 of file cpc/fts/Simulator.h.

◆ analyzeInteraction()

template<int D>
void Pscf::Cpc::Simulator< D >::analyzeInteraction ( )

Perform eigenvalue analysis of the interaction matrix U.

Uses data obtained from the Interaction member of the parent System.

Definition at line 451 of file cpc/fts/Simulator.tpp.

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

◆ u()

template<int D>
DMatrix< double > const & Pscf::Cpc::Simulator< D >::u ( ) const
inline

Get the interaction matrix U by const reference.

Definition at line 694 of file cpc/fts/Simulator.h.

◆ evals()

template<int D>
DArray< double > const & Pscf::Cpc::Simulator< D >::evals ( ) const
inline

Get an array of the eigenvalues of the interaction matrix U.

Definition at line 699 of file cpc/fts/Simulator.h.

◆ eval()

template<int D>
double Pscf::Cpc::Simulator< D >::eval ( int i) const
inline

Get a single eigenvalue of the interaction matrix.

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

Definition at line 704 of file cpc/fts/Simulator.h.

◆ isPositiveEval()

template<int D>
bool Pscf::Cpc::Simulator< D >::isPositiveEval ( int i) const

Is the associated eigenvalue of U positive?

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

◆ evecs() [1/2]

template<int D>
DMatrix< double > const & Pscf::Cpc::Simulator< D >::evecs ( ) const
inline

Get the matrix of all eigenvectors of the interaction matrix.

This function returns the entire nMonomer x nMonomer matrix of the eigenvectors of the interaction 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 709 of file cpc/fts/Simulator.h.

◆ evecs() [2/2]

template<int D>
double Pscf::Cpc::Simulator< D >::evecs ( int a,
int i ) const
inline

Get one element of an eigenvector of the interaction matrix.

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

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

Definition at line 714 of file cpc/fts/Simulator.h.

◆ computeHamiltonian()

◆ hamiltonian()

template<int D>
std::complex< double > Pscf::Cpc::Simulator< D >::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).

Definition at line 721 of file cpc/fts/Simulator.h.

References UTIL_CHECK.

◆ idealHamiltonian()

template<int D>
std::complex< double > Pscf::Cpc::Simulator< D >::idealHamiltonian ( ) const
inline

Get ideal gas contribution to the Hamiltonian.

Definition at line 729 of file cpc/fts/Simulator.h.

References UTIL_CHECK.

◆ fieldHamiltonian()

template<int D>
std::complex< double > Pscf::Cpc::Simulator< D >::fieldHamiltonian ( ) const
inline

Get the quadratic field contribution to the Hamiltonian.

Definition at line 737 of file cpc/fts/Simulator.h.

References UTIL_CHECK.

◆ hasHamiltonian()

template<int D>
bool Pscf::Cpc::Simulator< D >::hasHamiltonian ( ) const
inline

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

Definition at line 745 of file cpc/fts/Simulator.h.

◆ computeWc()

template<int D>
void Pscf::Cpc::Simulator< D >::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 interaction 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 interaction matrix, and M = nMonomer.

Definition at line 543 of file cpc/fts/Simulator.tpp.

References Pscf::addEq(), Pscf::assign(), Pscf::mul(), Util::product(), system(), and UTIL_CHECK.

Referenced by computeDc().

◆ wc() [1/2]

template<int D>
DArray< CField< D > > const & Pscf::Cpc::Simulator< D >::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 752 of file cpc/fts/Simulator.h.

◆ wc() [2/2]

template<int D>
CField< D > const & Pscf::Cpc::Simulator< D >::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 757 of file cpc/fts/Simulator.h.

◆ hasWc()

template<int D>
bool Pscf::Cpc::Simulator< D >::hasWc ( ) const
inline

Are eigen-components of current w fields valid ?

Definition at line 762 of file cpc/fts/Simulator.h.

◆ computeCc()

template<int D>
void Pscf::Cpc::Simulator< D >::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 interaction matrix.

Definition at line 586 of file cpc/fts/Simulator.tpp.

References Pscf::addEq(), Pscf::assign(), Pscf::mul(), Util::product(), system(), and UTIL_CHECK.

Referenced by computeDc().

◆ cc() [1/2]

template<int D>
DArray< CField< D > > const & Pscf::Cpc::Simulator< D >::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 interaction 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 767 of file cpc/fts/Simulator.h.

◆ cc() [2/2]

template<int D>
CField< D > const & Pscf::Cpc::Simulator< D >::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 772 of file cpc/fts/Simulator.h.

◆ hasCc()

template<int D>
bool Pscf::Cpc::Simulator< D >::hasCc ( ) const
inline

Are eigen-components of current c fields valid ?

Definition at line 777 of file cpc/fts/Simulator.h.

◆ computeDc()

template<int D>
void Pscf::Cpc::Simulator< D >::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).

Definition at line 630 of file cpc/fts/Simulator.tpp.

References Pscf::addEq(), computeCc(), computeWc(), Pscf::mul(), system(), and UTIL_CHECK.

◆ dc() [1/2]

template<int D>
DArray< CField< D > > const & Pscf::Cpc::Simulator< D >::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 function wc(a).

Definition at line 782 of file cpc/fts/Simulator.h.

◆ dc() [2/2]

template<int D>
CField< D > const & Pscf::Cpc::Simulator< D >::dc ( int i) const
inline

Get one eigenvector component of the current d fields.

Parameters
ieigenvector / eigenvalue index

Definition at line 787 of file cpc/fts/Simulator.h.

◆ hasDc()

template<int D>
bool Pscf::Cpc::Simulator< D >::hasDc ( ) const
inline

Are the current d fields valid ?

Definition at line 792 of file cpc/fts/Simulator.h.

◆ system()

template<int D>
System< D > & Pscf::Cpc::Simulator< D >::system ( )
inline

Get parent system by reference.

Definition at line 650 of file cpc/fts/Simulator.h.

References UTIL_ASSERT.

Referenced by allocate(), analyzeInteraction(), computeCc(), computeDc(), computeHamiltonian(), computeWc(), and Simulator().

◆ random()

template<int D>
Random & Pscf::Cpc::Simulator< D >::random ( )
inline

Get random number generator by reference.

Definition at line 658 of file cpc/fts/Simulator.h.

◆ hasStep()

template<int D>
bool Pscf::Cpc::Simulator< D >::hasStep ( ) const
inline

Does this Simulator have a Step object?

Definition at line 663 of file cpc/fts/Simulator.h.

Referenced by readParameters(), and step().

◆ step()

template<int D>
Step< D > & Pscf::Cpc::Simulator< D >::step ( )
inline

Get the Step by reference.

Definition at line 668 of file cpc/fts/Simulator.h.

References hasStep(), and UTIL_CHECK.


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