PSCF v1.5.0
BasisFieldState.h
1#ifndef RP_BASIS_FIELD_STATE_H
2#define RP_BASIS_FIELD_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/fieldIo/FieldState.h> // base class
12#include <pscf/backend/TmplDeclare.h> // preprocessor macros
13
14#include <string>
15
16// Forward declarations
17namespace Pscf {
18 namespace Rp {
19 template <int D, class T> class FieldIo;
20 template <int D, class T> class System;
21 }
22}
23
24namespace Pscf {
25namespace Rp {
26
27 using namespace Util;
28
39 template <int D, class T>
41 : public FieldState<D, DArray<double>, System<D,T> >
42 {
43 public:
44
49
56
57 ~BasisFieldState() = default;
58
64 void allocate();
65
71 void read(const std::string & filename);
72
78 void write(const std::string & filename);
79
85 void getSystemState();
86
92 void setSystemState(bool newCellParams);
93
94 using FieldStateT = FieldState<D, DArray<double>, System<D,T> >;
95
96 // Inherited member functions
101
102 private:
103
104 using FieldIoT = FieldIo<D,T>;
105
106 };
107
108 // Explicit instantation declarations
109 PSCF_TMPL_DECLARE(BasisFieldState)
110
111} // namespace Rp
112} // namespace Pscf
113
114#endif
const DArray< double > & field(int monomerId) const
FieldState for fields in symmetry-adapted basis format.
BasisFieldState()
Default constructor.
void write(const std::string &filename)
Write state to file.
void getSystemState()
Store the current state of the associated system.
void allocate()
Allocate all fields.
void read(const std::string &filename)
Read state from file.
void setSystemState(bool newCellParams)
Set the state of the associated system to this state.
System< D, T > & system()
Get associated System by reference.
File input/output, format conversions and other utilities for fields.
Base class template for classes that represent a complete system.
Code for programs that simulate real-valued periodic fields.
Definition param_pc.dox:2
PSCF package top-level namespace.