OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::SmoothIndicatorCuboid2D< T, S, PARTICLE > Class Template Referencefinal

implements a smooth cuboid in 2D with an _epsilon sector. More...

#include <smoothIndicatorF2D.h>

+ Inheritance diagram for olb::SmoothIndicatorCuboid2D< T, S, PARTICLE >:
+ Collaboration diagram for olb::SmoothIndicatorCuboid2D< T, S, PARTICLE >:

Public Member Functions

 SmoothIndicatorCuboid2D (IndicatorCuboid2D< S > &ind, S epsilon, S theta=0)
 
 SmoothIndicatorCuboid2D (Vector< S, 2 >center, S xLength, S yLength, S epsilon, S theta=0)
 
IndicatorCuboid2D< S > & getIndicator ()
 
Vector< S, 2 > surfaceNormal (const Vector< S, 2 > &pos, const S meshSize) override
 
const S signedDistance (const Vector< S, 2 > input) override
 
bool distance (S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, S precision, S pitch) override
 
S getArea () override
 
Vector< S, 2 > calcMofiAndMass (const S density) override
 
- Public Member Functions inherited from olb::SmoothIndicatorF2D< T, S, false >
void init ()
 
const Vector< S, 2 > & getMin () const
 
const Vector< S, 2 > & getMax () const
 
const Vector< S, 2 > & getPos () const
 
const Vector< S, 4 > & getRotationMatrix () const
 
const S & getCircumRadius () const
 
const S & getTheta () const
 
const S & getEpsilon () const
 
std::string name ()
 
void setPos (Vector< S, 2 > pos)
 
void setTheta (S theta)
 
void setEpsilon (S epsilon)
 
virtual Vector< S, 2 > surfaceNormal (const Vector< S, 2 > &pos, const S meshSize, std::function< Vector< S, 2 >(const Vector< S, 2 > &)> transformPos)
 
virtual const S signedDistance (const PhysR< T, 2 > input)
 
virtual bool operator() (T output[], const S input[])
 has to be implemented for 'every' derived class
 
bool isInsideCircumRadius (const PhysR< S, 2 > &input)
 
SmoothIndicatorF2D< T, S, false > & operator+ (SmoothIndicatorF2D< T, S, false > &rhs)
 
