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

indicator function for a 2D equilateral triangle More...

#include <indicatorF2D.h>

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

Public Member Functions

 IndicatorEquiTriangle2D (Vector< S, 2 > center, S radius)
 
Vector< S, 2 > const & getVertexA () const
 
Vector< S, 2 > const & getVertexB () const
 
Vector< S, 2 > const & getVertexC () const
 
Vector< S, 2 > const & getCenter () const
 
S const getRadius () const
 
bool operator() (bool output[], const S input[]) override
 has to be implemented for 'every' derived class
 
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
 
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::IndicatorEquiTriangle2D< S >

indicator function for a 2D equilateral triangle

Definition at line 126 of file indicatorF2D.h.

Constructor & Destructor Documentation

◆ IndicatorEquiTriangle2D()

template<typename S >
olb::IndicatorEquiTriangle2D< S >::IndicatorEquiTriangle2D ( Vector< S, 2 > center,
S radius )

Definition at line 337 of file indicatorF2D.hh.

338 : _center(center),
339 _radius(radius),
340 _a({center[0], center[1]+radius}),
341_b({center[0]-util::sqrt(3)/S(2)*radius, center[1]-S(0.5)*radius}),
342_c({center[0]+util::sqrt(3)/S(2)*radius, center[1]-S(0.5)*radius})
343{
344
345 this->_myMin = {util::min(_a[0], util::min(_b[0], _c[0])), util::min(_a[1], util::min(_b[1], _c[1]))};
346 this->_myMax = {util::max(_a[0], util::max(_b[0], _c[0])), util::max(_a[1], util::max(_b[1], _c[1]))};
347}
Vector< S, 2 > _myMin
Vector< S, 2 > _myMax
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
cpu::simd::Pack< T > min(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
Definition pack.h:124
cpu::simd::Pack< T > max(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
Definition pack.h:130

Member Function Documentation

◆ getCenter()

template<typename S >
Vector< S, 2 > const & olb::IndicatorEquiTriangle2D< S >::getCenter ( ) const

Definition at line 369 of file indicatorF2D.hh.

370{
371 return _center;
372}

◆ getRadius()

template<typename S >
S const olb::IndicatorEquiTriangle2D< S >::getRadius ( ) const

Definition at line 375 of file indicatorF2D.hh.

376{
377 return _radius;
378}
+ Here is the caller graph for this function:

◆ getVertexA()

template<typename S >
Vector< S, 2 > const & olb::IndicatorEquiTriangle2D< S >::getVertexA ( ) const

Definition at line 351 of file indicatorF2D.hh.

352{
353 return _a;
354}

◆ getVertexB()

template<typename S >
Vector< S, 2 > const & olb::IndicatorEquiTriangle2D< S >::getVertexB ( ) const

Definition at line 357 of file indicatorF2D.hh.

358{
359 return _b;
360}

◆ getVertexC()

template<typename S >
Vector< S, 2 > const & olb::IndicatorEquiTriangle2D< S >::getVertexC ( ) const

Definition at line 363 of file indicatorF2D.hh.

364{
365 return _c;
366}

◆ operator()()

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

has to be implemented for 'every' derived class

Implements olb::GenericF< bool, S >.

Definition at line 382 of file indicatorF2D.hh.

383{
384 output[0] = ( sdf::triangle({input[0], input[1]}, _a, _b, _c) <= 0 );
385 return output[0];
386}
T triangle(Vector< T, 2 > p, Vector< T, 2 > a, Vector< T, 2 > b, Vector< T, 2 > c) any_platform
Exact signed distance to the surface of two-dimensional triangle.
Definition sdf.h:143

References olb::sdf::triangle().

+ Here is the call graph for this function:

◆ signedDistance()

template<typename S >
S olb::IndicatorEquiTriangle2D< 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 389 of file indicatorF2D.hh.

390{
391
392 return sdf::triangle( input, _a, _b, _c);
393}

References olb::sdf::triangle().

+ Here is the call graph for this function:

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