PSCF v1.4.0
rpg/solvers/Propagator.h
1#ifndef RPG_PROPAGATOR_H
2#define RPG_PROPAGATOR_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 <rp/solvers/Propagator.h> // base class template
12#include <rpg/system/Types.h> // base class template argument
13#include <pscf/cuda/DeviceArray.h> // member
14
15namespace Pscf {
16namespace Rpg {
17
18 using namespace Util;
19 using namespace Pscf::Prdc;
20
34 template <int D>
35 class Propagator : public Rp::Propagator< D, Types<D> >
36 {
37
38 public:
39
40 // Member functions
41
45 Propagator();
46
51
66 void allocate(int ns, const Mesh<D>& mesh) override;
67
79 void reallocate(int ns) override;
80
85
86 protected:
87
90
91 // Inherited typename alias
92 using typename RpPropagatorT::PropagatorTmplT;
93
98
99 private:
100
114 DeviceArray<cudaReal> qFieldsAll_;
115
119 void dissociateQFields();
120
121 };
122
123 // Inline function
124
125 /*
126 * Return the full array of q-fields.
127 */
128 template <int D> inline
130 {
132 return qFieldsAll_;
133 }
134
135} // namespace Rpg
136} // namespace Pscf
137
138// Explicit instantiation declarations
139namespace Pscf {
140 namespace Rp {
141 extern template class Propagator<1, Rpg::Types<1> >;
142 extern template class Propagator<2, Rpg::Types<2> >;
143 extern template class Propagator<3, Rpg::Types<3> >;
144 }
145 namespace Rpg {
146 extern template class Propagator<1>;
147 extern template class Propagator<2>;
148 extern template class Propagator<3>;
149 }
150}
151#endif
Dynamic array on the GPU device with aligned data.
Definition DeviceArray.h:96
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?
MDE solver for one direction of one block.
Mesh< D > const & mesh() const
PropagatorTmpl< typename Types< D >::Propagator > PropagatorTmplT
DArray< typename Types< D >::RField > qFields_
MDE solver for one direction of one block.
DeviceArray< cudaReal > 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:77
Rp::Propagator< D, Types< D > > RpPropagatorT
Direct base class.
Propagator()
Constructor.
Definition Propagator.cu:28
void allocate(int ns, const Mesh< D > &mesh) override
Allocate memory used by this propagator.
Definition Propagator.cu:53
~Propagator()
Destructor.
Definition Propagator.cu:36
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Definition global.h:68
Periodic fields and crystallography.
Definition complex.cpp:11
Class templates for real-valued periodic fields.
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.