24#ifndef LATTICE_INDICATOR_SMOOTH_INDICATOR_INTERSECTION_2D_HH
25#define LATTICE_INDICATOR_SMOOTH_INDICATOR_INTERSECTION_2D_HH
44template <
typename T,
typename DESCRIPTOR,
bool HLBM>
51 this->
getName() =
"Indicator-SmoothIndicator Intersection";
52 int maxC = this->
_sLattice.getLoadBalancer().size();
54 for (
int iC = 0; iC < maxC; iC++) {
59template <
typename T,
typename DESCRIPTOR,
bool HLBM>
63 for (
int iC = 0; iC < this->_sLattice.getLoadBalancer().size(); ++iC) {
64 int globiC = this->_sLattice.getLoadBalancer().glob(iC);
66 this->getBlockF(iC)(output,&input[1]);
70#ifdef PARALLEL_MODE_MPI
77template<
typename T,
typename DESCRIPTOR,
bool HLBM>
83 _blockGeometry(blockGeometry), _normalInd(normalInd), _smoothInd(smoothInd)
85 this->
getName() =
"Indicator-SmoothIndicator Intersection";
88template<
typename T,
typename DESCRIPTOR,
bool HLBM>
95 Cuboid2D<T> tmpCuboid(_blockGeometry.getOrigin()[0], _blockGeometry.getOrigin()[1], _blockGeometry.getDeltaR(), _blockGeometry.getNx(), _blockGeometry.getNy());
96 T posXmin = _smoothInd.getPos()[0] - _smoothInd.getCircumRadius();
97 T posXmax = _smoothInd.getPos()[0] + _smoothInd.getCircumRadius();
98 T posYmin = _smoothInd.getPos()[1] - _smoothInd.getCircumRadius();
99 T posYmax = _smoothInd.getPos()[1] + _smoothInd.getCircumRadius();
100 if (tmpCuboid.
checkInters(posXmin, posXmax, posYmin, posYmax, start[0], end[0], start[1], end[1])) {
102 for (
int k=0; k<2; k++) {
108 if (end[k] > _blockGeometry.getExtent()[k]) {
109 end[k] = _blockGeometry.getExtent()[k];
114 for (
int iX = start[0]; iX < end[0]; iX++) {
115 for (
int iY = start[1]; iY < end[1]; iY++) {
120 _blockGeometry.getPhysR(posIn, {iX, iY});
121 _smoothInd( insideT, posIn);
122 if ( !
util::nearZero(insideT[0]) && this->_blockGeometry.get({iX,iY})==1) {
124 bool insideBool[1] = {
false};
125 _normalInd(insideBool, posIn);
Representation of a block geometry.
represents all functors that operate on a DESCRIPTOR in general, e.g. getVelocity(),...
functor that returns 1 if SmoothIndicatorF A intersects IndicatorF B; otherwise, 0
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
BlockLatticeIndicatorSmoothIndicatorIntersection2D(BlockLattice< T, DESCRIPTOR > &blockLattice, BlockGeometry< T, 2 > &blockGeometry, IndicatorF2D< T > &normalInd, SmoothIndicatorF2D< T, T, HLBM > &smoothInd)
Platform-abstracted block lattice for external access and inter-block interaction.
A regular single 2D cuboid is the basic component of a 2D cuboid structure which defines the grid.
bool checkInters(T globX0, T globX1, T globY0, T globY1, int overlap=0) const
Checks whether there is an intersection with the cuboid extended with an layer of size overlap*delta.
std::string & getName()
read and write access to name
IndicatorF2D is an application from .
std::vector< std::unique_ptr< BlockF2D< T > > > _blockF
Super functors may consist of several BlockF2D<W> derived functors.
Representation of a statistic for a parallel 2D geometry.
BlockGeometry< T, D > & getBlockGeometry(int locIC)
Read and write access to a single block geometry.
represents all functors that operate on a SuperLattice in general, e.g. getVelocity(),...
SuperLattice< T, DESCRIPTOR > & _sLattice
bool operator()(T output[], const int input[]) override
SuperLatticeIndicatorSmoothIndicatorIntersection2D(SuperLattice< T, DESCRIPTOR > &sLattice, SuperGeometry< T, 2 > &superGeometry, IndicatorF2D< T > &normalInd, SmoothIndicatorF2D< T, T, HLBM > &smoothInd)
Super class maintaining block lattices for a cuboid decomposition.
void reduceAndBcast(T &reductVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
Reduction operation, followed by a broadcast.
int getRank() const
Returns the process ID.
The description of a generic interface for all functor classes – header file.
This file contains indicator functions.
Wrapper functions that simplify the use of MPI.
bool nearZero(const ADf< T, DIM > &a)
Top level namespace for all of OpenLB.
Representation of a parallel 2D geometry – header file.