PSCF v1.4.0
fts/simulator/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 - 2025, The Regents of the University of Minnesota
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
14namespace Pscf {
15namespace Rp {
16
17 using namespace Util;
18
41 template <int D, class FT>
42 struct SimState
43 {
44
45 public:
46
47 // Public data members
48
56
65
74
82
85
88
91
94
96 bool needsCc;
97
99 bool needsDc;
100
103
106
109
110 // Public member function
111
118 void allocate(int nMonomer, IntVec<D> const & dimensions);
119
120 protected:
121
125 SimState();
126
130 ~SimState() = default;
131
132 };
133
134}
135}
136#endif
An IntVec<D, T> is a D-component vector of elements of integer type T.
Definition IntVec.h:27
Dynamically allocatable contiguous array template.
Definition DArray.h:32
Class templates for real-valued periodic fields.
PSCF package top-level namespace.
DArray< FT > w
Chemical potential fields, r-grid format, indexed by monomer.
DArray< FT > cc
Eigenvector components of c fields on a real space grid.
bool needsCc
True iff cc fields need to be saved.
DArray< FT > wc
Chemical potential fields, r-grid format, indexed by eigenvector.
double idealHamiltonian
Ideal gas contribution to Hamiltonian.
~SimState()=default
Destructor.
bool hasData
Does this object currently store data?
double fieldHamiltonian
Quadratic field contribution to Hamiltonian value.
double perturbationHamiltonian
Perturbation to Hamiltonian value (if any).
DArray< FT > dc
Functional derivatives of the Hamiltonian on a real space grid.
void allocate(int nMonomer, IntVec< D > const &dimensions)
Allocate memory for stored fields.
Definition SimState.tpp:38
bool isAllocated
Has memory been allocated for the fields?
bool needsHamiltonian
True iff Hamiltonian components need to be saved.
SimState()
Constructor.
Definition SimState.tpp:21
double hamiltonian
Field theoretic Hamiltonian value (total).
bool needsDc
True iff dc fields need to be saved.