PSCF v1.1
pspg/field/RFieldComparison.h
1#ifndef PSPG_R_FIELD_COMPARISON_H
2#define PSPG_R_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 <pscf/math/FieldComparison.h>
12#include "RDField.h"
13
14namespace Pscf {
15namespace Pspg {
16
17 using namespace Util;
18
24 template <int D>
26 {
27 public:
28
33
40 double compare(RDField<D> const& a, RDField<D> const& b);
41
48 double
49 compare(DArray<RDField<D>> const& a, DArray<RDField<D>> const& b);
50
54 double maxDiff() const
55 { return fieldComparison_.maxDiff(); }
56
60 double rmsDiff() const
61 { return fieldComparison_.rmsDiff(); }
62
63 private:
64
65 // True if a comparison has been made, false otherwise.
66 bool compared_;
67
68 // Composition usage of FieldComparison, rather than inheritance.
69 FieldComparison< DArray< cudaReal > > fieldComparison_;
70
71 };
72
73 #ifndef PSPG_R_FIELD_COMPARISON_TPP
74 extern template class RFieldComparison<1>;
75 extern template class RFieldComparison<2>;
76 extern template class RFieldComparison<3>;
77 #endif
78
79} // namespace Pspg
80} // namespace Pscf
81#endif
Comparison of element-by-element differences between field arrays.
Field of real single precision values on an FFT mesh on a device.
Definition: RDField.h:34
Comparator for fields in real-space (r-grid) format.
double compare(RDField< D > const &a, RDField< D > const &b)
Comparator for individual fields.
double rmsDiff() const
Get precomputed rms difference.
double maxDiff() const
Get precomputed maximum element-by-element difference.
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