PSCF v1.2
cuda/CFieldComparison.h
1#ifndef PRDC_CUDA_C_FIELD_COMPARISON_H
2#define PRDC_CUDA_C_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 <prdc/cuda/CField.h>
12#include <util/containers/DArray.h>
13
14namespace Pscf {
15namespace Prdc {
16namespace Cuda {
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(CField<D> const & a, CField<D> const & b);
50
65 double compare(DArray< CField<D> > const & a,
66 DArray< CField<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 PRDC_CUDA_C_FIELD_COMPARISON_TPP
97 // Suppress implicit instantiation
98 extern template class CFieldComparison<1>;
99 extern template class CFieldComparison<2>;
100 extern template class CFieldComparison<3>;
101 #endif
102
103
104} // namespace Prdc::Cuda
105} // namespace Prdc
106} // namespace Pscf
107#endif
Comparator for CField (k-grid) arrays.
Field of complex double precision values on an FFT mesh.
Definition cpu/CField.h:30
double rmsDiff() const
Return the precomputed root-mean-squared difference.
double compare(CField< D > const &a, CField< D > const &b)
Compare individual fields.
double compare(DArray< CField< D > > const &a, DArray< CField< D > > const &b)
Compare arrays of fields associated with different monomer types.
double maxDiff() const
Return the precomputed maximum element-by-element difference.
CFieldComparison()
Default constructor.
Dynamically allocatable contiguous array template.
PSCF package top-level namespace.
Definition param_pc.dox:1
Utility classes for scientific computation.