OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::IndicatorLayer2D< S > Class Template Reference

Indicator function creating an layer around an input indicator (for positive layerSize) or reducing the input indicator by a layer (for negative layerSize). More...

#include <indicatorF2D.h>

+ Inheritance diagram for olb::IndicatorLayer2D< S >:
+ Collaboration diagram for olb::IndicatorLayer2D< S >:

Public Member Functions

 IndicatorLayer2D (IndicatorF2D< S > &indicatorF, S layerSize)
 
bool operator() (bool output[], const S input[]) override
 has to be implemented for 'every' derived class
 
- Public Member Functions inherited from olb::IndicatorF2D< S >
virtual Vector< S, 2 > & getMin ()
 
virtual Vector< S, 2 > & getMax ()
 
virtual bool distance (S &distance, const Vector< S, 2 > &origin, S precision, const Vector< S, 2 > &direction)
 returns false or true and pos. distance if there was one found for an given origin and direction
 
virtual bool distance (S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, S precision, S pitch)
 
virtual bool distance (S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, int iC=-1)
 
virtual bool distance (S &distance, const Vector< S, 2 > &origin)
 
virtual bool distance (S &distance, const S input[])
 
virtual bool normal (Vector< S, 2 > &normal, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, int iC=-1)
 returns true and the normal if there was one found for an given origin and direction
 
virtual bool operator() (bool output[1], const S input[2])
 Returns true if input is inside the indicator.
 
virtual S signedDistance (const Vector< S, 2 > &input)
 Returns signed distance to the nearest point on the indicator surface.
 
virtual Vector< S, 2 > surfaceNormal (const Vector< S, 2 > &pos, const S meshSize)
 Return surface normal.
 
Vector< S, 2 > surfaceNormal (const Vector< S, 2 > &pos, const S meshSize, std::function< Vector< S, 2 >(const Vector< S, 2 > &)> transformPos)
 Return surface normal after possible translation and rotation.
 
bool isInsideBox (Vector< S, 2 > point)
 Returns true if point is inside a cube with corners _myMin and _myMax
 
virtual bool operator() (const S input[])
 Indicator specific function operator overload.
 
- Public Member Functions inherited from olb::GenericF< bool, S >
virtual ~GenericF ()=default
 
int getSourceDim () const
 read only access to member variable _m
 
int getTargetDim () const
 read only access to member variable _n
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
bool operator() (bool output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (bool output[], S input0)
 
bool operator() (bool output[], S input0, S input1)
 
bool operator() (bool output[], S input0, S input1, S input2)
 
bool operator() (bool output[], S input0, S input1, S input2, S input3)
 

Additional Inherited Members

- Public Types inherited from olb::GenericF< bool, S >
using targetType
 
using sourceType
 
- Public Attributes inherited from olb::GenericF< bool, S >
std::shared_ptr< GenericF< bool, S > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Protected Member Functions inherited from olb::IndicatorF2D< S >
 IndicatorF2D ()
 
- Protected Member Functions inherited from olb::GenericF< bool, S >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::IndicatorF2D< S >
Vector< S, 2 > _myMin
 
Vector< S, 2 > _myMax
 

Detailed Description

template<typename S>
class olb::IndicatorLayer2D< S >

Indicator function creating an layer around an input indicator (for positive layerSize) or reducing the input indicator by a layer (for negative layerSize).

Parameters
[in]indicatorF- some indicator (e.g. IndicatorCircle2D)
[in]layerSize- size of the layer (can be negative) [physical units]

Definition at line 166 of file indicatorF2D.h.

Constructor & Destructor Documentation

◆ IndicatorLayer2D()

template<typename S >
olb::IndicatorLayer2D< S >::IndicatorLayer2D ( IndicatorF2D< S > & indicatorF,
S layerSize )

Definition at line 462 of file indicatorF2D.hh.

463 : _indicatorF(indicatorF), _layerSize(layerSize)
464{
465 this->_myMin = indicatorF.getMin() - layerSize;
466 this->_myMax = indicatorF.getMax() + layerSize;
467 OLB_ASSERT( (this->_myMax[0]-this->_myMin[0]) > std::numeric_limits<S>::epsilon(),"Indicator reduced to zero-set in x direction");
468 OLB_ASSERT( (this->_myMax[1]-this->_myMin[1]) > std::numeric_limits<S>::epsilon(),"Indicator reduced to zero-set in y direction");
469 _isPositive = std::signbit(layerSize);
470}
Vector< S, 2 > _myMin
Vector< S, 2 > _myMax
#define OLB_ASSERT(COND, MESSAGE)
Definition olbDebug.h:45

References olb::IndicatorF2D< S >::_myMax, olb::IndicatorF2D< S >::_myMin, olb::IndicatorF2D< S >::getMax(), olb::IndicatorF2D< S >::getMin(), and OLB_ASSERT.

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename S >
bool olb::IndicatorLayer2D< S >::operator() ( bool output[],
const S input[] )
overridevirtual

has to be implemented for 'every' derived class

Implements olb::GenericF< bool, S >.

Definition at line 474 of file indicatorF2D.hh.

475{
476 output[0] = !_isPositive;
477 S r[2];
478 for (int iX =- 1; iX < 2; ++iX) {
479 for (int iY =- 1; iY < 2; ++iY) {
480 r[0] = input[0] + iX*_layerSize;
481 r[1] = input[1] + iY*_layerSize;
482 _indicatorF(output,r);
483 if (output[0] == !_isPositive) {
484 return true;
485 }
486 }
487 }
488 return true;
489}

The documentation for this class was generated from the following files: