OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::BlockStdDeviationF3D< T, W > Class Template Referencefinal

BlockStdDeviationF3D returns the Deviation in each component of f on a indicated subset calcutalted with Steiner translation theorem. More...

#include <blockStatisticF3D.h>

+ Inheritance diagram for olb::BlockStdDeviationF3D< T, W >:
+ Collaboration diagram for olb::BlockStdDeviationF3D< T, W >:

Public Member Functions

 BlockStdDeviationF3D (BlockF3D< W > &f, BlockIndicatorF3D< T > &indicatorF, Cuboid3D< T > &cuboid, T expectedValue)
 
bool operator() (W output[], const int input[]) override
 
 BlockStdDeviationF3D (BlockF3D< W > &f, BlockIndicatorF3D< T > &indicatorF, Cuboid3D< T > &cuboid, T expectedValue)
 
bool operator() (W output[], const int input[]) override
 
- Public Member Functions inherited from olb::BlockSum3D< T, W >
 BlockSum3D (BlockF3D< W > &f, BlockIndicatorF3D< T > &indicatorF)
 
bool operator() (W output[], const int input[]) override
 
- Public Member Functions inherited from olb::BlockF3D< T >
 ~BlockF3D () override
 virtual destructor for defined behaviour
 
virtual BlockStructureD< 3 > & getBlockStructure () const
 
BlockF3D< T > & operator- (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator+ (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator* (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator/ (BlockF3D< T > &rhs)
 
- Public Member Functions inherited from olb::GenericF< T, int >
virtual ~GenericF ()=default
 
int getSourceDim () const
 read only access to member variable _m
 
int getTargetDim () const
 read only access to member variable _n
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
virtual bool operator() (T output[], const int input[])=0
 has to be implemented for 'every' derived class
 
bool operator() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], int input0)
 
bool operator() (T output[], int input0, int input1)
 
bool operator() (T output[], int input0, int input1, int input2)
 
bool operator() (T output[], int input0, int input1, int input2, int input3)
 
- Public Member Functions inherited from olb::BlockAverage3D< T, W >
 BlockAverage3D (BlockF3D< W > &f, BlockIndicatorF3D< T > &indicatorF)
 
bool operator() (W output[], const int input[]) override
 

Additional Inherited Members

- Public Types inherited from olb::GenericF< T, int >
using targetType
 
using sourceType
 
- Public Attributes inherited from olb::GenericF< T, int >
std::shared_ptr< GenericF< T, int > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Protected Member Functions inherited from olb::BlockF3D< T >
 BlockF3D (BlockStructureD< 3 > &blockStructure, int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, int >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::BlockF3D< T >
BlockStructureD< 3 > & _blockStructure
 

Detailed Description

template<typename T, typename W = T>
class olb::BlockStdDeviationF3D< T, W >

BlockStdDeviationF3D returns the Deviation in each component of f on a indicated subset calcutalted with Steiner translation theorem.

BlockStdDeviationF3D returns the Deviation in each component of f on a indicated subset.

Definition at line 54 of file blockStatisticF3D.h.

Constructor & Destructor Documentation

◆ BlockStdDeviationF3D() [1/2]

template<typename T , typename W >
olb::BlockStdDeviationF3D< T, W >::BlockStdDeviationF3D ( BlockF3D< W > & f,
BlockIndicatorF3D< T > & indicatorF,
Cuboid3D< T > & cuboid,
T expectedValue )

Definition at line 82 of file blockStatisticF3D.hh.

86 : BlockSum3D<T,W>(f, indicatorF),
87 _f(f),
88 _indicatorF(indicatorF),
89 _cuboid(cuboid),
90 _expectedValue(expectedValue)
91{
92 this->getName() = "BlockStdDeviation("+_f.getName()+")";
93}
std::string & getName()
read and write access to name
Definition genericF.hh:51

References olb::GenericF< T, S >::getName(), and olb::GenericF< T, int >::getName().

+ Here is the call graph for this function:

◆ BlockStdDeviationF3D() [2/2]

template<typename T , typename W = T>
olb::BlockStdDeviationF3D< T, W >::BlockStdDeviationF3D ( BlockF3D< W > & f,
BlockIndicatorF3D< T > & indicatorF,
Cuboid3D< T > & cuboid,
T expectedValue )

Member Function Documentation

◆ operator()() [1/2]

template<typename T , typename W >
bool olb::BlockStdDeviationF3D< T, W >::operator() ( W output[],
const int input[] )
override

Definition at line 96 of file blockStatisticF3D.hh.

97{
98 OLB_ASSERT(_f.getSourceDim() == _indicatorF.getSourceDim(),
99 "functor source dimension equals indicator source dimension");
100
101 std::size_t voxels(0);
102
103 W outputTmp[_f.getTargetDim()];
104 for(int i=0; i<_f.getTargetDim(); ++i) {
105 outputTmp[i] = W(0);
106 }
107 int inputTmp[_f.getSourceDim()];
108
109 for (inputTmp[0] = 0; inputTmp[0] < _cuboid.getNx(); ++inputTmp[0]) {
110 for (inputTmp[1] = 0; inputTmp[1] < _cuboid.getNy(); ++inputTmp[1]) {
111 for (inputTmp[2] = 0; inputTmp[2] < _cuboid.getNz(); ++inputTmp[2]) {
112 if (_indicatorF(inputTmp)) {
113 _f(outputTmp,inputTmp);
114 for (int i = 0; i < _f.getTargetDim(); ++i) {
115 output[i] += util::pow(outputTmp[i] - _expectedValue, 2);
116 }
117 voxels += 1;
118 }
119 }
120 }
121 }
122
123
124 output[_f.getTargetDim()] += voxels;
125
126 return true;
127}
int getTargetDim() const
read only access to member variable _n
Definition genericF.hh:45
int getSourceDim() const
read only access to member variable _m
Definition genericF.hh:39
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112
#define OLB_ASSERT(COND, MESSAGE)
Definition olbDebug.h:45

References OLB_ASSERT, and olb::util::pow().

+ Here is the call graph for this function:

◆ operator()() [2/2]

template<typename T , typename W = T>
bool olb::BlockStdDeviationF3D< T, W >::operator() ( W output[],
const int input[] )
override

The documentation for this class was generated from the following files: