OpenLB 1.8.1
Loading...
Searching...
No Matches
superLatticeTimeAveraged3D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2018 Mathias J. Krause, Benedict Hasenauer
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24#ifndef SUPER_LATTICE_TIME_AVERAGED_F3_D_H
25#define SUPER_LATTICE_TIME_AVERAGED_F3_D_H
26
27#include <vector>
28
30
31namespace olb {
32
33
34// Averages a functor value about a timespan and gives back the averaged value(TA)
35// and in 3*Dim the root mean square value(RMS) of the functorvalue in Dim in the operator
36// TA = SUM(functorvalue(iT)/SUM(iT))
37// RMS = SQRT( SUM( (functorvalue(iT) - TA)^2 / SUM(iT) ) )
38template <typename T>
40protected:
45
46 SuperData<3,T,T> _sDataHelp; // for Kahan summation
47 SuperData<3,T,T> _sDataP2help; // for Kahan summation
48
49public:
51
52 bool operator() (T output[], const int input[]);
53
54 void addEnsemble();
55
56 int getEnsembles();
57 int getBlockFSize() const;
58
59};
60
61template <typename T>
63protected:
68
69 SuperData<3,T,T> _sDataHelp; // for Kahan summation
70 SuperData<3,T,T> _sDataP2help; // for Kahan summation
71
72public:
74
75 bool operator() (T output[], const int input[]);
76
77 void addEnsemble();
78
79 int getEnsembles();
80 int getBlockFSize() const;
81
82};
83
84// The functor calculates the crosscorrelation(CC) of two functorvalues averaged above the Time
85// CC = SUM((functorM[iT] - functorMAverage)*(functorN[iT] - functorNAverage))
86// the dimesion of the functor is the product of the given functor dimensions
87// the output if the functor M and N have two dimesnions is {m0*n0,m0*n1,m1*n0,m1*n0}
88template <typename T>
90private:
91 int _ensembles;
92 SuperF3D<T,T>& _sFunctorM;
93 SuperF3D<T,T>& _sFunctorN;
94 SuperData<3,T, T> _sDataM;
95 SuperData<3,T, T> _sDataN;
96 SuperData<3,T, T> _sDataMN;
97
98 // for Kahan summation
99 SuperData<3,T,T> _sDataMhelp;
100 SuperData<3,T,T> _sDataNhelp;
101 SuperData<3,T,T> _sDataMNhelp;
102
103public:
105
106 bool operator() (T output[], const int input[]);
107
108 void addEnsemble();
109
110};
111
112}
113
114#endif
represents all functors that operate on a SuperStructure<T,3> in general
Definition aliases.h:184
SuperLatticeTimeAveragedCrossCorrelationF3D(SuperF3D< T, T > &sFunctorM, SuperF3D< T, T > &sFunctorN)
SuperLatticeTimeAveragedF3D(SuperF3D< T, T > &sFunctor)
bool operator()(T output[], const int input[])
SuperLatticeTimeAveragedMagnitudesF3D(SuperF3D< T, T > &sFunctor)
Top level namespace for all of OpenLB.