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

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

#include <smoothIndicatorF3D.h>

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

Public Member Functions

 SmoothIndicatorCylinder3D (IndicatorCylinder3D< S > &ind, S epsilon, Vector< S, 3 > theta=Vector< S, 3 >(0., 0., 0.))
 
 SmoothIndicatorCylinder3D (Vector< S, 3 > center1, Vector< S, 3 > center2, S radius, S epsilon, Vector< S, 3 > theta=Vector< S, 3 >(0., 0., 0.))
 
 SmoothIndicatorCylinder3D (Vector< S, 3 > center, Vector< S, 3 > normal, S radius, S height, S epsilon, Vector< S, 3 > theta=Vector< S, 3 >(0., 0., 0.))
 
IndicatorCylinder3D< 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::SmoothIndicatorCylinder3D< T, S, PARTICLE >

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

Definition at line 112 of file smoothIndicatorF3D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorCylinder3D() [1/3]

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

Definition at line 490 of file smoothIndicatorF3D.hh.

491 : SmoothIndicatorCylinder3D(ind.getCenter1(), ind.getCenter2(), ind.getRadius(), epsilon, theta)
492{ }
SmoothIndicatorCylinder3D(IndicatorCylinder3D< S > &ind, S epsilon, Vector< S, 3 > theta=Vector< S, 3 >(0., 0., 0.))

◆ SmoothIndicatorCylinder3D() [2/3]

template<typename T , typename S , bool PARTICLE>
olb::SmoothIndicatorCylinder3D< T, S, PARTICLE >::SmoothIndicatorCylinder3D ( Vector< S, 3 > center1,
Vector< S, 3 > center2,
S radius,
S epsilon,
Vector< S, 3 > theta = Vector<S,3> (0.,0.,0.) )

Definition at line 495 of file smoothIndicatorF3D.hh.

496 : _ind(center1, center2, radius)
497{
498 this->_epsilon = epsilon;
499 if constexpr (!PARTICLE) {
500 this->_pos = 0.5 * (_ind.getCenter1() + _ind.getCenter2());
501 this->_theta = util::degreeToRadian(theta);
502 }
503 Vector<T,3> dist = _ind.getCenter2() - _ind.getCenter1();
504 S const length = norm(dist);
505 if constexpr (!PARTICLE) {
506 initIndicatorCylinder3D(this->_theta, length);
507 }
508 else {
509 initIndicatorCylinder3D(Vector<T,3>(0.), length);
510 }
511
512}
decltype(Vector< decltype(util::sqrt(T())), D >()) degreeToRadian(const Vector< T, D > &angle)
constexpr T norm(const ScalarVector< T, D, IMPL > &a)
Euclidean vector norm.

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

+ Here is the call graph for this function:

◆ SmoothIndicatorCylinder3D() [3/3]

template<typename T , typename S , bool PARTICLE>
olb::SmoothIndicatorCylinder3D< T, S, PARTICLE >::SmoothIndicatorCylinder3D ( Vector< S, 3 > center,
Vector< S, 3 > normal,
S radius,
S height,
S epsilon,
Vector< S, 3 > theta = Vector<S,3> (0.,0.,0.) )

Definition at line 515 of file smoothIndicatorF3D.hh.

516 : SmoothIndicatorCylinder3D(center-.5*height*normalize(normal), center+.5*height*normalize(normal), radius, epsilon, theta)
517{ }
constexpr Vector< T, D > normalize(const ScalarVector< T, D, IMPL > &a, T scale=T{1})
Definition vector.h:245

Member Function Documentation

◆ calcMofiAndMass()

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

Definition at line 528 of file smoothIndicatorF3D.hh.

529{
530 Vector<T,3> dist = _ind.getCenter2() - _ind.getCenter1();
531 S const length = norm(dist);
532 T const radius2 = _ind.getRadius() * _ind.getRadius();
533 T const mass = getVolume()*density;
534 Vector<S,3> mofi;
535 mofi[0] = 0.5*mass*radius2;
536 mofi[1] = 1/12.*mass*(length*length+3.*radius2);
537 mofi[2] = 1/12.*mass*(length*length+3.*radius2);
538 return Vector<S,4>(mofi[0], mofi[1], mofi[2], mass);
539}

References olb::norm().

+ Here is the call graph for this function:

◆ getIndicator()

template<typename T , typename S , bool PARTICLE>
IndicatorCylinder3D< S > & olb::SmoothIndicatorCylinder3D< T, S, PARTICLE >::getIndicator ( )

Definition at line 485 of file smoothIndicatorF3D.hh.

485 {
486 return _ind;
487}

◆ getVolume()

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

Definition at line 520 of file smoothIndicatorF3D.hh.

521{
522 const Vector<T,3> dist = _ind.getCenter2() - _ind.getCenter1();
523 S const length = norm(dist);
524 return M_PI*_ind.getRadius()*_ind.getRadius()*length;
525}
#define M_PI

References M_PI, and olb::norm().

+ Here is the call graph for this function:

◆ signedDistance()

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

Definition at line 548 of file smoothIndicatorF3D.hh.

549{
550 Vector<S,3> p;
551 if constexpr(!PARTICLE) {
552 // counter-clockwise rotation by _theta=-theta around the current position of the center of mass & translation
553 p = util::executeRotation<S,3,true>(input, this->_rotMat, this->getPos());
554 }
555 else {
556 p = input;
557 }
558
559 // moving to indicator coordinate system by adding start position coordinate
560 return _ind.signedDistance(p + 0.5 * (_ind.getCenter2() + _ind.getCenter1()));
561}

◆ surfaceNormal()

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

Definition at line 542 of file smoothIndicatorF3D.hh.

543{
544 return _ind.surfaceNormal(pos, meshSize);
545}

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