PSCF v1.1
FieldComparison.h
1#ifndef PSCF_FIELD_COMPARISON_H
2#define PSCF_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
13namespace Pscf {
14
15 using namespace Util;
16
26 template <class FT>
28
29 public:
30
38 FieldComparison(int begin = 0);
39
40 // Use compiler defined destructor and assignment operator.
41
52 double compare(FT const& a, FT const& b);
53
68 double compare(DArray<FT> const& a, DArray<FT> const& b);
69
76 double maxDiff() const
77 { return maxDiff_; }
78
85 double rmsDiff() const
86 { return rmsDiff_; }
87
88 protected:
89
90 // Maximum element-by-element difference.
91 double maxDiff_;
92
93 // Room-mean-squared element-by-element difference.
94 double rmsDiff_;
95
96 // Index of first element (0 or 1)
97 int begin_;
98
99 };
100
101} // namespace Pscf
102#include "FieldComparison.tpp"
103#endif
Comparison of element-by-element differences between field arrays.
double rmsDiff() const
Return the precomputed root-mean-squared difference.
double compare(FT const &a, FT const &b)
Compare individual fields.
double maxDiff() const
Return the 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