PSCF v1.3.3
rpg/scft/sweep/FieldState.tpp
1#ifndef RPG_FIELD_STATE_TPP
2#define RPG_FIELD_STATE_TPP
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 "FieldState.h"
12
13#include <rpg/system/System.h>
14#include <prdc/crystal/Basis.h>
15#include <pscf/mesh/Mesh.h>
16#include <prdc/cuda/FFT.h>
17#include <util/misc/FileMaster.h>
18
19namespace Pscf {
20namespace Rpg {
21
22 using namespace Util;
23 using namespace Pscf::Prdc;
24
25 /*
26 * Constructor.
27 */
28 template <int D, class FT>
30 : fields_(),
31 unitCell_(),
32 systemPtr_(nullptr)
33 {}
34
35 /*
36 * Constructor.
37 */
38 template <int D, class FT>
40 : fields_(),
41 unitCell_(),
42 systemPtr_(0)
43 { setSystem(system); }
44
45 /*
46 * Destructor.
47 */
48 template <int D, class FT>
51
52 /*
53 * Set association with system, after default construction.
54 */
55 template <int D, class FT>
57 {
58 if (hasSystem()) {
59 UTIL_CHECK(systemPtr_ = &system);
60 } else {
61 systemPtr_ = &system;
62 }
63 }
64
65} // namespace Rpg
66} // namespace Pscf
67#endif
bool hasSystem()
Has a system been set?
System< D > & system()
Get associated System by reference.
void setSystem(System< D > &system)
Set association with System, after default construction.
Main class, representing a complete physical system.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Definition global.h:68
Periodic fields and crystallography.
Definition CField.cpp:11
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.