OpenLB 1.7
Loading...
Searching...
No Matches
superLatticeTimeAveraged2D.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_F2_D_H
25#define SUPER_LATTICE_TIME_AVERAGED_F2_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 2*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 SuperLatticeTimeAveragedF2D final: public SuperF2D<T,T> {
40private:
41 int _ensembles;
42 SuperF2D<T,T>& _sFunctor;
43 SuperData<2,T, T> _sData;
44 SuperData<2,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
58// The functor calculates the crosscorrelation(CC) of two functorvalues averaged above the Time
59// CC = SUM((functorM[iT] - functorMAverage)*(functorN[iT] - functorNAverage))
60// the dimesion of the functor is the product of the given functor dimensions
61// the output if the functor M and N have two dimesnions is {m0*n0,m0*n1,m1*n0,m1*n0}
62template <typename T>
64private:
65 int _ensembles;
66 SuperF2D<T,T>& _sFunctorM;
67 SuperF2D<T,T>& _sFunctorN;
68 SuperData<2,T, T> _sDataM;
69 SuperData<2,T, T> _sDataN;
70 SuperData<2,T, T> _sDataMN;
71
72public:
74
75 bool operator() (T output[], const int input[]);
76
77 void addEnsemble();
78
79};
80template <typename T>
82private:
83 SuperF2D<T,T>&_sFunctorM;
84 SuperF2D<T,T>&_sFunctorN;
85 SuperGeometry<T,2>& _sGeometry;
86 int _material;
87
88public:
89 SuperLatticeTimeAveraged2DL2Norm(SuperF2D<T,T>& sFunctorM,SuperF2D<T,T>& sFunctorN,SuperGeometry<T,2>& sGeometry,int material);
90
91 bool operator() (T output[], const int input[]);
92
93};
94}
95
96#endif
represents all functors that operate on a SuperStructure<T,2> in general
Representation of a statistic for a parallel 2D geometry.
bool operator()(T output[], const int input[])
SuperLatticeTimeAveraged2DL2Norm(SuperF2D< T, T > &sFunctorM, SuperF2D< T, T > &sFunctorN, SuperGeometry< T, 2 > &sGeometry, int material)
SuperLatticeTimeAveragedCrossCorrelationF2D(SuperF2D< T, T > &sFunctorM, SuperF2D< T, T > &sFunctorN)
SuperLatticeTimeAveragedF2D(SuperF2D< T, T > &sFunctor)
bool operator()(T output[], const int input[])
Top level namespace for all of OpenLB.