OpenLB 1.7
Searching...
No Matches
olb::IndicatorSuperEllipsoid3D< S > Class Template Reference

indicator function for a super ellipsoid More...

`#include <indicatorF3D.h>`

Inheritance diagram for olb::IndicatorSuperEllipsoid3D< S >:
Collaboration diagram for olb::IndicatorSuperEllipsoid3D< S >:

Public Member Functions

IndicatorSuperEllipsoid3D (Vector< S, 3 > center, S xHalfAxis, S yHalfAxis, S zHalfAxis, S exponent1, S exponent2)

Vector< S, 3 > const & getCenter () const

getXHalfAxis () const

getYHalfAxis () const

getZHalfAxis () const

getExponent1 () const

getExponent2 () const

bool operator() (bool output[], const S input[]) override
has to be implemented for 'every' derived class

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

int getTargetDim () const

std::string & getName ()

std::string const & getName () const

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)

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::IndicatorSuperEllipsoid3D< S >

indicator function for a super ellipsoid

Definition at line 211 of file indicatorF3D.h.

◆ IndicatorSuperEllipsoid3D()

template<typename S >
 olb::IndicatorSuperEllipsoid3D< S >::IndicatorSuperEllipsoid3D ( Vector< S, 3 > center, S xHalfAxis, S yHalfAxis, S zHalfAxis, S exponent1, S exponent2 )

Definition at line 565 of file indicatorF3D.hh.

566 : _center(center), _xHalfAxis(xHalfAxis), _yHalfAxis(yHalfAxis), _zHalfAxis(zHalfAxis), _exp1(exponent1), _exp2(exponent2)
567{
568 assert(_xHalfAxis>0 && _yHalfAxis>0 && _zHalfAxis>0);
569
570 S max_axis = util::max( xHalfAxis, util::max(yHalfAxis, zHalfAxis) );
571 this->_myMin = {
572 center[0] - util::sqrt(2.)*max_axis,
573 center[1] - util::sqrt(2.)*max_axis,
574 center[2] - util::sqrt(2.)*max_axis
575 };
576 this->_myMax = {
577 center[0] + util::sqrt(2.)*max_axis,
578 center[1] + util::sqrt(2.)*max_axis,
579 center[2] + util::sqrt(2.)*max_axis
580 };
581}
Vector< S, 3 > _myMin
Vector< S, 3 > _myMax
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
cpu::simd::Pack< T > max(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
Definition pack.h:130
Here is the call graph for this function:

◆ getCenter()

template<typename S >
 Vector< S, 3 > const & olb::IndicatorSuperEllipsoid3D< S >::getCenter ( ) const

Definition at line 584 of file indicatorF3D.hh.

585{
586 return _center;
587}

◆ getExponent1()

template<typename S >
 S olb::IndicatorSuperEllipsoid3D< S >::getExponent1 ( ) const

Definition at line 608 of file indicatorF3D.hh.

609{
610 return _exp1;
611}

◆ getExponent2()

template<typename S >
 S olb::IndicatorSuperEllipsoid3D< S >::getExponent2 ( ) const

Definition at line 614 of file indicatorF3D.hh.

615{
616 return _exp2;
617}

◆ getXHalfAxis()

template<typename S >
 S olb::IndicatorSuperEllipsoid3D< S >::getXHalfAxis ( ) const

Definition at line 590 of file indicatorF3D.hh.

591{
592 return _xHalfAxis;
593}

◆ getYHalfAxis()

template<typename S >
 S olb::IndicatorSuperEllipsoid3D< S >::getYHalfAxis ( ) const

Definition at line 596 of file indicatorF3D.hh.

597{
598 return _yHalfAxis;
599}

◆ getZHalfAxis()

template<typename S >
 S olb::IndicatorSuperEllipsoid3D< S >::getZHalfAxis ( ) const

Definition at line 602 of file indicatorF3D.hh.

603{
604 return _zHalfAxis;
605}

◆ operator()()

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

has to be implemented for 'every' derived class

Implements olb::GenericF< bool, S >.

Definition at line 620 of file indicatorF3D.hh.

621{
622 S a = util::pow ( util::abs( (input[0] - _center[0]) / _xHalfAxis ), _exp1 );
623 S b = util::pow ( util::abs( (input[1] - _center[1]) / _yHalfAxis ), _exp1 );
624 S c = util::pow ( util::abs( (input[2] - _center[2]) / _zHalfAxis ), _exp2 );
625 S ab = util::pow( a+b, _exp2/_exp1 );
626
627 if ( (ab+c) <= 1. ) {
628 output[0] = 1.;
629 return true;
630 }
631
632 output[0] = 0.;
633 return false;
634}
platform_constant int c[Q][D]