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

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

#include <smoothIndicatorF3D.h>

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

Public Member Functions

 SmoothIndicatorCuboid3D (IndicatorCuboid3D< S > &ind, S epsilon, Vector< S, 3 > theta=Vector< S, 3 >(0., 0., 0.))
 
 SmoothIndicatorCuboid3D (S xLength, S yLength, S zLength, Vector< S, 3 > center, S epsilon, Vector< S, 3 > theta=Vector< S, 3 >(0., 0., 0.))
 
IndicatorCuboid3D< 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::SmoothIndicatorCuboid3D< T, S, PARTICLE >

implements a smooth particle cuboid in 3D with an _epsilon sector.

Definition at line 43 of file smoothIndicatorF3D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorCuboid3D() [1/2]

template<typename T , typename S , bool PARTICLE>
olb::SmoothIndicatorCuboid3D< T, S, PARTICLE >::SmoothIndicatorCuboid3D ( IndicatorCuboid3D< S > & ind,
S epsilon,
Vector< S, 3 > theta = Vector<S,3> (0.,0.,0.) )

Definition at line 50 of file smoothIndicatorF3D.hh.

52 :SmoothIndicatorCuboid3D(ind.getxLength(), ind.getyLength(), ind.getzLength(), ind.getCenter(), epsilon, theta)
53{ }
SmoothIndicatorCuboid3D(IndicatorCuboid3D< S > &ind, S epsilon, Vector< S, 3 > theta=Vector< S, 3 >(0., 0., 0.))

◆ SmoothIndicatorCuboid3D() [2/2]

template<typename T , typename S , bool PARTICLE>
olb::SmoothIndicatorCuboid3D< T, S, PARTICLE >::SmoothIndicatorCuboid3D ( S xLength,
S yLength,
S zLength,
Vector< S, 3 > center,
S epsilon,
Vector< S, 3 > theta = Vector<S,3> (0.,0.,0.) )

Definition at line 56 of file smoothIndicatorF3D.hh.

58 :_ind(xLength, yLength, zLength, center)
59{
60 this->_epsilon = epsilon;
61 if constexpr (!PARTICLE) {
62 this->_pos = _ind.getCenter();
63 this->_theta = util::degreeToRadian(theta);
64 }
65
66 this->_circumRadius = .5*(util::sqrt(xLength*xLength+yLength*yLength+zLength*zLength))+0.5*epsilon;
67 if constexpr (!PARTICLE) {
68 this->_myMin = {
69 this->_pos[0] - this->getCircumRadius(),
70 this->_pos[1] - this->getCircumRadius(),
71 this->_pos[2] - this->getCircumRadius()
72 };
73
74 this->_myMax = {
75 this->_pos[0] + this->getCircumRadius(),
76 this->_pos[1] + this->getCircumRadius(),
77 this->_pos[2] + this->getCircumRadius()
78 };
79 this->init();
80 }
81}
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
decltype(Vector< decltype(util::sqrt(T())), D >()) degreeToRadian(const Vector< T, D > &angle)

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

+ Here is the call graph for this function:

Member Function Documentation

◆ calcMofiAndMass()

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

Definition at line 95 of file smoothIndicatorF3D.hh.

96{
97 T const xLength = _ind.getxLength();
98 T const yLength = _ind.getyLength();
99 T const zLength = _ind.getzLength();
100 T const mass = getVolume()*density;
101 T const xLength2 = xLength*xLength;
102 T const yLength2 = yLength*yLength;
103 T const zLength2 = zLength*zLength;
104 Vector<S,3> mofi;
105 mofi[0] = 1./12.*mass*(yLength2+zLength2);
106 mofi[1] = 1./12.*mass*(xLength2+zLength2);
107 mofi[2] = 1./12.*mass*(yLength2+xLength2);
108 return Vector<S,4>(mofi[0], mofi[1], mofi[2], mass);
109}

◆ getIndicator()

template<typename T , typename S , bool PARTICLE>
IndicatorCuboid3D< S > & olb::SmoothIndicatorCuboid3D< T, S, PARTICLE >::getIndicator ( )

Definition at line 84 of file smoothIndicatorF3D.hh.

84 {
85 return _ind;
86}

◆ getVolume()

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

Definition at line 89 of file smoothIndicatorF3D.hh.

90{
91 return _ind.getxLength()*_ind.getyLength()*_ind.getzLength();
92}

References olb::IndicatorCuboid3D< S >::getxLength().

+ Here is the call graph for this function:

◆ signedDistance()

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

Definition at line 118 of file smoothIndicatorF3D.hh.

119{
120 Vector<S,3> p;
121 if constexpr(!PARTICLE) {
122 // counter-clockwise rotation by _theta=-theta around the current position of the center of mass & translation
123 p = util::executeRotation<S,3,true>(input, this->_rotMat, this->getPos());
124 }
125 else {
126 p = input;
127 }
128 return _ind.signedDistance(p + _ind.getCenter());
129}

◆ surfaceNormal()

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

Definition at line 112 of file smoothIndicatorF3D.hh.

113{
114 return _ind.surfaceNormal(pos, meshSize);
115}

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