PSCF v1.3
rpc/environment/FilmFieldGenMask.h
1#ifndef RPC_MASK_GEN_FILM_H
2#define RPC_MASK_GEN_FILM_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 <rpc/system/System.h>
12#include <prdc/environment/FilmFieldGenMaskBase.h> // Base class
13
14namespace Pscf {
15namespace Rpc {
16
17 using namespace Util;
18 using namespace Pscf::Prdc;
19
33 template <int D>
35 {
36
37 public:
38
43
50
55
68 double stress(int paramId) const;
69
86 double modifyStress(int paramId, double stress) const;
87
92
93 protected:
94
98 void compute();
99
103 void setFlexibleParams() const;
104
108 System<D>& system();
109
113 System<D> const & system() const;
114
118 std::string systemSpaceGroup() const;
119
125 RealVec<D> systemLatticeVector(int id) const;
126
131
132 private:
133
135 System<D>* sysPtr_;
136
137 };
138
139 // Inline member functions
140
141 // Get parent System by non-const reference.
142 template <int D>
144 {
145 UTIL_CHECK(sysPtr_);
146 return *sysPtr_;
147 }
148
149 // Get parent System by const reference.
150 template <int D>
152 {
153 UTIL_CHECK(sysPtr_);
154 return *sysPtr_;
155 }
156
157 // Get space group name for this system.
158 template <int D>
159 inline std::string FilmFieldGenMask<D>::systemSpaceGroup() const
160 { return system().domain().groupName(); }
161
162 // Get one of the lattice vectors for this system.
163 template <int D>
165 { return system().domain().unitCell().rBasis(id); }
166
167 #ifndef RPC_MASK_GEN_FILM_TPP
168 extern template class FilmFieldGenMask<1>;
169 extern template class FilmFieldGenMask<2>;
170 extern template class FilmFieldGenMask<3>;
171 #endif
172
173} // namespace Rpc
174} // namespace Pscf
175
176#endif
RealVec< D > normalVecCurrent_
The lattice vector normal to the film used to generate these fields.
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.
double interfaceThickness() const
Get value of interfaceThickness.
double excludedThickness() const
Get value of excludedThickness.
A RealVec<D, T> is D-component vector with elements of floating type T.
Definition RealVec.h:28
Field Generator for thin-film masks.
std::string systemSpaceGroup() const
Get the space group name for this system.
void setFlexibleParams() const
Modifies iterator().flexibleParams_ to be compatible with the mask.
double modifyStress(int paramId, double stress) const
Modify stress value in direction normal to the film.
RealVec< D > systemLatticeVector(int id) const
Get one of the lattice vectors for this system.
System< D > & system()
Get the parent System by non-const reference.
double stress(int paramId) const
Get contribution to the stress from this mask.
void compute()
Compute the field and store where the System can access.
Main class, representing one complete system.
void setClassName(const char *className)
Set class name string.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Definition global.h:68
Periodic fields and crystallography.
Definition CField.cpp:11
Real periodic fields, SCFT and PS-FTS (CPU).
Definition param_pc.dox:2
PSCF package top-level namespace.
Definition param_pc.dox:1