24#ifndef BLOCK_INDICATOR_F_3D_HH
25#define BLOCK_INDICATOR_F_3D_HH
38 _indicatorF(indicatorF)
45 this->_block.getPhysR(physR,input);
46 return _indicatorF(output,physR);
72template <
typename T,
bool HLBM>
76 _indicatorF(indicatorF)
79template <
typename T,
bool HLBM>
84 this->_block.getPhysR(physR,input);
85 _indicatorF(inside, physR);
89template <
typename T,
bool HLBM>
92 const T min = -_indicatorF.getCircumRadius();
100template <
typename T,
bool HLBM>
103 const T max = _indicatorF.getCircumRadius();
116 _materials(materials)
123 std::vector<int>(materials.begin(), materials.end()))
138 const auto& blockGeometry = this->getBlockGeometry();
139 const int current = blockGeometry.getMaterial({input[0], input[1], input[2]});
140 output[0] = std::any_of(_materials.cbegin(),
142 [current](
int material) {
143 return current == material;
152 auto& statistics = this->getBlockGeometry().getStatistics();
154 return std::none_of(_materials.cbegin(), _materials.cend(),
155 [&statistics](
int material) ->
bool {
156 return statistics.getNvoxel(material) > 0;
163 auto& blockGeometry = this->getBlockGeometry();
164 auto& statistics = blockGeometry.getStatistics();
167 blockGeometry.getNx()+blockGeometry.getPadding()-1,
168 blockGeometry.getNy()+blockGeometry.getPadding()-1,
169 blockGeometry.getNz()+blockGeometry.getPadding()-1,
172 for (
int material : _materials ) {
173 if ( statistics.getNvoxel(material) > 0 ) {
174 const Vector<int,3> localMin = statistics.getMinLatticeR(material);
175 for (
int d = 0; d < 3; ++d ) {
176 globalMin[d] = localMin[d] < globalMin[d] ? localMin[d] : globalMin[d];
187 auto& statistics = this->getBlockGeometry().getStatistics();
189 Vector<int,3> globalMax = -this->getBlockGeometry().getPadding();
191 for (
int material : _materials ) {
192 if ( statistics.getNvoxel(material) > 0 ) {
193 const Vector<int,3> localMax = statistics.getMaxLatticeR(material);
194 for (
int d = 0; d < 3; ++d ) {
195 globalMax[d] = localMax[d] > globalMax[d] ? localMax[d] : globalMax[d];
206 _indicatorF(indicatorF)
212 _indicatorF(output, input);
213 for (
int iPop=1; iPop < descriptors::D3Q27<>::q; ++iPop) {
216 tmpInput += descriptors::c<descriptors::D3Q27<>>(iPop);
217 _indicatorF(&tmpOutput, tmpInput.
data());
218 output[0] |= tmpOutput;
226 return _indicatorF.getMin()-1;
232 return _indicatorF.getMax()+1;
238 _indicatorF(indicatorF)
244 return _indicatorF(output, input);
250 return _indicatorF.getMin();
256 return _indicatorF.getMax();
280 auto resF = _f.getMin();
281 auto resG = _g.getMin();
290 auto resF = _f.getMax();
291 auto resG = _g.getMax();
301 _indicatorF(indicatorF),
309 if ( this->getBlockGeometry().getMaterial(input[0],input[1],input[2]) != 0 ) {
311 for (
int iXo = -_overlap; iXo <= _overlap; ++iXo ) {
312 for (
int iYo = -_overlap; iYo <= _overlap; ++iYo ) {
313 for (
int iZo = -_overlap; iZo <= _overlap; ++iZo ) {
314 const int neighborPos[3] = {iXo + input[0], iYo + input[1], iZo + input[2]};
315 bool partOfBoundary[1] = {
false};
317 _indicatorF( partOfBoundary, neighborPos );
318 if ( partOfBoundary[0] ) {
331 return _indicatorF.getMin() - _overlap;
337 return _indicatorF.getMax() + _overlap;
Representation of a block geometry.
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
bool operator()(bool output[], const int input[]) override
BlockIndicatorBoundaryNeighbor3D(BlockIndicatorF3D< T > &indicatorF, int overlap)
Base block indicator functor.
bool operator()(bool output[], const int input[]) override
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
BlockIndicatorFfromIndicatorF3D(IndicatorF3D< T > &indicatorF, BlockGeometry< T, 3 > &blockGeometry)
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
BlockIndicatorFfromSmoothIndicatorF3D(SmoothIndicatorF3D< T, T, HLBM > &indicatorF, BlockGeometry< T, 3 > &blockGeometry)
Vector< int, 3 > getMax() override
Returns max 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, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
BlockIndicatorIdentity3D(BlockIndicatorF3D< T > &indicatorF)
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
bool operator()(bool output[], const int input[]) override
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
BlockIndicatorLayer3D(BlockIndicatorF3D< T > &indicatorF)
Block indicator functor from material numbers.
BlockIndicatorMaterial3D(BlockGeometry< T, 3 > &blockGeometry, std::vector< int > materials)
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
bool isEmpty() override
Returns true iff indicated domain subset is empty.
bool operator()(bool output[], const int input[]) override
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
Vector< int, 3 > getMax() override
Returns max lattice position of the indicated domain's bounding box.
BlockIndicatorMultiplication3D(BlockIndicatorF3D< T > &f, BlockIndicatorF3D< T > &g)
bool operator()(bool output[], const int input[]) override
Vector< int, 3 > getMin() override
Returns min lattice position of the indicated domain's bounding box.
IndicatorF3D is an application from .
constexpr const T * data() const any_platform
ADf< T, DIM > ceil(const ADf< T, DIM > &a)
ADf< T, DIM > floor(const ADf< T, DIM > &a)
cpu::simd::Pack< T > min(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
cpu::simd::Pack< T > max(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
bool nearZero(const ADf< T, DIM > &a)
Top level namespace for all of OpenLB.
Set of functions commonly used in LB computations – header file.