24#ifndef BLOCK_DISCRETIZATION_F_2D_HH
25#define BLOCK_DISCRETIZATION_F_2D_HH
37 :
BlockF2D<T>(f.getBlockStructure(),f.getTargetDim()),_f(f),_bottomBoundary(bottomBoundary),_topBoundary(topBoundary),_n(n)
39 this->
getName() =
"Discretization(" + _f.getName() +
" ) ";
45 const T delta = (_topBoundary - _bottomBoundary) / (
util::max(_n-1,1));
48 for (
int i=0; i < _f.getTargetDim(); ++i) {
49 if ( output[i] <= _bottomBoundary ) {
50 output[i] = _bottomBoundary;
52 else if ( output[i] >= _topBoundary ) {
53 output[i] = _topBoundary;
56 output[i] -= _bottomBoundary;
57 output[i] = _bottomBoundary + std::nearbyint(output[i] / delta) * delta;
bool operator()(T output[], const int input[])
has to be implemented for 'every' derived class
BlockDiscretizationF2D(BlockF2D< T > &f, T bottomBoundary, T topBoundary, int n)
represents all functors that operate on a cuboid in general, mother class of BlockLatticeF,...
std::string & getName()
read and write access to name
cpu::simd::Pack< T > max(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
Top level namespace for all of OpenLB.