PSCF v1.4.0
rpg/field/WFields.h
1#ifndef RPG_W_FIELDS_H
2#define RPG_W_FIELDS_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/field/WFields.h> // base class template
12#include <prdc/cuda/RField.h> // base class member
13
14namespace Pscf {
15namespace Rpg {
16
17 // Forward declaration
18 template <int D> class FieldIo;
19
20 using namespace Util;
21 using namespace Prdc;
22 using namespace Prdc::Cuda;
23
35 template <int D>
36 class WFields
37 : public Rp::WFields<D, RField<D>, FieldIo<D> >
38 {
39
40 public:
41
42 WFields() = default;
43 virtual ~WFields() = default;
44
53 void setRGrid(DeviceArray<cudaReal>& fields);
54
57
58 // Declaration to avoid hiding overloaded base class method
60
61 };
62
63} // namespace Rpg
64} // namespace Pscf
65
66// Explicit instantiation declarations
67namespace Pscf {
68 namespace Rp {
69 using namespace Prdc::Cuda;
70 extern template class WFields<1, RField<1>, Rpg::FieldIo<1> >;
71 extern template class WFields<2, RField<2>, Rpg::FieldIo<2> >;
72 extern template class WFields<3, RField<3>, Rpg::FieldIo<3> >;
73 }
74 namespace Rpg {
75 extern template class WFields<1>;
76 extern template class WFields<2>;
77 extern template class WFields<3>;
78 }
79}
80#endif
Dynamic array on the GPU device with aligned data.
Definition DeviceArray.h:96
A container of w fields stored in both basis and r-grid format.
void setRGrid(DArray< RField< D > > const &fields, bool isSymmetric=false)
File input/output operations and format conversions for fields.
A container of fields stored in both basis and r-grid format.
void setRGrid(DeviceArray< cudaReal > &fields)
Set new w fields, in unfolded real-space (r-grid) format.
Definition WFields.cu:27
Rp::WFields< D, RField< D >, FieldIo< D > > RpWFields
Alias for base class.
Periodic fields and crystallography.
Definition complex.cpp:11
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.