PSCF v1.3
FilmFieldGenMaskBase.h
1#ifndef PRDC_FILM_MASK_FG_BASE_H
2#define PRDC_FILM_MASK_FG_BASE_H
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 <prdc/environment/FieldGenerator.h> // Base class
12#include <prdc/crystal/UnitCell.h> // Function parameter
13#include <pscf/math/RealVec.h> // container
14#include <iostream>
15#include <string>
16
17namespace Pscf {
18namespace Prdc {
19
20 using namespace Util;
21
38 template <int D>
40 {
41
42 public:
43
48
53
59 void readParameters(std::istream& in);
60
64 bool needsUpdate() const;
65
72 void checkCompatibility();
73
77 int normalVecId() const;
78
82 double interfaceThickness() const;
83
87 double excludedThickness() const;
88
92 double fBulk() const;
93
97 bool hasFBulk() const;
98
112 virtual double stress(int paramId) const = 0;
113
134 virtual double modifyStress(int paramId, double stress) const = 0;
135
136 protected:
137
141 virtual void compute() = 0;
142
146 void checkSpaceGroup() const;
147
158
185 UnitCell<D> const & cell) const;
186
200 virtual void setFlexibleParams() const = 0;
201
205 virtual std::string systemSpaceGroup() const = 0;
206
212 virtual RealVec<D> systemLatticeVector(int id) const = 0;
213
224
226 double fBulk_;
227
230
231 private:
232
234 int normalVecId_;
235
237 double interfaceThickness_;
238
240 double excludedThickness_;
241
243 bool hasFBulk_;
244
246
247 };
248
249 // Inline member functions
250
251 // Get value of normalVecId.
252 template <int D>
254 { return normalVecId_; }
255
256 // Get value of interfaceThickness.
257 template <int D>
259 { return interfaceThickness_; }
260
261 // Get value of excludedThickness.
262 template <int D>
264 { return excludedThickness_; }
265
266 // Get value of fBulk.
267 template <int D>
268 inline double FilmFieldGenMaskBase<D>::fBulk() const
269 { return fBulk_; }
270
271 // Check whether a value of fBulk was provided.
272 template <int D>
274 { return hasFBulk_; }
275
276 #ifndef PRDC_MASK_GEN_FILM_BASE_TPP
277 // Suppress implicit instantiation
278 extern template class FilmFieldGenMaskBase<1>;
279 extern template class FilmFieldGenMaskBase<2>;
280 extern template class FilmFieldGenMaskBase<3>;
281 #endif
282
283}
284}
285#endif
Type type_
Type of field (Mask, External, or None).
Base class Field Generator for thin-film masks.
RealVec< D > normalVecCurrent_
The lattice vector normal to the film used to generate these fields.
virtual std::string systemSpaceGroup() const =0
Get the space group name for this system.
double fBulk() const
Get value of fBulk.
int normalVecId() const
Get value of normalVecId.
double fBulk_
Reference free energy used to calculate stress normal to the film.
bool hasFBulk() const
Check whether a value of fBulk was provided.
FSArray< bool, 6 > modifyFlexibleParams(FSArray< bool, 6 > current, UnitCell< D > const &cell) const
Modifies a flexibleParams array to be compatible with this mask.
void checkSpaceGroup() const
Check that space group is compatible with the mask.
void readParameters(std::istream &in)
Read parameter file block and initialize.
double interfaceThickness() const
Get value of interfaceThickness.
double excludedThickness() const
Get value of excludedThickness.
void checkCompatibility()
Check that the system is compatible with this field.
bool needsUpdate() const
Check whether system has changed such that the field needs updating.
virtual RealVec< D > systemLatticeVector(int id) const =0
Get one of the lattice vectors for this system.
virtual double modifyStress(int paramId, double stress) const =0
Modify stress value in direction normal to the film.
virtual void compute()=0
Compute the field and store where the System can access.
void checkLatticeVectors() const
Check that lattice vectors are compatible with thin film constraint.
virtual void setFlexibleParams() const =0
Sets iterator's flexibleParams array to be compatible with the mask.
virtual double stress(int paramId) const =0
Get contribution to the stress from this mask.
Base template for UnitCell<D> classes, D=1, 2 or 3.
Definition UnitCell.h:56
A RealVec<D, T> is D-component vector with elements of floating type T.
Definition RealVec.h:28
A fixed capacity (static) contiguous array with a variable logical size.
Definition FSArray.h:38
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.
ScalarParam< Type > & readOptional(std::istream &in, const char *label, Type &value)
Add and read a new optional ScalarParam < Type > object.
Periodic fields and crystallography.
Definition CField.cpp:11
PSCF package top-level namespace.
Definition param_pc.dox:1