PSCF v1.5.0
FieldGeneratorBase.cpp
1/*
2* PSCF - Polymer Self-Consistent Field
3*
4* Copyright 2015 - 2026, David Morse (morse012@um.edu) and co-authors
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 compatibility, and (re)generates the fields if needed.
25 {
26 // Check the system even if the fields need no update: a change
27 // that leaves the fields unchanged can make it incompatible
29
30 if (needsUpdate()) {
31 compute();
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 compatibility, and (re)generates the fields if needed.
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.