PSCF v1.3.1
rpg/field/Mask.h
1#ifndef RPG_MASK_H
2#define RPG_MASK_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 "FieldIo.h" // parent class template parameter
12#include <prdc/cuda/RField.h> // parent class template parameter
13#include <prdc/field/MaskTmpl.h> // parent class
14
15namespace Pscf {
16namespace Rpg {
17
18 using namespace Util;
19 using namespace Prdc;
20
31 template <int D>
32 class Mask
33 : public Prdc::MaskTmpl< D, Cuda::RField<D>, FieldIo<D> >
34 {
35
36 public:
37
40
41 // Inherited public member functions
42 using Base::setFieldIo;
45 using Base::setBasis;
46 using Base::setRGrid;
47 using Base::readBasis;
48 using Base::readRGrid;
49 using Base::writeBasis;
50 using Base::writeRGrid;
51 using Base::basis;
52 using Base::rgrid;
53 using Base::phiTot;
56 using Base::hasData;
58
59 protected:
60
62 using Base::meshSize;
63 using Base::nBasis;
64 using Base::fieldIo;
65
69 double rGridAverage() const override;
70
71 };
72
73 // Explicit instantiation declarations
74 extern template class Mask<1>;
75 extern template class Mask<2>;
76 extern template class Mask<3>;
77
78} // namespace Rpg
79
80namespace Prdc {
81 // Explicit instantiation declarations for base class template
82 extern template class MaskTmpl< 1, Cuda::RField<1>, Rpg::FieldIo<1> >;
83 extern template class MaskTmpl< 2, Cuda::RField<2>, Rpg::FieldIo<2> >;
84 extern template class MaskTmpl< 3, Cuda::RField<3>, Rpg::FieldIo<3> >;
85}
86
87} // namespace Pscf
88#endif
Container for a field to which the total density is constrained.
Definition MaskTmpl.h:84
void setRGrid(Prdc::Cuda::RField< D > const &field, bool isSymmetric=false)
void readRGrid(std::istream &in, bool isSymmetric=false)
File input/output operations and format conversions for fields.
A field to which the total monomer concentration is constrained.
double rGridAverage() const override
Calculate the average value of the rgrid_ member.
Prdc::MaskTmpl< D, Prdc::Cuda::RField< D >, FieldIo< D > > Base
Base class typedef.
Periodic fields and crystallography.
Definition CField.cpp:11
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.
Definition param_pc.dox:1