PSCF v1.3
rpc/environment/FilmFieldGenExt.h
1#ifndef RPC_EXT_GEN_FILM_H
2#define RPC_EXT_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/FilmFieldGenExtBase.h> // Base class
13
14namespace Pscf {
15namespace Rpc {
16
17 using namespace Util;
18 using namespace Pscf::Prdc;
19
37 template <int D>
39 {
40
41 public:
42
47
54
59
72 double stress(int paramId) const;
73
80
81 protected:
82
86 void compute();
87
91 System<D> & system();
92
96 System<D> const & system() const;
97
101 std::string systemSpaceGroup() const;
102
108 RealVec<D> systemLatticeVector(int id) const;
109
113 int systemNMonomer() const;
114
119
120 private:
121
123 System<D>* sysPtr_;
124
126 double interfaceThickness_;
127
128 };
129
130 // Inline member functions
131
132 // Get parent System by non-const reference.
133 template <int D>
135 {
136 UTIL_CHECK(sysPtr_);
137 return *sysPtr_;
138 }
139
140 // Get parent System by const reference.
141 template <int D>
143 {
144 UTIL_CHECK(sysPtr_);
145 return *sysPtr_;
146 }
147
148 // Get space group name for this system.
149 template <int D>
150 inline std::string FilmFieldGenExt<D>::systemSpaceGroup() const
151 { return system().domain().groupName(); }
152
153 // Get one of the lattice vectors for this system.
154 template <int D>
156 { return system().domain().unitCell().rBasis(id); }
157
158 // Get the number of monomer species for this system.
159 template <int D>
161 { return system().mixture().nMonomer(); }
162
163 #ifndef RPC_EXT_GEN_FILM_TPP
164 extern template class FilmFieldGenExt<1>;
165 extern template class FilmFieldGenExt<2>;
166 extern template class FilmFieldGenExt<3>;
167 #endif
168
169} // namespace Rpc
170} // namespace Pscf
171
172#endif
DArray< double > chiTopCurrent_
The chiTop array used to generate the current external fields.
DArray< double > const & chiTop() const
Get const chiTop array by reference.
DArray< double > chiBottomCurrent_
The chiBottom array used to generate the current external fields.
double excludedThickness() const
Get value of excludedThickness.
DArray< double > const & chiBottom() const
Get const chiBottom matrix by reference.
bool isAthermal() const
Are the walls athermal?
double interfaceThickness() const
Get value of interfaceThickness.
RealVec< D > normalVecCurrent_
The lattice vector normal to the film used to generate these fields.
int normalVecId() const
Get value of normalVecId.
A RealVec<D, T> is D-component vector with elements of floating type T.
Definition RealVec.h:28
Field Generator for external fields in thin-film systems.
double stress(int paramId) const
Get contribution to the stress from the external fields.
System< D > & system()
Get the parent System by non-const reference.
void compute()
Compute the fields and store where the System can access.
int systemNMonomer() const
Get the number of monomer species for this system.
std::string systemSpaceGroup() const
Get the space group name for this system.
RealVec< D > systemLatticeVector(int id) const
Get one of the lattice vectors for this system.
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