OpenLB 1.8.1
Loading...
Searching...
No Matches
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
 
S getVolume () override
 
Vector< S, 4 > calcMofiAndMass (const S density) override
 
- Public Member Functions inherited from olb::SmoothIndicatorF3D< T, S, false >
void init ()
 
const Vector< S, 3 > & getMin () const
 
const Vector< S, 3 > & getMax () const
 
const Vector< S, 3 > & getPos () const
 
const Vector< S, 9 > & getRotationMatrix () const
 
const Vector< S, 3 > & getTheta () const
 
const S & getCircumRadius () const
 
const S & getEpsilon () const
 
std::string name ()
 
void setPos (Vector< S, 3 > pos)
 
void setTheta (Vector< S, 3 > theta)
 
void setEpsilon (S epsilon)
 
virtual Vector< S, 3 > calcCenterOfMass ()
 
virtual Vector< S, 3 > surfaceNormal (const Vector< S, 3 > &pos, const S meshSize, std::function< Vector< S, 3 >(const Vector< S, 3 > &)> transformPos)
 
virtual const S signedDistance (const PhysR< T, 3 > input)
 
virtual bool distance (S &distance, const Vector< S, 3 > &origin, const Vector< S, 3 > &direction, S precision, S pitch)
 
virtual bool operator() (T output[], const S input[])
 has to be implemented for 'every' derived class
 
bool isInsideCircumRadius (const PhysR< S, 3 > &input)
 
SmoothIndicatorF3D< T, S, false > & operator+ (SmoothIndicatorF3D< T, S, false > &rhs)
 
- Public Member Functions inherited from olb::AnalyticalF< D, T, S >
AnalyticalF< D, T, S > & operator- (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator+ (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator* (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator/ (AnalyticalF< D, T, S > &rhs)
 
- Public Member Functions inherited from olb::GenericF< T, S >
virtual ~GenericF ()=default
 
int getSourceDim () const
 read only access to member variable _m
 
int getTargetDim () const
 read only access to member variable _n
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
bool operator() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], S input0)
 
bool operator() (T output[], S input0, S input1)
 
bool operator() (T output[], S input0, S input1, S input2)
 
bool operator() (T output[], S input0, S input1, S input2, S input3)
 

Additional Inherited Members

- Public Types inherited from olb::AnalyticalF< D, T, S >
using identity_functor_type = AnalyticalIdentity<D,T,S>
 
- Public Types inherited from olb::GenericF< T, S >
using targetType = T
 
using sourceType = S
 
- Public Attributes inherited from olb::GenericF< T, S >
std::shared_ptr< GenericF< T, S > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Static Public Attributes inherited from olb::AnalyticalF< D, T, S >
static constexpr unsigned dim = D
 
- Protected Member Functions inherited from olb::SmoothIndicatorF3D< T, S, false >
 SmoothIndicatorF3D ()
 
- Protected Member Functions inherited from olb::AnalyticalF< D, T, S >
 AnalyticalF (int n)
 
- Protected Member Functions inherited from olb::GenericF< T, S >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::SmoothIndicatorF3D< T, S, false >
Vector< S, 3 > _myMin
 
Vector< S, 3 > _myMax
 
Vector< S, 3 > _pos
 
Vector< S, 9 > _rotMat
 
S _circumRadius
 
Vector< S, 3 > _theta
 
S _epsilon
 
std::string _name = "smoothIndicator3D"
 

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 49 of file smoothIndicatorF3D.hh.

51 :SmoothIndicatorCuboid3D(ind.getxLength(), ind.getyLength(), ind.getzLength(), ind.getCenter(), epsilon, theta)
52{ }
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 55 of file smoothIndicatorF3D.hh.

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

References olb::SmoothIndicatorF3D< T, S, false >::_circumRadius, olb::SmoothIndicatorF3D< T, S, false >::_epsilon, olb::SmoothIndicatorF3D< T, S, false >::_myMax, olb::SmoothIndicatorF3D< T, S, false >::_myMin, olb::SmoothIndicatorF3D< T, S, false >::_pos, olb::SmoothIndicatorF3D< T, S, false >::_theta, olb::util::degreeToRadian(), olb::IndicatorCuboid3D< T >::getCenter(), olb::SmoothIndicatorF3D< T, S, false >::getCircumRadius(), olb::SmoothIndicatorF3D< T, S, false >::init(), 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)
overridevirtual

Reimplemented from olb::SmoothIndicatorF3D< T, S, false >.

Definition at line 94 of file smoothIndicatorF3D.hh.

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

◆ getIndicator()

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

Definition at line 83 of file smoothIndicatorF3D.hh.

83 {
84 return _ind;
85}

◆ getVolume()

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

Reimplemented from olb::SmoothIndicatorF3D< T, S, false >.

Definition at line 88 of file smoothIndicatorF3D.hh.

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

References olb::IndicatorCuboid3D< T >::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 117 of file smoothIndicatorF3D.hh.

118{
119 Vector<S,3> p;
120 if constexpr(!PARTICLE) {
121 // counter-clockwise rotation by _theta=-theta around the current position of the center of mass & translation
122 p = util::executeRotation<S,3,true>(input, this->_rotMat, this->getPos());
123 }
124 else {
125 p = input;
126 }
127 return _ind.signedDistance(p + _ind.getCenter());
128}
S signedDistance(const Vector< S, 3 > &input) override
Returns signed distance to the nearest point on the indicator surface.
Vector< T, D > executeRotation(const Vector< T, D > &input, const Vector< T, utilities::dimensions::convert< D >::matrix > &rotationMatrix, const Vector< T, D > &rotationCenter=Vector< T, D >(0.))
Rotates the input around the rotationCenter with a given rotationMatrix.

References olb::util::executeRotation().

+ Here is the call graph for this function:

◆ 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 )
overridevirtual

Reimplemented from olb::SmoothIndicatorF3D< T, S, false >.

Definition at line 111 of file smoothIndicatorF3D.hh.

112{
113 return _ind.surfaceNormal(pos, meshSize);
114}
virtual Vector< S, 3 > surfaceNormal(const Vector< S, 3 > &pos, const S meshSize)
Return surface normal Uses the fastest, but potentially less accurate method.

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