PSCF v1.1
pspg/field/KFieldComparison.h
1#ifndef PSPG_K_FIELD_COMPARISON_H
2#define PSPG_K_FIELD_COMPARISON_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 <util/containers/DArray.h>
12#include <pspg/field/RDFieldDft.h>
13#include <pspg/math/GpuResources.h>
14
15namespace Pscf {
16namespace Pspg {
17
18 using namespace Util;
19
25 template <int D>
27
28 public:
29
36
37 // Use compiler defined destructor and assignment operator.
38
49 double compare(RDFieldDft<D> const& a, RDFieldDft<D> const& b);
50
65 double compare(DArray<RDFieldDft<D> > const& a,
66 DArray<RDFieldDft<D> > const& b);
67
74 double maxDiff() const
75 { return maxDiff_; }
76
83 double rmsDiff() const
84 { return rmsDiff_; }
85
86 private:
87
88 // Maximum element-by-element difference.
89 double maxDiff_;
90
91 // Room-mean-squared element-by-element difference.
92 double rmsDiff_;
93
94 };
95
96 #ifndef PSPG_K_FIELD_COMPARISON_TPP
97 // Suppress implicit instantiation
98 extern template class KFieldComparison<1>;
99 extern template class KFieldComparison<2>;
100 extern template class KFieldComparison<3>;
101 #endif
102
103
104} // namespace Pspg
105} // namespace Pscf
106#endif
Comparator for RDFieldDft (k-grid) arrays.
double rmsDiff() const
Return the precomputed root-mean-squared difference.
double compare(RDFieldDft< D > const &a, RDFieldDft< D > const &b)
Compare individual fields.
double maxDiff() const
Return the precomputed maximum element-by-element difference.
Discrete Fourier Transform (DFT) of a real field on an FFT mesh.
Definition: RDFieldDft.h:35
Dynamically allocatable contiguous array template.
Definition: DArray.h:32
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1