PSCF v1.5.0
Propagator_u.h
1#ifndef RP_PROPAGATOR_U_H
2#define RP_PROPAGATOR_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/solvers/PropagatorBase.h> // base class template
12#include <pscf/backend/cuda/CUT.h> // template argument
13#include <pscf/backend/cuda/BackendArray.h> // member
14
15namespace Pscf {
16namespace Rp {
17
18 using namespace Util;
19
20 // Declare primary template
21 template <int D, class T> class Propagator;
22
30 template <int D>
31 class Propagator<D,CUT> : public PropagatorBase<D,CUT>
32 {
33
34 public:
35
36 // Member functions
37
41 Propagator();
42
47
62 void allocate(int ns, const Mesh<D>& mesh) override;
63
75 void reallocate(int ns) override;
76
81
82 protected:
83
86
87 // Inherited typename alias
89
94
95 private:
96
110 BackendArray<cudaReal,CUT> qFieldsAll_;
111
115 void dissociateQFields();
116
117 };
118
119 // Inline function
120
121 /*
122 * Return the full array of q-fields.
123 */
124 template <int D> inline
126 {
128 return qFieldsAll_;
129 }
130
131} // namespace Rp
132} // namespace Pscf
133
134// Explicit instantiation declarations
135namespace Pscf {
136 namespace Rp {
137 extern template class PropagatorBase<1,CUT>;
138 extern template class PropagatorBase<2,CUT>;
139 extern template class PropagatorBase<3,CUT>;
140 extern template class Propagator<1,CUT>;
141 extern template class Propagator<2,CUT>;
142 extern template class Propagator<3,CUT>;
143 }
144}
145#endif
Backend identifier class for the GPU-enabled CUDA backend.
Definition CUT.h:31
Description of a regular grid of points in a periodic domain.
Definition Mesh.h:61
bool isSolved() const
Has the modified diffusion equation been solved?
DArray< RField< D, CUT > > qFields_
Mesh< D > const & mesh() const
PropagatorTmpl< Propagator< D, CUT > > PropagatorTmplT
PropagatorBase< D, CUT > PropagatorBaseT
Direct base class.
BackendArray< cudaReal, CUT > const & qAll()
Return the full array of q-fields as an unrolled 1D array.
void reallocate(int ns) override
Reallocate memory used by this propagator.
Definition Propagator.cu:72
void allocate(int ns, const Mesh< D > &mesh) override
Allocate memory used by this propagator.
Definition Propagator.cu:48
#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.