PSCF v1.2
rpc/field/Mask.h
1#ifndef RPC_MASK_H
2#define RPC_MASK_H
3
4/*
5* PSCF - Polymer Self-Consistent Field Theory
6*
7* Copyright 2016 - 2022, 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/MaskTmpl.h> // parent class
14
15namespace Pscf {
16namespace Rpc {
17
18 using namespace Util;
19
30 template <int D>
31 class Mask : public Prdc::MaskTmpl< D, FieldIo<D>, Prdc::Cpu::RField<D> >
32 {
33
34 public:
35
38
42 Mask();
43
47 ~Mask();
48
49 // Inherited public member functions
50 using Base::setFieldIo;
53 using Base::setBasis;
54 using Base::setRGrid;
55 using Base::readBasis;
56 using Base::readRGrid;
57 using Base::basis;
58 using Base::rgrid;
59 using Base::phiTot;
62 using Base::hasData;
64
65 protected:
66
70 double rGridAverage() const;
71
72 };
73
74 #ifndef RPC_MASK_TPP
75 extern template class Mask<1>;
76 extern template class Mask<2>;
77 extern template class Mask<3>;
78 #endif
79
80} // namespace Rpc
81
82#ifndef RPC_MASK_TPP
83namespace Prdc {
84 extern template class MaskTmpl< 1, Rpc::FieldIo<1>, Cpu::RField<1> >;
85 extern template class MaskTmpl< 2, Rpc::FieldIo<2>, Cpu::RField<2> >;
86 extern template class MaskTmpl< 3, Rpc::FieldIo<3>, Cpu::RField<3> >;
87}
88#endif
89
90} // namespace Pscf
91#endif
Field of real double precision values on an FFT mesh.
Container for a field to which the total density is constrained.
Definition MaskTmpl.h:62
void setRGrid(RField const &field, bool isSymmetric=false)
Definition MaskTmpl.tpp:106
void readRGrid(std::istream &in, UnitCell< D > &unitCell, bool isSymmetric=false)
Definition MaskTmpl.tpp:170
void readBasis(std::istream &in, UnitCell< D > &unitCell)
Definition MaskTmpl.tpp:125
A field to which the total density is constrained.
Mask()
Constructor.
Prdc::MaskTmpl< D, FieldIo< D >, Prdc::Cpu::RField< D > > Base
Base class typedef.
~Mask()
Destructor.
double rGridAverage() const
Calculate the average value of the rgrid_ member.
PSCF package top-level namespace.
Definition param_pc.dox:1
Utility classes for scientific computation.