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

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

#include <smoothIndicatorF2D.h>

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

Public Member Functions

 SmoothIndicatorHTCircle2D (Vector< S, 2 > center, S radius, S epsilon, S density=0, Vector< S, 2 > vel=Vector< S, 2 >(0., 0.), S omega=0)
 
bool operator() (T output[], const S input[]) override
 
Vector< S, 2 > calcMofiAndMass (const S density) override
 

Detailed Description

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

implements a smooth circle in 2D with an tangiant _epsilon sector

Definition at line 163 of file smoothIndicatorF2D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorHTCircle2D()

template<typename T , typename S , bool PARTICLE>
olb::SmoothIndicatorHTCircle2D< T, S, PARTICLE >::SmoothIndicatorHTCircle2D ( Vector< S, 2 > center,
S radius,
S epsilon,
S density = 0,
Vector< S, 2 > vel = Vector<S,2> (0.,0.),
S omega = 0 )

Definition at line 501 of file smoothIndicatorF2D.hh.

502 : _radius(radius)
503{
504 this->_epsilon = epsilon;
505 if constexpr (!PARTICLE) {
506 this->_pos = center;
507 }
508
509 this->_circumRadius = radius + 0.5*epsilon;
510 if constexpr (!PARTICLE) {
511 this->_myMin = {center[0] - this->getCircumRadius(), center[1] - this->getCircumRadius()};
512 this->_myMax = {center[0] + this->getCircumRadius(), center[1] + this->getCircumRadius()};
513 this->_theta = 0.;
514 this->init();
515 }
516
517 T mass = M_PI*radius*radius*density;
518 T mofi = 0.5 * mass * radius * radius;
519}
#define M_PI

References M_PI.

Member Function Documentation

◆ calcMofiAndMass()

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

Definition at line 522 of file smoothIndicatorF2D.hh.

523{
524 T mass = M_PI*_radius*_radius*density;
525 T mofi = 0.5 * mass * _radius * _radius;
526 return Vector<S,2>(mofi, mass);
527}

References M_PI.

◆ operator()()

template<typename T , typename S , bool PARTICLE>
bool olb::SmoothIndicatorHTCircle2D< T, S, PARTICLE >::operator() ( T output[],
const S input[] )
override

Definition at line 531 of file smoothIndicatorF2D.hh.

532{
533 double distToCenter2 = util::pow(this->getPos()[0]-input[0], 2) +
534 util::pow(this->getPos()[1]-input[1], 2);
535
536
537 double d = util::sqrt(distToCenter2) - this->_radius;
538 output[0] = T((1.-tanh(d/this->getEpsilon()))/2.);
539 return true;
540}
constexpr int d() any_platform
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112
ADf< T, DIM > tanh(const ADf< T, DIM > &a)
Definition aDiff.h:663

References olb::util::pow(), and olb::util::sqrt().

+ Here is the call graph for this function:

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