- Public Member Functions inherited from olb::AnalyticalF< D, T, S >
AnalyticalF< D, T, S > & operator- (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator+ (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator* (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator/ (AnalyticalF< D, T, S > &rhs)
 
- Public Member Functions inherited from olb::GenericF< T, 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() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], S input0)
 
bool operator() (T output[], S input0, S input1)
 
bool operator() (T output[], S input0, S input1, S input2)
 
bool operator() (T output[], S input0, S input1, S input2, S input3)
 

Additional Inherited Members

- Public Types inherited from olb::AnalyticalF< D, T, S >
using identity_functor_type = AnalyticalIdentity<D,T,S>
 
- Public Types inherited from olb::GenericF< T, S >
using targetType = T
 
using sourceType = S
 
- Public Attributes inherited from olb::GenericF< T, S >
std::shared_ptr< GenericF< T, S > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Static Public Attributes inherited from olb::AnalyticalF< D, T, S >
static constexpr unsigned dim = D
 
- Protected Member Functions inherited from olb::SmoothIndicatorF2D< T, S, false >
 SmoothIndicatorF2D ()
 
- Protected Member Functions inherited from olb::AnalyticalF< D, T, S >
 AnalyticalF (int n)
 
- Protected Member Functions inherited from olb::GenericF< T, S >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::SmoothIndicatorF2D< T, S, false >
Vector< S, 2 > _myMin
 
Vector< S, 2 > _myMax
 
Vector< S, 2 > _pos
 
Vector< S, 4 > _rotMat
 
S _circumRadius
 
S _theta
 
S _epsilon
 
std::string _name = "smoothIndicator2D"
 

Detailed Description

template<typename T, typename S, bool PARTICLE = false>
class olb::SmoothIndicatorCuboid2D< T, S, PARTICLE >

implements a smooth cuboid in 2D with an _epsilon sector.

Parameters
massTODO
epsilon
thetaTODO

Definition at line 52 of file smoothIndicatorF2D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorCuboid2D() [1/2]

template<typename T , typename S , bool PARTICLE>
olb::SmoothIndicatorCuboid2D< T, S, PARTICLE >::SmoothIndicatorCuboid2D ( IndicatorCuboid2D< S > & ind,
S epsilon,
S theta = 0 )

Definition at line 41 of file smoothIndicatorF2D.hh.

42 : SmoothIndicatorCuboid2D<T,S,PARTICLE>(ind.getCenter(), ind.getxLength(), ind.getyLength(), epsilon, theta)
43{ }
SmoothIndicatorCuboid2D(IndicatorCuboid2D< S > &ind, S epsilon, S theta=0)

◆ SmoothIndicatorCuboid2D() [2/2]

template<typename T , typename S , bool PARTICLE>
olb::SmoothIndicatorCuboid2D< T, S, PARTICLE >::SmoothIndicatorCuboid2D ( Vector< S, 2 > center,
S xLength,
S yLength,
S epsilon,
S theta = 0 )

Definition at line 46 of file smoothIndicatorF2D.hh.

47 : _ind(xLength, yLength, center)
48{
49 this->_epsilon = epsilon;
50 if constexpr (!PARTICLE) {
51 this->_pos = _ind.getCenter();
52 this->_theta = util::degreeToRadian(theta);
53 }
54
55 this->_circumRadius = .5*(util::sqrt(util::pow( xLength, 2)+util::pow( yLength, 2))) + 0.5*epsilon;
56 if constexpr (!PARTICLE) {
57 this->_myMin = {
58 this->_pos[0] - this->getCircumRadius(),
59 this->_pos[1] - this->getCircumRadius()
60 };
61 this->_myMax = {
62 this->_pos[0] + this->getCircumRadius(),
63 this->_pos[1] + this->getCircumRadius()
64 };
65 this->init();
66 }
67}
Vector< S, 2 > const & getCenter() const
Expr sqrt(Expr x)
Definition expr.cpp:225
Expr pow(Expr base, Expr exp)
Definition expr.cpp:235
decltype(Vector< decltype(util::sqrt(T())), D >()) degreeToRadian(const Vector< T, D > &angle)

References olb::SmoothIndicatorF2D< T, S, false >::_circumRadius, olb::SmoothIndicatorF2D< T, S, false >::_epsilon, olb::SmoothIndicatorF2D< T, S, false >::_myMax, olb::SmoothIndicatorF2D< T, S, false >::_myMin, olb::SmoothIndicatorF2D< T, S, false >::_pos, olb::SmoothIndicatorF2D< T, S, false >::_theta, olb::util::degreeToRadian(), olb::IndicatorCuboid2D< T >::getCenter(), olb::SmoothIndicatorF2D< T, S, false >::getCircumRadius(), olb::SmoothIndicatorF2D< T, S, false >::init(), olb::util::pow(), and olb::util::sqrt().

+ Here is the call graph for this function:

Member Function Documentation

◆ calcMofiAndMass()

template<typename T , typename S , bool PARTICLE>
Vector< S, 2 > olb::SmoothIndicatorCuboid2D< T, S, PARTICLE >::calcMofiAndMass ( const S density)
overridevirtual

Reimplemented from olb::SmoothIndicatorF2D< T, S, false >.

Definition at line 81 of file smoothIndicatorF2D.hh.

82{
83 const T xLength = _ind.getxLength();
84 const T yLength = _ind.getyLength();
85 const T mass = getArea()*density;
86 const T mofi = 1./12.*mass*(xLength*xLength+yLength*yLength);
87 return Vector<S,2>(mofi, mass);
88}
S const getxLength() const
S const getyLength() const

◆ distance()

template<typename T , typename S , bool PARTICLE>
bool olb::SmoothIndicatorCuboid2D< T, S, PARTICLE >::distance ( S & distance,
const Vector< S, 2 > & origin,
const Vector< S, 2 > & direction,
S precision,
S pitch )
overridevirtual

Reimplemented from olb::SmoothIndicatorF2D< T, S, false >.

Definition at line 111 of file smoothIndicatorF2D.hh.

112{
113 Vector<S,2> p;
114 if constexpr(!PARTICLE) {
115 // rotation & translation
116 p = util::executeRotation<S,2,true>(origin, this->_rotMat, this->getPos());
117 }
118 else {
119 p = origin;
120 }
121 return _ind.distance(distance, p, direction, precision, pitch);
122}
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
bool distance(S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, S precision, S pitch) override
Vector< T, D > executeRotation(const Vector< T, D > &input, const Vector< T, utilities::dimensions::convert< D >::matrix > &rotationMatrix, const Vector< T, D > &rotationCenter=Vector< T, D >(0.))
Rotates the input around the rotationCenter with a given rotationMatrix.

References olb::util::executeRotation().

+ Here is the call graph for this function:

◆ getArea()

template<typename T , typename S , bool PARTICLE>
S olb::SmoothIndicatorCuboid2D< T, S, PARTICLE >::getArea ( )
overridevirtual

Reimplemented from olb::SmoothIndicatorF2D< T, S, false >.

Definition at line 75 of file smoothIndicatorF2D.hh.

76{
77 return _ind.getxLength()*_ind.getyLength();
78}

References olb::IndicatorCuboid2D< T >::getxLength().

+ Here is the call graph for this function:

◆ getIndicator()

template<typename T , typename S , bool PARTICLE>
IndicatorCuboid2D< S > & olb::SmoothIndicatorCuboid2D< T, S, PARTICLE >::getIndicator ( )

Definition at line 70 of file smoothIndicatorF2D.hh.

70 {
71 return _ind;
72}

◆ signedDistance()

template<typename T , typename S , bool PARTICLE>
const S olb::SmoothIndicatorCuboid2D< T, S, PARTICLE >::signedDistance ( const Vector< S, 2 > input)
override

Definition at line 97 of file smoothIndicatorF2D.hh.

98{
99 Vector<S,2> p;
100 if constexpr(!PARTICLE) {
101 // rotation & translation
102 p = util::executeRotation<S,2,true>(input, this->_rotMat, this->getPos());
103 }
104 else {
105 p = input;
106 }
107 return _ind.signedDistance(p + _ind.getCenter());
108}
S signedDistance(const Vector< S, 2 > &input) override
Returns signed distance to the nearest point on the indicator surface Uses the fastest,...

References olb::util::executeRotation().

+ Here is the call graph for this function:

◆ surfaceNormal()

template<typename T , typename S , bool PARTICLE>
Vector< S, 2 > olb::SmoothIndicatorCuboid2D< T, S, PARTICLE >::surfaceNormal ( const Vector< S, 2 > & pos,
const S meshSize )
overridevirtual

Reimplemented from olb::SmoothIndicatorF2D< T, S, false >.

Definition at line 91 of file smoothIndicatorF2D.hh.

92{
93 return _ind.surfaceNormal(pos, meshSize);
94}
virtual Vector< S, 2 > surfaceNormal(const Vector< S, 2 > &pos, const S meshSize)
Return surface normal Uses the fastest, but potentially less accurate method.

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