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

implements a smooth sphere in 3D with an _epsilon sector More...

#include <smoothIndicatorF3D.h>

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

Public Member Functions

 SmoothIndicatorSphere3D (IndicatorSphere3D< S > &ind, S epsilon)
 
 SmoothIndicatorSphere3D (Vector< S, 3 > center, S radius, S epsilon)
 
IndicatorSphere3D< S > & getIndicator ()
 
Vector< S, 3 > surfaceNormal (const Vector< S, 3 > &pos, const S meshSize) override
 
const S signedDistance (const PhysR< S, 3 > input) override
 
getVolume () override
 
Vector< S, 4 > calcMofiAndMass (const S density) override
 

Detailed Description

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

implements a smooth sphere in 3D with an _epsilon sector

Definition at line 97 of file smoothIndicatorF3D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorSphere3D() [1/2]

template<typename T , typename S , bool PARTICLE>
olb::SmoothIndicatorSphere3D< T, S, PARTICLE >::SmoothIndicatorSphere3D ( IndicatorSphere3D< S > & ind,
S epsilon )

Definition at line 393 of file smoothIndicatorF3D.hh.

394 : SmoothIndicatorSphere3D(ind.getCenter(), ind.getRadius(), epsilon)
395{ }
SmoothIndicatorSphere3D(IndicatorSphere3D< S > &ind, S epsilon)

◆ SmoothIndicatorSphere3D() [2/2]

template<typename T , typename S , bool PARTICLE>
olb::SmoothIndicatorSphere3D< T, S, PARTICLE >::SmoothIndicatorSphere3D ( Vector< S, 3 > center,
S radius,
S epsilon )

Definition at line 398 of file smoothIndicatorF3D.hh.

399 : _ind(center, radius)
400{
401 this->_epsilon = epsilon;
402 if constexpr (!PARTICLE) {
403 this->_pos = center;
404 }
405
406 this->_circumRadius = radius + 0.5*epsilon;
407 if constexpr (!PARTICLE) {
408 this->_myMin = {
409 this->_pos[0] - this->getCircumRadius(),
410 this->_pos[1] - this->getCircumRadius(),
411 this->_pos[2] - this->getCircumRadius()
412 };
413 this->_myMax = {
414 this->_pos[0] + this->getCircumRadius(),
415 this->_pos[1] + this->getCircumRadius(),
416 this->_pos[2] + this->getCircumRadius()
417 };
418 this->_theta = Vector<T,3>(0.,0.,0.);
419 this->init();
420 }
421}

Member Function Documentation

◆ calcMofiAndMass()

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

Definition at line 435 of file smoothIndicatorF3D.hh.

436{
437 T const radius = _ind.getRadius();
438 T const radius2 = radius*radius;
439 T const mass = getVolume()*density;
440 Vector<S,3> mofi;
441 mofi[0] = 2./5.*mass*radius2;
442 mofi[1] = 2./5.*mass*radius2;
443 mofi[2] = 2./5.*mass*radius2;
444 return Vector<S,4>(mofi[0], mofi[1], mofi[2], mass);
445}

◆ getIndicator()

template<typename T , typename S , bool PARTICLE>
IndicatorSphere3D< S > & olb::SmoothIndicatorSphere3D< T, S, PARTICLE >::getIndicator ( )

Definition at line 424 of file smoothIndicatorF3D.hh.

424 {
425 return _ind;
426}

◆ getVolume()

template<typename T , typename S , bool PARTICLE>
S olb::SmoothIndicatorSphere3D< T, S, PARTICLE >::getVolume ( )
override

Definition at line 429 of file smoothIndicatorF3D.hh.

430{
431 return 4./3.*M_PI*util::pow(_ind.getRadius(), 3);
432}
#define M_PI
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112

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

+ Here is the call graph for this function:

◆ signedDistance()

template<typename T , typename S , bool PARTICLE>
const S olb::SmoothIndicatorSphere3D< T, S, PARTICLE >::signedDistance ( const PhysR< S, 3 > input)
override

Definition at line 454 of file smoothIndicatorF3D.hh.

455{
456 // only translation necessary
457 Vector<S,3> dist = input + _ind.getCenter();
458 if constexpr (!PARTICLE) {
459 dist -= this->_pos;
460 }
461 return _ind.signedDistance(dist);
462}

◆ surfaceNormal()

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

Definition at line 448 of file smoothIndicatorF3D.hh.

449{
450 return _ind.surfaceNormal(pos, meshSize);
451}

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