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

SimState stores the state used by a FTS simulation. More...

#include <SimState.h>

Public Member Functions

 SimState ()
 Constructor.
 ~SimState ()=default
 Destructor.
void allocate (int nMonomer, IntVec< D > const &dimensions)
 Allocate memory for stored fields.

Public Attributes

DArray< RField< D, T > > w
 Chemical potential fields, r-grid format, indexed by monomer.
DArray< RField< D, T > > wc
 Chemical potential fields, r-grid format, indexed by eigenvector.
DArray< RField< D, T > > cc
 Eigenvector components of c fields on a real space grid.
DArray< RField< D, T > > dc
 Functional derivatives of the Hamiltonian on a real space grid.
double hamiltonian
 Field theoretic Hamiltonian value (total).
double idealHamiltonian
 Ideal gas contribution to Hamiltonian.
double fieldHamiltonian
 Quadratic field contribution to Hamiltonian value.
double perturbationHamiltonian
 Perturbation to Hamiltonian value (if any).
bool needsCc
 True iff cc fields need to be saved.
bool needsDc
 True iff dc fields need to be saved.
bool needsHamiltonian
 True iff Hamiltonian components need to be saved.
bool hasData
 Does this object currently store data?
bool isAllocated
 Has memory been allocated for the fields?

Detailed Description

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

SimState stores the state used by a FTS simulation.

This class is used to restore the state of FTS simulation after an attempted MC move or BD step is rejected or fails to converge. It is used in Monte Carlo (MC) simulations to restore the state after a rejected move. It is also used less frequently in Brownian dynamics (BD) simulations to restore the previous state if the compressor algorithm (the search for a partial saddle point) fails to converge after an attempted unconstrained BD step.

Template parameters:

  • D : dimension of space
  • T : backend type class (e.g. (CPT or CUT))

Definition at line 43 of file SimState.h.

Constructor & Destructor Documentation

◆ SimState()

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

Constructor.

Definition at line 23 of file SimState.tpp.

References fieldHamiltonian, hamiltonian, hasData, idealHamiltonian, isAllocated, needsCc, needsDc, needsHamiltonian, w, and wc.

◆ ~SimState()

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

Destructor.

References allocate().

Member Function Documentation

◆ allocate()

template<int D, class T>
void Pscf::Rp::SimState< D, T >::allocate ( int nMonomer,
IntVec< D > const & dimensions )

Allocate memory for stored fields.

Parameters
nMonomernumber of monomer types
dimensionsdimensions of discretization grid

Definition at line 40 of file SimState.tpp.

References cc, needsCc, w, and wc.

Referenced by ~SimState().

Member Data Documentation

◆ w

template<int D, class T>
DArray< RField<D,T> > Pscf::Rp::SimState< D, T >::w

Chemical potential fields, r-grid format, indexed by monomer.

Field w[i] is the chemical potential field for monomer type i, for i = 0, ..., nMonomer - 1.

Definition at line 78 of file SimState.h.

Referenced by allocate(), and SimState().

◆ wc

template<int D, class T>
DArray< RField<D,T> > Pscf::Rp::SimState< D, T >::wc

Chemical potential fields, r-grid format, indexed by eigenvector.

Field wc[i] is a pointwise projection of the w fields onto eigenvector number i of the projected chi matrix. for values i = 0, ..., nMonomer - 1.

Definition at line 87 of file SimState.h.

Referenced by allocate(), and SimState().

◆ cc

template<int D, class T>
DArray< RField<D,T> > Pscf::Rp::SimState< D, T >::cc

Eigenvector components of c fields on a real space grid.

Field cc[i] is a point-wise projection of the c fields onto eigenvector number i of the projected chi matrix , for values i = 0, ..., nMonomer - 1.

Definition at line 96 of file SimState.h.

Referenced by allocate().

◆ dc

template<int D, class T>
DArray< RField<D,T> > Pscf::Rp::SimState< D, T >::dc

Functional derivatives of the Hamiltonian on a real space grid.

Field dc[i] is the functional derivative of H[W] with respect to w-field component wc[i], indexed by eigenvector index i.

Definition at line 104 of file SimState.h.

◆ hamiltonian

template<int D, class T>
double Pscf::Rp::SimState< D, T >::hamiltonian

Field theoretic Hamiltonian value (total).

Definition at line 107 of file SimState.h.

Referenced by SimState().

◆ idealHamiltonian

template<int D, class T>
double Pscf::Rp::SimState< D, T >::idealHamiltonian

Ideal gas contribution to Hamiltonian.

Definition at line 110 of file SimState.h.

Referenced by SimState().

◆ fieldHamiltonian

template<int D, class T>
double Pscf::Rp::SimState< D, T >::fieldHamiltonian

Quadratic field contribution to Hamiltonian value.

Definition at line 113 of file SimState.h.

Referenced by SimState().

◆ perturbationHamiltonian

template<int D, class T>
double Pscf::Rp::SimState< D, T >::perturbationHamiltonian

Perturbation to Hamiltonian value (if any).

Definition at line 116 of file SimState.h.

◆ needsCc

template<int D, class T>
bool Pscf::Rp::SimState< D, T >::needsCc

True iff cc fields need to be saved.

Definition at line 119 of file SimState.h.

Referenced by allocate(), and SimState().

◆ needsDc

template<int D, class T>
bool Pscf::Rp::SimState< D, T >::needsDc

True iff dc fields need to be saved.

Definition at line 122 of file SimState.h.

Referenced by SimState().

◆ needsHamiltonian

template<int D, class T>
bool Pscf::Rp::SimState< D, T >::needsHamiltonian

True iff Hamiltonian components need to be saved.

Definition at line 125 of file SimState.h.

Referenced by SimState().

◆ hasData

template<int D, class T>
bool Pscf::Rp::SimState< D, T >::hasData

Does this object currently store data?

Definition at line 128 of file SimState.h.

Referenced by SimState().

◆ isAllocated

template<int D, class T>
bool Pscf::Rp::SimState< D, T >::isAllocated

Has memory been allocated for the fields?

Definition at line 131 of file SimState.h.

Referenced by SimState().


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