PSCF v1.5.0
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 - 2026, David Morse (morse012@um.edu) and co-authors
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 aliases
112
116 using PropagatorT = QT;
117
121 using FieldT = FT;
122
123 // Public member functions
124
125 // Protected constructor and destructor (see below).
126
132 virtual void setKuhn(double kuhn);
133
143 QT& propagator(int directionId);
144
154 QT const & propagator(int directionId) const;
155
159 FT const & cField() const;
160
164 double kuhn() const;
165
166 protected:
167
172
176 ~BlockTmpl() = default;
177
181 FT& cField();
182
183 private:
184
186 DArray<QT> propagators_;
187
189 FT cField_;
190
192 double kuhn_;
193
194 };
195
196 // Inline member functions
197
198 /*
199 * Get a Propagator indexed by direction.
200 */
201 template <class QT, class FT>
202 inline
203 QT& BlockTmpl<QT,FT>::propagator(int directionId)
204 { return propagators_[directionId]; }
205
206 /*
207 * Get a const Propagator indexed by direction.
208 */
209 template <class QT, class FT>
210 inline
211 QT const & BlockTmpl<QT,FT>::propagator(int directionId) const
212 { return propagators_[directionId]; }
213
214 /*
215 * Get the monomer concentration field (non-const reference).
216 */
217 template <class QT, class FT> inline
219 { return cField_; }
220
221 /*
222 * Get the monomer concentration field (const reference).
223 */
224 template <class QT, class FT> inline
225 FT const & BlockTmpl<QT,FT>::cField() const
226 { return cField_; }
227
228 /*
229 * Get the monomer statistical segment length.
230 */
231 template <class QT, class FT> inline
233 { return kuhn_; }
234
235}
236#endif
~BlockTmpl()=default
Destructor.
QT PropagatorT
Modified diffusion equation solver (propagator) type.
Definition BlockTmpl.h:116
FT const & cField() const
Get the associated monomer concentration field (const reference).
Definition BlockTmpl.h:225
FT FieldT
Field type.
Definition BlockTmpl.h:121
virtual void setKuhn(double kuhn)
Set monomer statistical segment length.
Definition BlockTmpl.tpp:35
QT & propagator(int directionId)
Get a Propagator for a specified direction (non-const reference).
Definition BlockTmpl.h:203
QT const & propagator(int directionId) const
Get a Propagator for a specified direction (const reference).
Definition BlockTmpl.h:211
BlockTmpl()
Constructor.
Definition BlockTmpl.tpp:19
FT & cField()
Get associated monomer concentration field (non-const reference).
Definition BlockTmpl.h:218
Edge()
Constructor.
Definition Edge.cpp:18
Dynamically allocatable contiguous array template.
Definition DArray.h:32
PSCF package top-level namespace.