PSCF v1.4.0
cpu/CFieldComparison.h
1#ifndef PRDC_CPU_C_FIELD_COMPARISON_H
2#define PRDC_CPU_C_FIELD_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 CField;
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(CField<D> const& a, CField<D> const& b);
59
74 double compare(DArray<CField<D> > const& a,
75 DArray<CField<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 CFieldComparison<1>;
107 extern template class CFieldComparison<2>;
108 extern template class CFieldComparison<3>;
109
110
111} // namespace Cpu
112} // namespace Prdc
113} // namespace Pscf
114#endif
double compare(CField< D > const &a, CField< D > const &b)
Compare individual fields.
double rmsDiff() const
Return the precomputed root-mean-squared difference.
double maxDiff() const
Return the precomputed maximum element-by-element difference.
Field of complex double precision values on an FFT mesh.
Definition cpu/CField.h:29
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.