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

factorizable output smooth sphere in 3D with a tangiant or ramp epsilon sector More...

#include <smoothIndicatorF3D.h>

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

Public Member Functions

 SmoothIndicatorFactoredCircle3D (Vector< S, 3 > center, S radius, S epsilon, S density=0, Vector< S, 3 > vel=Vector< S, 3 >(0., 0., 0.), S omega=0, S factor=1.)
 
bool operator() (T output[], const S input[]) override
 
Vector< S, 4 > calcMofiAndMass (const S density) override
 

Detailed Description

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

factorizable output smooth sphere in 3D with a tangiant or ramp epsilon sector

Definition at line 196 of file smoothIndicatorF3D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorFactoredCircle3D()

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

Definition at line 951 of file smoothIndicatorF3D.hh.

952 : _radius(radius), _factor(factor)
953{
954 this->_epsilon = epsilon;
955 if constexpr (!PARTICLE) {
956 this->_pos = center;
957 }
958
959 this->_circumRadius = radius + 0.5*epsilon;
960 if constexpr (!PARTICLE) {
961 this->_myMin = {center[0] - this->getCircumRadius(), center[1] - this->getCircumRadius(), center[2] - this->getCircumRadius()};
962 this->_myMax = {center[0] + this->getCircumRadius(), center[1] + this->getCircumRadius(), center[2] + this->getCircumRadius()};
963 this->init();
964 }
965}

Member Function Documentation

◆ calcMofiAndMass()

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

Definition at line 968 of file smoothIndicatorF3D.hh.

969{
970 T mass = 4/3*M_PI*_radius*_radius*_radius*density;
971 Vector<S,3> mofi;
972 mofi[0] = 2./5.*mass*_radius*_radius;
973 mofi[1] = 2./5.*mass*_radius*_radius;
974 mofi[2] = 2./5.*mass*_radius*_radius;
975 return Vector<S,4>(mofi[0], mofi[1], mofi[2], mass);
976}
#define M_PI

References M_PI.

◆ operator()()

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

Definition at line 980 of file smoothIndicatorF3D.hh.

981{
982 double distToCenter2 = util::pow(this->getPos()[0]-input[0], 2) +
983 util::pow(this->getPos()[1]-input[1], 2) +
984 util::pow(this->getPos()[2]-input[2], 2);
985 /*double d = util::sqrt(distToCenter2) - this->_radius + this->getEpsilon()/2;
986
987 if(d <= 0){
988 output[0] = T(this->_factor);
989 return true;
990 }
991 else if(d > 0 && d <= this->getEpsilon()){
992 output[0] = T(- this->_factor*(d-this->getEpsilon())/this->getEpsilon());
993 return true;
994 }
995 else{
996 output[0] = 0;
997 return false;
998 }*/
999
1000 double d = util::sqrt(distToCenter2) - this->_radius;
1001 output[0] = T(this->_factor*(1.-tanh(d/this->getEpsilon()))/2.);
1002 return true;
1003}
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: