PSCF v1.3
FieldGeneratorBase.cpp
1/*
2* PSCF - Polymer Self-Consistent Field
3*
4* Copyright 2015 - 2025, The Regents of the University of Minnesota
5* Distributed under the terms of the GNU General Public License.
6*/
7
8#include "FieldGeneratorBase.h"
9
10namespace Pscf
11{
12
13 // Constructor
18
19 // Destructor
22
23 // Checks if fields need to be (re)generated. If so, generates them.
25 {
26 if (needsUpdate()) {
28 compute();
29 } else {
30 // update not needed, do nothing
31 return;
32 }
33 }
34
35}
Type type_
Type of field (Mask, External, or None).
virtual void checkCompatibility()=0
Check that the system is compatible with these fields.
void generate()
Checks if fields need to be (re)generated.
virtual void compute()=0
Compute the field(s) and store where the System can access.
virtual bool needsUpdate() const =0
Check whether system has changed such that the field(s) need updating.
bool isDependent_
Is this object dependent on parameters of another FieldGeneratorBase?
PSCF package top-level namespace.
Definition param_pc.dox:1