OpenLB 1.7
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
29
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>
39class SuperLatticeTimeAveragedF3D final: public SuperF3D<T,T> {
40private:
41 int _ensembles;
42 SuperF3D<T,T>& _sFunctor;
43 SuperData<3,T, T> _sData;
44 SuperData<3,T, T> _sDataP2;
45
46public:
48
49 bool operator() (T output[], const int input[]);
50
51 void addEnsemble();
52
53 int getEnsembles();
54 int getBlockFSize() const;
55
56};
57
58template <typename T>
60private:
61 int _ensembles;
62 SuperF3D<T,T>& _sFunctor;
63 SuperData<3,T, T> _sData;
64 SuperData<3,T, T> _sDataP2;
65
66public:
68
69 bool operator() (T output[], const int input[]);
70
71 void addEnsemble();
72
73 int getEnsembles();
74 int getBlockFSize() const;
75
76};
77
78// The functor calculates the crosscorrelation(CC) of two functorvalues averaged above the Time
79// CC = SUM((functorM[iT] - functorMAverage)*(functorN[iT] - functorNAverage))
80// the dimesion of the functor is the product of the given functor dimensions
81// the output if the functor M and N have two dimesnions is {m0*n0,m0*n1,m1*n0,m1*n0}
82template <typename T>
84private:
85 int _ensembles;
86 SuperF3D<T,T>& _sFunctorM;
87 SuperF3D<T,T>& _sFunctorN;
88 SuperData<3,T, T> _sDataM;
89 SuperData<3,T, T> _sDataN;
90 SuperData<3,T, T> _sDataMN;
91
92public:
94
95 bool operator() (T output[], const int input[]);
96
97 void addEnsemble();
98
99};
100template <typename T>
102private:
103 SuperF3D<T,T>&_sFunctorM;
104 SuperF3D<T,T>&_sFunctorN;
105 SuperGeometry<T,3>& _sGeometry;
106 int _material;
107
108public:
109 SuperLatticeTimeAveraged3DL2Norm(SuperF3D<T,T>& sFunctorM,SuperF3D<T,T>& sFunctorN,SuperGeometry<T,3>& sGeometry,int material);
110
111 bool operator() (T output[], const int input[]);
112
113};
114}
115
116#endif
represents all functors that operate on a SuperStructure<T,3> in general
Representation of a statistic for a parallel 2D geometry.
bool operator()(T output[], const int input[])
SuperLatticeTimeAveraged3DL2Norm(SuperF3D< T, T > &sFunctorM, SuperF3D< T, T > &sFunctorN, SuperGeometry< T, 3 > &sGeometry, int material)
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.