PSCF v1.1
pspc/field/KFieldComparison.h
1#ifndef PSPC_K_FIELD_COMPARISON_H
2#define PSPC_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 <pspc/field/RFieldDft.h>
13
14namespace Pscf {
15namespace Pspc {
16
17 using namespace Util;
18
24 template <int D>
26
27 public:
28
35
36 // Use compiler defined destructor and assignment operator.
37
48 double compare(RFieldDft<D> const& a, RFieldDft<D> const& b);
49
64 double compare(DArray<RFieldDft<D> > const& a,
65 DArray<RFieldDft<D> > const& b);
66
73 double maxDiff() const
74 { return maxDiff_; }
75
82 double rmsDiff() const
83 { return rmsDiff_; }
84
85 private:
86
87 // Maximum element-by-element difference.
88 double maxDiff_;
89
90 // Room-mean-squared element-by-element difference.
91 double rmsDiff_;
92
93 };
94
95 #ifndef PSPC_K_FIELD_COMPARISON_TPP
96 // Suppress implicit instantiation
97 extern template class KFieldComparison<1>;
98 extern template class KFieldComparison<2>;
99 extern template class KFieldComparison<3>;
100 #endif
101
102
103} // namespace Pspc
104} // namespace Pscf
105#endif
Comparator for RFieldDft (k-grid) arrays.
double rmsDiff() const
Return the precomputed root-mean-squared difference.
double maxDiff() const
Return the precomputed maximum element-by-element difference.
double compare(RFieldDft< D > const &a, RFieldDft< D > const &b)
Compare individual fields.
Fourier transform of a real field on an FFT mesh.
Definition: RFieldDft.h:31
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