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

#include <indicatorFromBlockDataF3D.h>

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

Public Member Functions

 IndicatorBlockData3D (BlockData< 3, S, S > &blockData, Vector< S, 3 > extend, Vector< S, 3 > origin, S deltaR, bool invert=false)
 constructor
 
bool operator() (bool output[], const S input[]) override
 returns true if input is inside, otherwise false
 
- Public Member Functions inherited from olb::IndicatorF3D< S >
virtual Vector< S, 3 > & getMin ()
 
virtual Vector< S, 3 > & getMax ()
 
virtual bool distance (S &distance, const Vector< S, 3 > &origin, S precision, const Vector< S, 3 > &direction)
 
virtual bool distance (S &distance, const Vector< S, 3 > &origin, const Vector< S, 3 > &direction, S precision, S pitch)
 
virtual bool distance (S &distance, const Vector< S, 3 > &origin, const Vector< S, 3 > &direction, int iC=-1)
 
virtual bool distance (S &distance, const Vector< S, 3 > &origin)
 
virtual bool distance (S &distance, const S input[])
 
virtual bool normal (Vector< S, 3 > &normal, const Vector< S, 3 > &origin, const Vector< S, 3 > &direction, int iC=-1)
 returns true and the normal if there was one found for an given origin and direction
 
virtual bool rotOnAxis (Vector< S, 3 > &vec_rot, const Vector< S, 3 > &vec, const Vector< S, 3 > &axis, S &theta)
 Rotate vector around axis by angle theta.
 
virtual bool operator() (bool output[1], const S input[3])
 Returns true if input is inside the indicator.
 
virtual S signedDistance (const Vector< S, 3 > &input)
 Returns signed distance to the nearest point on the indicator surface.
 
virtual Vector< S, 3 > surfaceNormal (const Vector< S, 3 > &pos, const S meshSize)
 Return surface normal.
 
Vector< S, 3 > surfaceNormal (const Vector< S, 3 > &pos, const S meshSize, std::function< Vector< S, 3 >(const Vector< S, 3 > &)> transformPos)
 Return surface normal after possible translation and rotation.
 
bool isInsideBox (Vector< S, 3 > point)
 Returns true if point is inside a cube with corners _myMin and _myMax
 
virtual Vector< S, 3 > getSample (const std::function< S()> &randomness) const
 
- 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::IndicatorF3D< S >
 IndicatorF3D ()
 
- Protected Member Functions inherited from olb::GenericF< bool, S >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::IndicatorF3D< S >
Vector< S, 3 > _myMin
 
Vector< S, 3 > _myMax
 

Detailed Description

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

Definition at line 30 of file indicatorFromBlockDataF3D.h.

Constructor & Destructor Documentation

◆ IndicatorBlockData3D()

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

constructor

Definition at line 30 of file indicatorFromBlockDataF3D.hh.

34 : _blockData(blockData), _deltaR(deltaR), _invert(invert)
35{
36 this->_myMin = origin;
37 this->_myMax = origin + extend;
38}
Vector< S, 3 > _myMin
Vector< S, 3 > _myMax

References olb::IndicatorF3D< S >::_myMax, and olb::IndicatorF3D< S >::_myMin.

Member Function Documentation

◆ operator()()

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

returns true if input is inside, otherwise false

Implements olb::GenericF< bool, S >.

Definition at line 42 of file indicatorFromBlockDataF3D.hh.

43{
44
45 // Translation
46 S xDist = input[0] - this->_myMin[0];
47 S yDist = input[1] - this->_myMin[1];
48 S zDist = input[2] - this->_myMin[2];
49
50 int x = ((this->_myMin[0] + xDist)/_deltaR)+0.5;
51 int y = ((this->_myMin[1] + yDist)/_deltaR)+0.5;
52 int z = ((this->_myMin[2] + zDist)/_deltaR)+0.5;
53
54 if (x >= 0 && x < _blockData.getNx() && y >= 0 && y < _blockData.getNy() && z >= 0 && z < _blockData.getNz()) {
55 LatticeR<3> input(x,y,z);
56 if (this->_blockData.get(input) > std::numeric_limits<S>::epsilon()) {
57 if (!_invert){
58 output[0] = S(this->_blockData.get(input));
59 return true;
60 } else {
61 output[0] = S(0);
62 return false;
63 }
64 }
65 }
66 if (!_invert){
67 output[0] = S(0);
68 return false;
69 } else {
70 output[0] = 1.-S(this->_blockData.get(input));
71 return true;
72 }
73}
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.
int getNz() const
Read only access to block height.

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