PSCF v1.4.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 - 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 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
152 QT const & propagator(int directionId) const;
153
157 FT& cField();
158
162 FT const & cField() const;
163
167 double kuhn() const;
168
169 protected:
170
175
179 ~BlockTmpl() = default;
180
181 private:
182
184 DArray<QT> propagators_;
185
187 FT cField_;
188
190 double kuhn_;
191
192 };
193
194 // Inline member functions
195
196 /*
197 * Get a Propagator indexed by direction.
198 */
199 template <class QT, class FT>
200 inline
201 QT& BlockTmpl<QT,FT>::propagator(int directionId)
202 { return propagators_[directionId]; }
203
204 /*
205 * Get a const Propagator indexed by direction.
206 */
207 template <class QT, class FT>
208 inline
209 QT const & BlockTmpl<QT,FT>::propagator(int directionId) const
210 { return propagators_[directionId]; }
211
212 /*
213 * Get the monomer concentration field.
214 */
215 template <class QT, class FT> inline
217 { return cField_; }
218
219 /*
220 * Get the const monomer concentration field.
221 */
222 template <class QT, class FT> inline
223 FT const & BlockTmpl<QT,FT>::cField() const
224 { return cField_; }
225
226 /*
227 * Get the monomer statistical segment length.
228 */
229 template <class QT, class FT> inline
231 { return kuhn_; }
232
233}
234#endif
~BlockTmpl()=default
Destructor.
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:223
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.
Definition BlockTmpl.h:201
QT const & propagator(int directionId) const
Get a const Propagator for a specified direction.
Definition BlockTmpl.h:209
BlockTmpl()
Constructor.
Definition BlockTmpl.tpp:19
FT & cField()
Get the associated monomer concentration field.
Definition BlockTmpl.h:216
Edge()
Constructor.
Definition Edge.cpp:16
Dynamically allocatable contiguous array template.
Definition DArray.h:32
PSCF package top-level namespace.