PSCF v1.5.0
SimState.h
1#ifndef RP_SIM_STATE_H
2#define RP_SIM_STATE_H
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2026, David Morse (morse012@um.edu) and co-authors
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <pscf/math/IntVec.h> // template with default parameter
12#include <util/containers/DArray.h> // member
13#include <pscf/backend/TmplDeclare.h> // preprocessor macros
14
15// Forward declaration
16namespace Pscf {
17 template <int D, class T> class RField;
18}
19
20namespace Pscf {
21namespace Rp {
22
23 using namespace Util;
24
42 template <int D, class T>
44 {
45
46 public:
47
48 // Public member functions
49
53 SimState();
54
58 ~SimState() = default;
59
66 void allocate(int nMonomer, IntVec<D> const & dimensions);
67
68 // Public data members
69
70 //using FT = RField<D,T>;
71
79
88
97
105
108
111
114
117
120
123
126
129
132
133 };
134
135 // Explicit instantation declarations
136 PSCF_TMPL_DECLARE(SimState)
137
138}
139}
140#endif
An IntVec<D, T> is a D-component vector of elements of integer type T.
Definition IntVec.h:27
SimState stores the state used by a FTS simulation.
Definition SimState.h:44
double perturbationHamiltonian
Perturbation to Hamiltonian value (if any).
Definition SimState.h:116
bool needsHamiltonian
True iff Hamiltonian components need to be saved.
Definition SimState.h:125
double hamiltonian
Field theoretic Hamiltonian value (total).
Definition SimState.h:107
bool needsCc
True iff cc fields need to be saved.
Definition SimState.h:119
void allocate(int nMonomer, IntVec< D > const &dimensions)
Allocate memory for stored fields.
Definition SimState.tpp:40
bool needsDc
True iff dc fields need to be saved.
Definition SimState.h:122
~SimState()=default
Destructor.
DArray< RField< D, T > > dc
Functional derivatives of the Hamiltonian on a real space grid.
Definition SimState.h:104
double idealHamiltonian
Ideal gas contribution to Hamiltonian.
Definition SimState.h:110
DArray< RField< D, T > > cc
Eigenvector components of c fields on a real space grid.
Definition SimState.h:96
DArray< RField< D, T > > w
Chemical potential fields, r-grid format, indexed by monomer.
Definition SimState.h:78
SimState()
Constructor.
Definition SimState.tpp:23
bool hasData
Does this object currently store data?
Definition SimState.h:128
bool isAllocated
Has memory been allocated for the fields?
Definition SimState.h:131
DArray< RField< D, T > > wc
Chemical potential fields, r-grid format, indexed by eigenvector.
Definition SimState.h:87
double fieldHamiltonian
Quadratic field contribution to Hamiltonian value.
Definition SimState.h:113
Dynamically allocatable contiguous array template.
Definition DArray.h:32
Code for programs that simulate real-valued periodic fields.
Definition param_pc.dox:2
PSCF package top-level namespace.