25#ifndef LATTICE_INDICATOR_SMOOTH_INDICATOR_INTERSECTION_3D_HH
26#define LATTICE_INDICATOR_SMOOTH_INDICATOR_INTERSECTION_3D_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>
84 _blockGeometry(blockGeometry), _normalInd(normalInd), _smoothInd(smoothInd)
86 this->
getName() =
"Indicator-SmoothIndicator Intersection";
89template<
typename T,
typename DESCRIPTOR,
bool HLBM>
96 Cuboid3D<T> tmpCuboid(_blockGeometry.getOrigin()[0], _blockGeometry.getOrigin()[1], _blockGeometry.getOrigin()[2], _blockGeometry.getDeltaR(), _blockGeometry.getNx(), _blockGeometry.getNy(), _blockGeometry.getNz());
97 T posXmin = _smoothInd.getPos()[0] - _smoothInd.getCircumRadius();
98 T posXmax = _smoothInd.getPos()[0] + _smoothInd.getCircumRadius();
99 T posYmin = _smoothInd.getPos()[1] - _smoothInd.getCircumRadius();
100 T posYmax = _smoothInd.getPos()[1] + _smoothInd.getCircumRadius();
101 T posZmin = _smoothInd.getPos()[2] - _smoothInd.getCircumRadius();
102 T posZmax = _smoothInd.getPos()[2] + _smoothInd.getCircumRadius();
103 if (tmpCuboid.
checkInters(posXmin, posXmax, posYmin, posYmax, posZmin, posZmax, start[0],
104 end[0], start[1], end[1], start[2], end[2])) {
106 for (
int k=0; k<3; k++) {
112 if (end[k] > _blockGeometry.getExtent()[k]) {
113 end[k] = _blockGeometry.getExtent()[k];
118 for (
int iX = start[0]; iX < end[0]; iX++) {
119 for (
int iY = start[1]; iY < end[1]; iY++) {
120 for (
int iZ = start[2]; iZ < end[2]; iZ++) {
125 _blockGeometry.getPhysR(posIn, {iX, iY, iZ});
126 _smoothInd( insideT, posIn);
127 if ( !
util::nearZero(insideT[0]) && this->_blockGeometry.get({iX,iY,iZ})==1) {
129 bool insideBool[1] = {
false};
130 _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
BlockLatticeIndicatorSmoothIndicatorIntersection3D(BlockLattice< T, DESCRIPTOR > &blockLattice, BlockGeometry< T, 3 > &blockGeometry, IndicatorF3D< T > &normalInd, SmoothIndicatorF3D< T, T, HLBM > &smoothInd)
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class
Platform-abstracted block lattice for external access and inter-block interaction.
A regular single 3D cuboid is the basic component of a 3D cuboid structure which defines the grid.
bool checkInters(T globX0, T globX1, T globY0, T globY1, T globZ0, T globZ1, 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
IndicatorF3D is an application from .
std::vector< std::unique_ptr< BlockF3D< T > > > _blockF
Super functors may consist of several BlockF3D<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
SuperLatticeIndicatorSmoothIndicatorIntersection3D(SuperLattice< T, DESCRIPTOR > &sLattice, SuperGeometry< T, 3 > &superGeometry, IndicatorF3D< T > &normalInd, SmoothIndicatorF3D< T, T, HLBM > &smoothInd)
bool operator()(T output[], const int input[]) override
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.
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.