PSCF v1.5.0
FieldGeneratorBase.h
1#ifndef PSCF_FIELD_GENERATOR_BASE_H
2#define PSCF_FIELD_GENERATOR_BASE_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 <util/param/ParamComposite.h> // base class
12#include <pscf/sweep/ParameterModifier.h> // base class
13
14namespace Pscf {
15
16 using namespace Util;
17
39 {
40
41 public:
42
46 enum Type {Mask, External, None};
47
52
57
68 void generate();
69
73 virtual bool needsUpdate() const = 0;
74
83 virtual void checkCompatibility() = 0;
84
90 Type type() const;
91
116 bool isDependent() const;
117
118 protected:
119
123 virtual void compute() = 0;
124
132
135
136 };
137
138 // Inline member functions
139
140 // Return Type enumeration value (Mask, External, or None)
143
144 // Is this object dependent on parameters of another FieldGeneratorBase?
146 { return isDependent_; }
147
148}
149#endif
Base class for objects that generate fields for a MixAndMatchEnv.
Type type_
Type of field (Mask, External, or None).
virtual void checkCompatibility()=0
Check that the system is compatible with these fields.
Type
Enum representing the type of field (mask, external field, or none).
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.
bool isDependent() const
Is this object dependent on parameters of another FieldGeneratorBase?
Type type() const
Return Type enumeration value (Mask, External, or None).
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?
ParamComposite()
Constructor.
PSCF package top-level namespace.