PSCF v1.4.0
cpu/RFieldDftComparison.h
1#ifndef PRDC_CPU_R_FIELD_DFT_COMPARISON_H
2#define PRDC_CPU_R_FIELD_DFT_COMPARISON_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// Forward declarations
12namespace Util {
13 template <typename T> class DArray;
14}
15namespace Pscf {
16 namespace Prdc {
17 namespace Cpu {
18 template <int D> class RFieldDft;
19 }
20 }
21}
22
23namespace Pscf {
24namespace Prdc {
25namespace Cpu {
26
27 using namespace Util;
28
34 template <int D>
36
37 public:
38
45
46 // Use compiler defined destructor and assignment operator.
47
58 double compare(RFieldDft<D> const& a, RFieldDft<D> const& b);
59
74 double compare(DArray<RFieldDft<D> > const& a,
75 DArray<RFieldDft<D> > const& b);
76
83 double maxDiff() const
84 { return maxDiff_; }
85
92 double rmsDiff() const
93 { return rmsDiff_; }
94
95 private:
96
97 // Maximum element-by-element difference.
98 double maxDiff_;
99
100 // Room-mean-squared element-by-element difference.
101 double rmsDiff_;
102
103 };
104
105 // Explicit instantiation declarations
106 extern template class RFieldDftComparison<1>;
107 extern template class RFieldDftComparison<2>;
108 extern template class RFieldDftComparison<3>;
109
110} // namespace Cpu
111} // namespace Prdc
112} // namespace Pscf
113#endif
double compare(RFieldDft< D > const &a, RFieldDft< D > const &b)
Compare individual fields.
double maxDiff() const
Return the precomputed maximum element-by-element difference.
double rmsDiff() const
Return the precomputed root-mean-squared difference.
Fourier transform of a real field on an FFT mesh.
Dynamically allocatable contiguous array template.
Definition DArray.h:32
Fields and FFTs for periodic boundary conditions (CPU)
Definition complex.cpp:12
Periodic fields and crystallography.
Definition complex.cpp:11
PSCF package top-level namespace.
Utility classes for scientific computation.