PSCF v1.2
ExtGenFilmBase.h
1#ifndef PRDC_EXT_GEN_FILM_BASE_H
2#define PRDC_EXT_GEN_FILM_BASE_H
3
4/*
5* PSCF - Polymer Self-Consistent Field Theory
6*
7* Copyright 2016 - 2022, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <pscf/sweep/ParameterType.h> // Return type of method
12#include <pscf/iterator/FieldGenerator.h> // Base class
13#include <pscf/math/RealVec.h> // Container
14#include <util/containers/DArray.h> // Container
15#include <string>
16
17
18
19namespace Pscf {
20namespace Prdc {
21
22 using namespace Util;
23
41 template <int D>
43 {
44
45 public:
46
51
56
62 void readParameters(std::istream& in);
63
76 void checkCompatibility();
77
81 bool updateNeeded() const;
82
88 bool hasSymmetricWalls() const;
89
95 bool isAthermal() const;
96
104
116 void setParameter(std::string name, DArray<int> ids, double value,
117 bool& success);
118
129 double getParameter(std::string name, DArray<int> ids, bool& success)
130 const;
131
135 DArray<double> const & chiBottom() const;
136
140 DArray<double> const & chiTop() const;
141
147 double chiBottom(int s) const;
148
154 double chiTop(int s) const;
155
159 int normalVecId() const;
160
164 double interfaceThickness() const;
165
169 double excludedThickness() const;
170
174 bool isGenerated() const = 0;
175
190 virtual double stressTerm(int paramId) const = 0;
191
192 using ParameterModifier::setParameter; // overloaded method
193 using ParameterModifier::getParameter; // overloaded method
194
195 protected:
196
200 virtual void allocate() = 0;
201
205 virtual void generate() = 0;
206
210 virtual std::string systemSpaceGroup() const = 0;
211
217 virtual RealVec<D> systemLatticeVector(int id) const = 0;
218
222 virtual int systemNMonomer() const = 0;
223
234
245
256
259
260 private:
261
263 int normalVecId_;
264
266 double interfaceThickness_;
267
269 double excludedThickness_;
270
276 DArray<double> chiBottom_;
277
283 DArray<double> chiTop_;
284
285 };
286
287 // Inline member functions
288
289 // Get chiBottom array by const reference
290 template <int D>
292 { return chiBottom_; }
293
294 // Get chiTop array by const reference
295 template <int D>
297 { return chiTop_; }
298
299 // Get the chi parameter between the bottom wall and species s
300 template <int D>
301 inline double ExtGenFilmBase<D>::chiBottom(int s) const
302 { return chiBottom_[s]; }
303
304 // Get the chi parameter between the top wall and species s
305 template <int D>
306 inline double ExtGenFilmBase<D>::chiTop(int s) const
307 { return chiTop_[s]; }
308
309 // Get value of normalVecId.
310 template <int D>
312 { return normalVecId_; }
313
314 // Get value of interfaceThickness.
315 template <int D>
317 { return interfaceThickness_; }
318
319 // Get value of excludedThickness.
320 template <int D>
322 { return excludedThickness_; }
323
324}
325}
326
327#include "ExtGenFilmBase.tpp"
328#endif
Abstract base class for objects that generate fields for ImposedFields.
bool isDependent_
Is this object dependent on the parameters of another FieldGenerator?
Type type_
Type of field (Mask, External, Both, or None)
virtual void setParameter(std::string name, DArray< int > ids, double value, bool &success)
Set the value of a specialized sweep parameter.
virtual double getParameter(std::string name, DArray< int > ids, bool &success) const
Get the value of a specialized sweep parameter.
Base class defining external fields for thin film systems.
double excludedThickness() const
Get value of excludedThickness.
bool isAthermal() const
Are the walls athermal?
int normalVecId() const
Get value of normalVecId.
GArray< ParameterType > getParameterTypes()
Return specialized sweep parameter types to add to the Sweep object.
bool updateNeeded() const
Check whether system has changed such that the fields needs updating.
bool isGenerated() const =0
Check whether the fields have been generated.
virtual RealVec< D > systemLatticeVector(int id) const =0
Get one of the lattice vectors for this system.
virtual double stressTerm(int paramId) const =0
Get contribution to the stress from these external fields.
virtual void generate()=0
Generate the fields and store where the Iterator can access.
virtual int systemNMonomer() const =0
Get the number of monomer species for this system.
DArray< double > chiBottomCurrent_
The chiBottom array used to generate the current external fields.
void checkCompatibility()
Check that the system is compatible with these fields.
virtual void allocate()=0
Allocate container necessary to generate and store fields.
RealVec< D > normalVecCurrent_
The lattice vector normal to the film used to generate these fields.
DArray< double > const & chiTop() const
Get const chiTop array by reference.
bool hasSymmetricWalls() const
Are the walls chemically identical?
void setParameter(std::string name, DArray< int > ids, double value, bool &success)
Set the value of a specialized sweep parameter.
DArray< double > chiTopCurrent_
The chiTop array used to generate the current external fields.
virtual std::string systemSpaceGroup() const =0
Get the space group name for this system.
double interfaceThickness() const
Get value of interfaceThickness.
void readParameters(std::istream &in)
Read and initialize.
double getParameter(std::string name, DArray< int > ids, bool &success) const
Get the value of a specialized sweep parameter.
DArray< double > const & chiBottom() const
Get const chiBottom matrix by reference.
A RealVec<D, T> is D-component vector with elements of floating type T.
Definition RealVec.h:28
Dynamically allocatable contiguous array template.
An automatically growable array, analogous to a std::vector.
Definition GArray.h:34
PSCF package top-level namespace.
Definition param_pc.dox:1
Utility classes for scientific computation.