PSCF v1.3
rpc/field/Mask.h
1#ifndef RPC_MASK_H
2#define RPC_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/cpu/RField.h> // parent class template parameter
13#include <prdc/field/MaskReal.h> // parent class
14
15namespace Pscf {
16namespace Rpc {
17
18 using namespace Util;
19
30 template <int D>
31 class Mask : public Prdc::MaskReal<D, Prdc::Cpu::RField<D>, FieldIo<D> >
32 {
33
34 public:
35
38
39 // Inherited public member functions
40 using Base::setFieldIo;
43 using Base::setBasis;
44 using Base::setRGrid;
45 using Base::readBasis;
46 using Base::readRGrid;
47 using Base::basis;
48 using Base::rgrid;
49 using Base::phiTot;
52 using Base::hasData;
54
55 protected:
56
57 // Inherited protected member functions
59 using Base::meshSize;
60 using Base::nBasis;
61 using Base::fieldIo;
62
66 double rGridAverage() const override;
67
68 };
69
70 #ifndef RPC_MASK_TPP
71 extern template class Mask<1>;
72 extern template class Mask<2>;
73 extern template class Mask<3>;
74 #endif
75
76} // namespace Rpc
77
78#ifndef RPC_MASK_TPP
79namespace Prdc {
80 extern template class MaskReal< 1, Cpu::RField<1>, Rpc::FieldIo<1> >;
81 extern template class MaskReal< 2, Cpu::RField<2>, Rpc::FieldIo<2> >;
82 extern template class MaskReal< 3, Cpu::RField<3>, Rpc::FieldIo<3> >;
83}
84#endif
85
86} // namespace Pscf
87#endif
Container for a field to which the total density is constrained.
Definition MaskReal.h:84
void setRGrid(Prdc::Cpu::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 density is constrained.
Prdc::MaskReal< D, Prdc::Cpu::RField< D >, FieldIo< D > > Base
Base class typedef.
double rGridAverage() const override
Calculate the average value of the rgrid_ member.
Periodic fields and crystallography.
Definition CField.cpp:11
Real periodic fields, SCFT and PS-FTS (CPU).
Definition param_pc.dox:2
PSCF package top-level namespace.
Definition param_pc.dox:1