OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::SmoothIndicatorTriangle2D< T, S, PARTICLE > Class Template Referencefinal

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

#include <smoothIndicatorF2D.h>

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

Public Member Functions

 SmoothIndicatorTriangle2D (IndicatorEquiTriangle2D< S > &indPtr, S epsilon, S theta=0)
 
 SmoothIndicatorTriangle2D (Vector< S, 2 >center, S radius, S epsilon, S theta=0)
 
IndicatorEquiTriangle2D< 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
 
getArea () override
 
Vector< S, 2 > calcMofiAndMass (const S density) override
 

Detailed Description

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

implements a smooth triangle in 2D with an _epsilon sector

Definition at line 84 of file smoothIndicatorF2D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorTriangle2D() [1/2]

template<typename T , typename S , bool PARTICLE>
olb::SmoothIndicatorTriangle2D< T, S, PARTICLE >::SmoothIndicatorTriangle2D ( IndicatorEquiTriangle2D< S > & indPtr,
S epsilon,
S theta = 0 )

Definition at line 196 of file smoothIndicatorF2D.hh.

197 : SmoothIndicatorTriangle2D(ind.getCenter(), ind.getRadius(), epsilon, theta)
198{ }
SmoothIndicatorTriangle2D(IndicatorEquiTriangle2D< S > &indPtr, S epsilon, S theta=0)

◆ SmoothIndicatorTriangle2D() [2/2]

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

Definition at line 201 of file smoothIndicatorF2D.hh.

202 : _ind(center, radius)
203{
204 this->_epsilon = epsilon;
205 if constexpr (!PARTICLE) {
206 this->_pos = _ind.getCenter();
207 this->_theta = util::degreeToRadian(theta);
208 }
209
210 this->_circumRadius = radius + 0.5*epsilon;
211 if constexpr (!PARTICLE) {
212 this->_myMin = {center[0] - this->getCircumRadius(), center[1] - this->getCircumRadius()};
213 this->_myMax = {center[0] + this->getCircumRadius(), center[1] + this->getCircumRadius()};
214 this->init();
215 }
216}
decltype(Vector< decltype(util::sqrt(T())), D >()) degreeToRadian(const Vector< T, D > &angle)

References olb::util::degreeToRadian().

+ Here is the call graph for this function:

Member Function Documentation

◆ calcMofiAndMass()

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

Definition at line 233 of file smoothIndicatorF2D.hh.

234{
235 const T radius = _ind.getRadius();
236 const T altitude = 1.5*radius;
237 const T base = util::sqrt(3)*radius;
238 const T mass = density*getArea();
239 const T mofi = mass*((altitude*altitude/18.)+(base*base/24.));
240 return Vector<S,2>(mofi, mass);
241}
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100

References olb::util::sqrt().

+ Here is the call graph for this function:

◆ distance()

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

Definition at line 264 of file smoothIndicatorF2D.hh.

265{
266 Vector<S,2> p;
267 if constexpr(!PARTICLE) {
268 // rotation
269 p = util::executeRotation<S,2>(origin, this->_rotMat, this->getPos());
270 // translation
271 p -= this->getPos();
272 }
273 else {
274 p = origin;
275 }
276 return _ind.distance(distance, p, direction, precision, pitch);
277}
bool distance(S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, S precision, S pitch) override

◆ getArea()

template<typename T , typename S , bool PARTICLE>
S olb::SmoothIndicatorTriangle2D< T, S, PARTICLE >::getArea ( )
override

Definition at line 224 of file smoothIndicatorF2D.hh.

225{
226 const T radius = _ind.getRadius();
227 const T altitude = 1.5*radius;
228 const T base = util::sqrt(3)*radius;
229 return 0.5*base*altitude;
230}

References olb::IndicatorEquiTriangle2D< S >::getRadius(), and olb::util::sqrt().

+ Here is the call graph for this function:

◆ getIndicator()

template<typename T , typename S , bool PARTICLE>
IndicatorEquiTriangle2D< S > & olb::SmoothIndicatorTriangle2D< T, S, PARTICLE >::getIndicator ( )

Definition at line 219 of file smoothIndicatorF2D.hh.

219 {
220 return _ind;
221}

◆ signedDistance()

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

Definition at line 250 of file smoothIndicatorF2D.hh.

251{
252 Vector<S,2> p;
253 if constexpr(!PARTICLE) {
254 // rotation & translation
255 p = util::executeRotation<S,2,true>(input, this->_rotMat, this->getPos());
256 }
257 else {
258 p = input;
259 }
260 return _ind.signedDistance(p + _ind.getCenter());
261}

◆ surfaceNormal()

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

Definition at line 244 of file smoothIndicatorF2D.hh.

245{
246 return _ind.surfaceNormal(pos, meshSize);
247}

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