24#ifndef BLOCK_INDICATOR_F_2D_HH
25#define BLOCK_INDICATOR_F_2D_HH
38 _indicatorF(indicatorF)
45 this->_blockGeometryStructure.getPhysR(physR,input);
46 return _indicatorF(output,physR);
70template <
typename T,
bool HLBM>
74 _indicatorF(indicatorF)
77template <
typename T,
bool HLBM>
82 this->_blockGeometryStructure.getPhysR(physR,input);
83 _indicatorF(inside, physR);
87template <
typename T,
bool HLBM>
93template <
typename T,
bool HLBM>
96 return this->_blockGeometryStructure.getExtent() -
Vector<int,2> {1,1};
104 _materials(materials)
111 std::vector<int>(materials.begin(), materials.end()))
127 const int current = blockGeometry.
getMaterial({input[0], input[1]});
128 output[0] = std::any_of(_materials.cbegin(),
130 [current](
int material) {
131 return current == material;
140 const auto& statistics = this->getBlockGeometry().getStatistics();
141 return std::none_of(_materials.cbegin(), _materials.cend(),
142 [&statistics](
int material) ->
bool {
143 return statistics.getNvoxel(material) > 0;
150 const auto& blockGeometry = this->getBlockGeometry();
151 const auto& statistics = blockGeometry.getStatistics();
154 blockGeometry.getNx()+blockGeometry.getPadding()-1,
155 blockGeometry.getNy()+blockGeometry.getPadding()-1
158 for (
int material : _materials ) {
159 if ( statistics.getNvoxel(material) > 0 ) {
160 const Vector<int,2> localMin = statistics.getMinLatticeR(material);
161 for (
int d = 0; d < 2; ++d ) {
162 globalMin[d] = localMin[d] < globalMin[d] ? localMin[d] : globalMin[d];
173 const auto& statistics = this->getBlockGeometry().getStatistics();
175 Vector<int,2> globalMax = -this->getBlockGeometry().getPadding();
177 for (
int material : _materials ) {
178 if ( statistics.getNvoxel(material) > 0 ) {
180 const Vector<int,2> localMax = statistics.getMaxLatticeR(material);
181 for (
int d = 0; d < 2; ++d ) {
182 globalMax[d] = localMax[d] > globalMax[d] ? localMax[d] : globalMax[d];
194 _indicatorF(indicatorF)
200 return _indicatorF(output, input);
206 return _indicatorF.getMin();
212 return _indicatorF.getMax();
219 _indicatorF(indicatorF),
227 if ( this->getBlockGeometry().getMaterial(input[0],input[1]) != 0 ) {
229 for (
int iXo = -_overlap; iXo <= _overlap; ++iXo ) {
230 for (
int iYo = -_overlap; iYo <= _overlap; ++iYo ) {
231 const int neighborPos[2] = {iXo + input[0], iYo + input[1]};
232 bool partOfBoundary[1] = {
false};
234 _indicatorF( partOfBoundary, neighborPos );
235 if ( partOfBoundary[0] ) {
247 return _indicatorF.getMin() - _overlap;
253 return _indicatorF.getMax() + _overlap;
Representation of a block geometry.
int getMaterial(LatticeR< D > latticeR) const
returns the (iX,iY) entry in the 2D scalar field
Vector< int, 2 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
BlockIndicatorBoundaryNeighbor2D(BlockIndicatorF2D< T > &indicatorF, int overlap)
bool operator()(bool output[], const int input[]) override
Vector< int, 2 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
Base block indicator functor (discrete)
Vector< int, 2 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
BlockIndicatorFfromIndicatorF2D(IndicatorF2D< T > &indicatorF, BlockGeometry< T, 2 > &blockGeometry)
Vector< int, 2 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
bool operator()(bool output[], const int input[]) override
bool operator()(bool output[], const int input[]) override
Vector< int, 2 > getMin() override
Returns a min lattice position of the indicated domain's bounding box.
Vector< int, 2 > getMax() override
Returns a max lattice position of the indicated domain's bounding box.
BlockIndicatorFfromSmoothIndicatorF2D(SmoothIndicatorF2D< T, T, HLBM > &indicatorF, BlockGeometry< T, 2 > &blockGeometry)
bool operator()(bool output[], const int input[]) override
BlockIndicatorIdentity2D(BlockIndicatorF2D< T > &indicatorF)
Vector< int, 2 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
Vector< int, 2 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
Block indicator functor from material numbers.
Vector< int, 2 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
bool operator()(bool output[], const int input[]) override
bool isEmpty() override
Returns true iff indicated domain subset is empty.
BlockIndicatorMaterial2D(BlockGeometry< T, 2 > &blockGeometry, std::vector< int > materials)
Vector< int, 2 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
IndicatorF2D is an application from .
ADf< T, DIM > ceil(const ADf< T, DIM > &a)
ADf< T, DIM > floor(const ADf< T, DIM > &a)
bool nearZero(const ADf< T, DIM > &a)
Top level namespace for all of OpenLB.
Set of functions commonly used in LB computations – header file.