PSCF v1.5.0
FilmFieldGenExt_c.h
1#ifndef RP_EXT_GEN_FILM_C_H
2#define RP_EXT_GEN_FILM_C_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/cpp/CPT.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
45 template <int D>
47 : public FilmFieldGenExtBase<D>
48 {
49
50 public:
51
56
63
68
86 double stress(int paramId) const;
87
94
95 protected:
96
100 void compute();
101
106
110 System<D,CPT> const & system() const;
111
115 std::string systemSpaceGroup() const;
116
122 RealVec<D> systemLatticeVector(int id) const;
123
127 int systemNMonomer() const;
128
133
134 private:
135
137 System<D,CPT>* sysPtr_;
138
140 double interfaceThickness_;
141
142 };
143
144 // Inline member functions
145
146 // Get parent System by non-const reference.
147 template <int D> inline
150 {
151 UTIL_CHECK(sysPtr_);
152 return *sysPtr_;
153 }
154
155 // Get parent System by const reference.
156 template <int D> inline
157 System<D,CPT> const &
159 {
160 UTIL_CHECK(sysPtr_);
161 return *sysPtr_;
162 }
163
164 // Explicit instantiation declarations
165 extern template class FilmFieldGenExt<1,CPT>;
166 extern template class FilmFieldGenExt<2,CPT>;
167 extern template class FilmFieldGenExt<3,CPT>;
168
169} // namespace Rp
170} // namespace Pscf
171
172#endif
Backend identifier class for the C++ serial CPU backend.
Definition CPT.h:32
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.
int systemNMonomer() const
Get the number of monomer species for this system.
RealVec< D > systemLatticeVector(int id) const
Get one of the lattice vectors for this system.
void compute()
Compute the fields and store where the System can access.
System< D, CPT > & system()
Get the parent System by non-const reference.
double stress(int paramId) const
Get contribution to the stress from the external fields.
std::string systemSpaceGroup() const
Get the space group name for this system.
Base class template for classes that represent a 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
Code for programs that simulate real-valued periodic fields.
Definition param_pc.dox:2
PSCF package top-level namespace.