PSCF v1.3
rpg/fts/simulator/SimState.h
1#ifndef RPG_SIM_STATE_H
2#define RPG_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
12#include <prdc/cuda/RField.h> // memmber
13#include <util/containers/DArray.h>
14
15namespace Pscf {
16namespace Rpg {
17
18 using namespace Util;
19 using namespace Pscf::Prdc::Cuda;
20
26 template <int D>
27 struct SimState
28 {
29 public:
30
34 SimState();
35
39 ~SimState();
40
47 void allocate(int nMonomer, IntVec<D> const & dimensions);
48
53
62
70
79
82
85
88
91
93 bool needsCc;
94
96 bool needsDc;
97
100
103
106
107 };
108
109 #ifndef RPG_SIM_STATE_TPP
110 // Suppress implicit instantiation
111 extern template struct SimState<1>;
112 extern template struct SimState<2>;
113 extern template struct SimState<3>;
114 #endif
115
116}
117}
118#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
Fields, FFTs, and utilities for periodic boundary conditions (CUDA)
Definition Reduce.cpp:14
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.
Definition param_pc.dox:1
SimState stores the state used by an fts simulation.
bool needsDc
If dc fields needs to be saved.
bool isAllocated
Has memory be allocated for the w field?
double hamiltonian
Monte-Carlo Hamiltonian value.
double perturbationHamiltonian
Perturbation to Hamiltonian value (if any).
bool needsHamiltonian
If hamiltonian needs to be saved.
double fieldHamiltonian
Monte-Carlo field part contribution to Hamiltonian value.
DArray< RField< D > > cc
Eigenvector components of c fields on a real space grid.
DArray< RField< D > > wc
Chemical potential fields, r-grid format, indexed by eigenvector.
void allocate(int nMonomer, IntVec< D > const &dimensions)
Allocate memory for fields.
double idealHamiltonian
Monte-Carlo ideal gas contribution to Hamiltonian value.
DArray< RField< D > > w
Chemical potential fields, r-grid format, indexed by monomer.
DArray< RField< D > > dc
Components of functional derivatives of the Hamiltonian fields on a real space grid.
bool hasData
Is this struct being used to store data?
bool needsCc
If cc fields needs to be saved.