PSCF v1.1
RField.h
1#ifndef PSPC_R_FIELD_H
2#define PSPC_R_FIELD_H
3
4/*
5* PSCF Package
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 "Field.h"
12#include <pscf/math/IntVec.h>
13#include <util/global.h>
14
15namespace Pscf {
16namespace Pspc
17{
18
19 using namespace Util;
20 using namespace Pscf;
21
27 template <int D>
28 class RField : public Field<double>
29 {
30
31 public:
32
36 RField();
37
45 RField(const RField& other);
46
52 virtual ~RField();
53
64 RField& operator = (const RField& other);
65
66 using Field<double>::allocate;
67
76
80 const IntVec<D>& meshDimensions() const;
81
88 template <class Archive>
89 void serialize(Archive& ar, const unsigned int version);
90
91 private:
92
93 // Vector containing number of grid points in each direction.
94 IntVec<D> meshDimensions_;
95
96 };
97
98 /*
99 * Return mesh dimensions by constant reference.
100 */
101 template <int D>
103 { return meshDimensions_; }
104
105 /*
106 * Serialize a Field to/from an Archive.
107 */
108 template <int D>
109 template <class Archive>
110 void RField<D>::serialize(Archive& ar, const unsigned int version)
111 {
112 Field<double>::serialize(ar, version);
113 ar & meshDimensions_;
114 }
115
116 #ifndef PSPC_R_FIELD_TPP
117 extern template class RField<1>;
118 extern template class RField<2>;
119 extern template class RField<3>;
120 #endif
121
122}
123}
124#endif
Base class template for a field defined on a spatial grid.
An IntVec<D, T> is a D-component vector of elements of integer type T.
Definition: IntVec.h:27
void serialize(Archive &ar, const unsigned int version)
Serialize a Field to/from an Archive.
Field of real double precision values on an FFT mesh.
Definition: RField.h:29
RField & operator=(const RField &other)
Assignment operator.
Definition: RField.tpp:68
const IntVec< D > & meshDimensions() const
Return mesh dimensions by constant reference.
Definition: RField.h:102
virtual ~RField()
Destructor.
Definition: RField.tpp:31
RField()
Default constructor.
Definition: RField.tpp:23
void serialize(Archive &ar, const unsigned int version)
Serialize a Field to/from an Archive.
Definition: RField.h:110
void allocate(const IntVec< D > &meshDimensions)
Allocate the underlying C array for an FFT grid.
Definition: RField.tpp:97
File containing preprocessor macros for error handling.
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1