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

indicator from VTIreader More...

#include <indicatorF2D.h>

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

Public Member Functions

 IndicatorBlockData2D (BlockData< 3, S, S > &blockData, Vector< S, 3 > extend, Vector< S, 3 > origin, S deltaR, bool invert)
 
signedDistance (const Vector< S, 2 > &input) override
 Returns signed distance to the nearest point on the indicator surface.
 
- 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 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
 
virtual bool operator() (bool output[], const S input[])=0
 has to be implemented for 'every' derived class
 
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::IndicatorBlockData2D< S >

indicator from VTIreader

Definition at line 147 of file indicatorF2D.h.

Constructor & Destructor Documentation

◆ IndicatorBlockData2D()

template<typename S >
olb::IndicatorBlockData2D< S >::IndicatorBlockData2D ( BlockData< 3, S, S > & blockData,
Vector< S, 3 > extend,
Vector< S, 3 > origin,
S deltaR,
bool invert )

Definition at line 414 of file indicatorF2D.hh.

416 : _blockData(blockData), _deltaR(deltaR), _invert(invert)
417{
418 this->_myMin = Vector<S,2>(origin[0], origin[1]);
419 this->_myMax = Vector<S,2>(origin[0] + extend[0], origin[1] + extend[1]);
420
421 OLB_ASSERT(extend[2]-origin[2] == 1, "extend[2]-origin[2] must be 1.")
422}
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, and OLB_ASSERT.

Member Function Documentation

◆ signedDistance()

template<typename S >
S olb::IndicatorBlockData2D< S >::signedDistance ( const Vector< S, 2 > & input)
overridevirtual

Returns signed distance to the nearest point on the indicator surface.

Reimplemented from olb::IndicatorF2D< S >.

Definition at line 425 of file indicatorF2D.hh.

426{
427 // Translation
428 S xDist = input[0] - this->_myMin[0];
429 S yDist = input[1] - this->_myMin[1];
430
431 int x = ((this->_myMin[0] + xDist)/_deltaR)+0.5;
432 int y = ((this->_myMin[1] + yDist)/_deltaR)+0.5;
433
434 if (x >= 0 && x < _blockData.getNx() && y >= 0 && y < _blockData.getNy()) {
435 LatticeR<3> input(x,y,0);
436 if (_blockData.get(input) > std::numeric_limits<S>::epsilon()) {
437 if (!_invert){
438 return 1.;
439 } else {
440 return -1.;
441 }
442 }
443 else {
444 if (!_invert){
445 return -1.;
446 } else {
447 return 1.;
448 }
449
450 }
451 }
452
453 if (!_invert){
454 return 1.;
455 } else {
456 return -1.;
457 }
458
459}
U & get(std::size_t iCell, int iD=0)
Definition blockData.hh:94
int getNy() const
Read only access to block height.
int getNx() const
Read only access to block width.

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