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

Block level functor that returns the Lp norm over omega of the euklid norm of the input block functor. More...

#include <blockLpNorm3D.h>

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

Public Member Functions

 BlockLpNorm3D (BlockF3D< W > &f, BlockIndicatorF3D< T > &indicatorF)
 
bool operator() (W output[], const int input[]) override
 
- Public Member Functions inherited from olb::BlockF3D< W >
 ~BlockF3D () override
 virtual destructor for defined behaviour
 
virtual BlockStructureD< 3 > & getBlockStructure () const
 
BlockF3D< W > & operator- (BlockF3D< W > &rhs)
 
BlockF3D< W > & operator+ (BlockF3D< W > &rhs)
 
BlockF3D< W > & operator* (BlockF3D< W > &rhs)
 
BlockF3D< W > & operator/ (BlockF3D< W > &rhs)
 
- Public Member Functions inherited from olb::GenericF< T, S >
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 S 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[], S input0)
 
bool operator() (T output[], S input0, S input1)
 
bool operator() (T output[], S input0, S input1, S input2)
 
bool operator() (T output[], S input0, S input1, S input2, S input3)
 

Protected Attributes

BlockF3D< W > & _f
 
BlockIndicatorF3D< T > & _indicatorF
 
- Protected Attributes inherited from olb::BlockF3D< W >
BlockStructureD< 3 > & _blockStructure
 

Additional Inherited Members

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

Detailed Description

template<typename T, typename W, int P>
class olb::BlockLpNorm3D< T, W, P >

Block level functor that returns the Lp norm over omega of the euklid norm of the input block functor.

Definition at line 35 of file blockLpNorm3D.h.

Constructor & Destructor Documentation

◆ BlockLpNorm3D()

template<typename T , typename W , int P>
olb::BlockLpNorm3D< T, W, P >::BlockLpNorm3D ( BlockF3D< W > & f,
BlockIndicatorF3D< T > & indicatorF )
Parameters
fdata functor
indicatorFindicator functor describing the subset to be integrated

Definition at line 35 of file blockLpNorm3D.hh.

37 : BlockF3D<W>(f.getBlockStructure(), f.getTargetDim()),
38 _f(f),
39 _indicatorF(indicatorF)
40{
41 OLB_ASSERT(_f.getSourceDim() == _indicatorF.getSourceDim(),
42 "functor source dimension equals indicator source dimension");
43
44 this->getName() = "BlockL" + std::to_string(P) + "Norm(" + _f.getName() + ")";
45}
virtual BlockStructureD< 3 > & getBlockStructure() const
BlockIndicatorF3D< T > & _indicatorF
BlockF3D< W > & _f
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
std::string & getName()
read and write access to name
Definition genericF.hh:51
#define OLB_ASSERT(COND, MESSAGE)
Definition olbDebug.h:45

References olb::BlockLpNorm3D< T, W, P >::_f, olb::BlockLpNorm3D< T, W, P >::_indicatorF, olb::GenericF< T, S >::getName(), olb::GenericF< T, S >::getSourceDim(), and OLB_ASSERT.

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

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

Definition at line 48 of file blockLpNorm3D.hh.

49{
50 const auto& blockGeometry = _indicatorF.getBlockGeometry();
51 const int nX = blockGeometry.getNx();
52 const int nY = blockGeometry.getNy();
53 const int nZ = blockGeometry.getNz();
54 const T weight = util::pow(blockGeometry.getDeltaR(), 3);
55
56 output[0] = W(0);
57 W outputTmp[_f.getTargetDim()];
58 int inputTmp[_f.getSourceDim()];
59
60 for (inputTmp[0] = 0; inputTmp[0] < nX; ++inputTmp[0]) {
61 for (inputTmp[1] = 0; inputTmp[1] < nY; ++inputTmp[1]) {
62 for (inputTmp[2] = 0; inputTmp[2] < nZ; ++inputTmp[2]) {
63 if (_indicatorF(inputTmp)) {
64 _f(outputTmp, inputTmp);
65 for (int iDim = 0; iDim < _f.getTargetDim(); ++iDim) {
66 output[0] = LpNormImpl<T,W,P>()(output[0], outputTmp[iDim], weight);
67 }
68 }
69 }
70 }
71 }
72
73 output[0] = LpNormImpl<T,W,P>().enclose(output[0]);
74
75 return true;
76}
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112

References olb::LpNormImpl< T, W, P >::enclose(), and olb::util::pow().

+ Here is the call graph for this function:

Member Data Documentation

◆ _f

template<typename T , typename W , int P>
BlockF3D<W>& olb::BlockLpNorm3D< T, W, P >::_f
protected

Definition at line 37 of file blockLpNorm3D.h.

◆ _indicatorF

template<typename T , typename W , int P>
BlockIndicatorF3D<T>& olb::BlockLpNorm3D< T, W, P >::_indicatorF
protected

Definition at line 38 of file blockLpNorm3D.h.


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