PSCF v1.3.3
BlockTmpl.h
1#ifndef PSCF_BLOCK_TMPL_H
2#define PSCF_BLOCK_TMPL_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 <pscf/chem/Edge.h> // base class
12#include <util/containers/DArray.h> // member
13
14namespace Pscf {
15
16 using namespace Util;
17
105 template <class QT, class FT>
106 class BlockTmpl : public Edge
107 {
108
109 public:
110
111 // Public typename alias
112
116 using PropagatorT = QT;
117
121 using FieldT = FT;
122
123 // Public member functions
124
129
133 virtual ~BlockTmpl();
134
140 virtual void setKuhn(double kuhn);
141
151 QT& propagator(int directionId);
152
160 QT const & propagator(int directionId) const;
161
165 FT& cField();
166
170 FT const & cField() const;
171
175 double kuhn() const;
176
177 private:
178
180 DArray<QT> propagators_;
181
183 FT cField_;
184
186 double kuhn_;
187
188 };
189
190 // Inline member functions
191
192 /*
193 * Get a Propagator indexed by direction.
194 */
195 template <class QT, class FT>
196 inline
197 QT& BlockTmpl<QT,FT>::propagator(int directionId)
198 { return propagators_[directionId]; }
199
200 /*
201 * Get a const Propagator indexed by direction.
202 */
203 template <class QT, class FT>
204 inline
205 QT const & BlockTmpl<QT,FT>::propagator(int directionId) const
206 { return propagators_[directionId]; }
207
208 /*
209 * Get the monomer concentration field.
210 */
211 template <class QT, class FT> inline
213 { return cField_; }
214
215 /*
216 * Get the const monomer concentration field.
217 */
218 template <class QT, class FT> inline
219 FT const & BlockTmpl<QT,FT>::cField() const
220 { return cField_; }
221
222 /*
223 * Get the monomer statistical segment length.
224 */
225 template <class QT, class FT> inline
227 { return kuhn_; }
228
229}
230#endif
QT PropagatorT
Modified diffusion equation solver (propagator) type.
Definition BlockTmpl.h:116
FT const & cField() const
Get the associated const monomer concentration field.
Definition BlockTmpl.h:219
FT FieldT
Field type.
Definition BlockTmpl.h:121
virtual void setKuhn(double kuhn)
Set monomer statistical segment length.
Definition BlockTmpl.tpp:42
virtual ~BlockTmpl()
Destructor.
Definition BlockTmpl.tpp:35
QT & propagator(int directionId)
Get a Propagator for a specified direction.
Definition BlockTmpl.h:197
QT const & propagator(int directionId) const
Get a const Propagator for a specified direction.
Definition BlockTmpl.h:205
BlockTmpl()
Constructor.
Definition BlockTmpl.tpp:19
FT & cField()
Get the associated monomer concentration field.
Definition BlockTmpl.h:212
Edge()
Constructor.
Definition Edge.cpp:16
Dynamically allocatable contiguous array template.
Definition DArray.h:32
PSCF package top-level namespace.