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

factorizable output smooth circle in 2D with a tangiant or ramp epsilon sector More...

#include <smoothIndicatorF2D.h>

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

Public Member Functions

 SmoothIndicatorFactoredCircle2D (Vector< S, 2 > center, S radius, S epsilon, S density=0, Vector< S, 2 > vel=Vector< S, 2 >(0., 0.), S omega=0, S factor=1.)
 
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::SmoothIndicatorFactoredCircle2D< T, S, PARTICLE >

factorizable output smooth circle in 2D with a tangiant or ramp epsilon sector

Definition at line 174 of file smoothIndicatorF2D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorFactoredCircle2D()

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

Definition at line 544 of file smoothIndicatorF2D.hh.

545 : _radius(radius), _factor(factor)
546{
547 this->_epsilon = epsilon;
548 if constexpr (!PARTICLE) {
549 this->_pos = center;
550 }
551
552 this->_circumRadius = radius + 0.5*epsilon;
553 if constexpr (!PARTICLE) {
554 this->_myMin = {center[0] - this->getCircumRadius(), center[1] - this->getCircumRadius()};
555 this->_myMax = {center[0] + this->getCircumRadius(), center[1] + this->getCircumRadius()};
556 this->init();
557 }
558}

Member Function Documentation

◆ calcMofiAndMass()

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

Definition at line 561 of file smoothIndicatorF2D.hh.

562{
563 T mass = M_PI*_radius*_radius*density;
564 T mofi = 0.5 * mass * _radius * _radius;
565 return Vector<S,2>(mofi, mass);
566}
#define M_PI

References M_PI.

◆ operator()()

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

Definition at line 570 of file smoothIndicatorF2D.hh.

571{
572 double distToCenter2 = util::pow(this->getPos()[0]-input[0], 2) +
573 util::pow(this->getPos()[1]-input[1], 2);
574 /*double d = util::sqrt(distToCenter2) - this->_radius + this->getEpsilon()/2;
575
576 if(d <= 0){
577 output[0] = T(this->_factor);
578 return true;
579 }
580 else if(d > 0 && d <= this->getEpsilon()){
581 output[0] = T(- this->_factor*(d-this->getEpsilon())/this->getEpsilon());
582 return true;
583 }
584 else{
585 output[0] = 0;
586 return false;
587 }*/
588
589 double d = util::sqrt(distToCenter2) - this->_radius;
590 output[0] = T(this->_factor*(1.-tanh(d/this->getEpsilon()))/2.);
591 return true;
592}
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: