OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::BlockDiscretizationF3D< T > Class Template Reference

Block functor for discretizing values by an interval (bottomBoundary,topBoundary), as well as restricting the value by setting n equal-distributed points and rounding the value to the nearest point If n = 1, there won't be restricting, and for n>=1 there will be n-1 restricting points. More...

#include <blockDiscretizationF3D.h>

+ Inheritance diagram for olb::BlockDiscretizationF3D< T >:
+ Collaboration diagram for olb::BlockDiscretizationF3D< T >:

Public Member Functions

 BlockDiscretizationF3D (BlockF3D< T > &f, T bottomBoundary, T topBoundary, int n)
 
bool operator() (T output[], const int input[])
 has to be implemented for 'every' derived class
 
- 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
 
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)
 

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>
class olb::BlockDiscretizationF3D< T >

Block functor for discretizing values by an interval (bottomBoundary,topBoundary), as well as restricting the value by setting n equal-distributed points and rounding the value to the nearest point If n = 1, there won't be restricting, and for n>=1 there will be n-1 restricting points.

Definition at line 37 of file blockDiscretizationF3D.h.

Constructor & Destructor Documentation

◆ BlockDiscretizationF3D()

template<typename T >
olb::BlockDiscretizationF3D< T >::BlockDiscretizationF3D ( BlockF3D< T > & f,
T bottomBoundary,
T topBoundary,
int n )
Parameters
fBlock functor
bottomBoundarybottom border of the interval the value will be restricted to
topBoundarytop border of the interval the value will be restricted to
nnumber of points the interval will be split by, and the value discretizied to

Definition at line 33 of file blockDiscretizationF3D.hh.

37 :BlockF3D<T>(f.getBlockStructure(),f.getTargetDim()),_f(f),_bottomBoundary(bottomBoundary),_topBoundary(topBoundary),_n(n)
38{
39 this->getName() = "Discretization(" + _f.getName() + " ) ";
40}
std::string & getName()
read and write access to name
Definition genericF.hh:51

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

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename T >
bool olb::BlockDiscretizationF3D< T >::operator() ( T output[],
const int input[] )
virtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, int >.

Definition at line 43 of file blockDiscretizationF3D.hh.

44{
45 const T delta = (_topBoundary - _bottomBoundary) / (util::max(_n-1,1));
46 _f(output, input);
47
48 for (int i=0; i < _f.getTargetDim(); ++i) {
49 if ( output[i] <= _bottomBoundary ) {
50 output[i] = _bottomBoundary;
51 }
52 else if ( output[i] >= _topBoundary ) {
53 output[i] = _topBoundary;
54 }
55 else if ( _n != 1 ) {
56 output[i] -= _bottomBoundary;
57 output[i] = _bottomBoundary + std::nearbyint(output[i] / delta) * delta;
58 }
59 }
60
61 return true;
62}
cpu::simd::Pack< T > max(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
Definition pack.h:130

References olb::util::max().

+ Here is the call graph for this function:

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