PSCF v1.5.0
FilmFieldGenExt_u.h
1#ifndef RPG_EXT_GEN_FILM_U_H
2#define RPG_EXT_GEN_FILM_U_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 <rp/environment/FilmFieldGenExtBase.h> // base class template
12#include <pscf/backend/cuda/CUT.h> // base class argument
13#include <rp/system/System.h>
14
15// Forward declarations
16namespace Pscf {
17 namespace Rp {
18 template <int D, class T> class FilmFieldGenExt;
19 template <int D, class T> class System;
20 }
21}
22
23namespace Pscf {
24namespace Rp {
25
26 using namespace Util;
27
46 template <int D>
48 : public FilmFieldGenExtBase<D>
49 {
50
51 public:
52
57
64
69
87 double stress(int paramId) const;
88
95
96 protected:
97
101 void compute();
102
107
111 System<D,CUT> const & system() const;
112
116 std::string systemSpaceGroup() const;
117
123 RealVec<D> systemLatticeVector(int id) const;
124
128 int systemNMonomer() const;
129
134
135 private:
136
138 System<D,CUT>* sysPtr_;
139
141 double interfaceThickness_;
142
143 };
144
145 // Inline member functions
146
147 // Get parent System by non-const reference.
148 template <int D> inline
151 { return *sysPtr_; }
152
153 // Get parent System by const reference.
154 template <int D> inline
155 System<D,CUT> const &
157 { return *sysPtr_; }
158
159 // Get space group name for this system.
160 template <int D> inline
161 std::string
163 { return system().domain().groupName(); }
164
165 // Get one of the lattice vectors for this system.
166 template <int D> inline
169 { return system().domain().unitCell().rBasis(id); }
170
171 // Get the number of monomer species for this system.
172 template <int D> inline
174 { return system().mixture().nMonomer(); }
175
176 // Explicit instantiation declarations
177 extern template class FilmFieldGenExt<1,CUT>;
178 extern template class FilmFieldGenExt<2,CUT>;
179 extern template class FilmFieldGenExt<3,CUT>;
180
181} // namespace Rp
182} // namespace Pscf
183#endif
Backend identifier class for the GPU-enabled CUDA backend.
Definition CUT.h:31
A RealVec<D, T> is D-component vector with elements of floating type T.
Definition RealVec.h:28
int normalVecId() const
Get value of normalVecId.
double excludedThickness() const
Get value of excludedThickness.
bool isAthermal() const
Are the walls athermal?
RealVec< D > normalVecCurrent_
The lattice vector normal to the film used to generate these fields.
DArray< double > chiBottomCurrent_
The chiBottom array used to generate the current external fields.
double interfaceThickness() const
Get value of interfaceThickness.
DArray< double > const & chiBottom() const
Get const chiBottom matrix by reference.
DArray< double > chiTopCurrent_
The chiTop array used to generate the current external fields.
DArray< double > const & chiTop() const
Get const chiTop array by 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.
double stress(int paramId) const
Get contribution to the stress from the external fields.
RealVec< D > systemLatticeVector(int id) const
Get one of the lattice vectors for this system.
System< D, CUT > & system()
Get the System associated with this object by reference.
Base class template for classes that represent a complete system.
Domain< D, T > const & domain() const
Get the Domain (const).
void setClassName(const char *className)
Set class name string.
Code for programs that simulate real-valued periodic fields.
Definition param_pc.dox:2
PSCF package top-level namespace.