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

implements a smooth circle in 2D with an _epsilon sector More...

#include <smoothIndicatorF2D.h>

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

Public Member Functions

 SmoothIndicatorCircle2D (IndicatorCircle2D< S > &indPtr, S epsilon)
 
 SmoothIndicatorCircle2D (Vector< S, 2 >center, S radius, S epsilon)
 
IndicatorCircle2D< S > & getIndicator ()
 
Vector< S, 2 > surfaceNormal (const Vector< S, 2 > &pos, const S meshSize) override
 
const S signedDistance (const Vector< S, 2 > input) override
 
bool distance (S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, S precision, S pitch) override
 
getArea () override
 
Vector< S, 2 > calcMofiAndMass (const S density) override
 

Detailed Description

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

implements a smooth circle in 2D with an _epsilon sector

Definition at line 68 of file smoothIndicatorF2D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorCircle2D() [1/2]

template<typename T , typename S , bool PARTICLE>
olb::SmoothIndicatorCircle2D< T, S, PARTICLE >::SmoothIndicatorCircle2D ( IndicatorCircle2D< S > & indPtr,
S epsilon )

Definition at line 126 of file smoothIndicatorF2D.hh.

127 : SmoothIndicatorCircle2D(ind.getCenter(), ind.getRadius(), epsilon)
128{ }
SmoothIndicatorCircle2D(IndicatorCircle2D< S > &indPtr, S epsilon)

◆ SmoothIndicatorCircle2D() [2/2]

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

Definition at line 131 of file smoothIndicatorF2D.hh.

132 : _ind(center, radius)
133{
134 this->_epsilon = epsilon;
135 if constexpr (!PARTICLE) {
136 this->_pos = _ind.getCenter();
137 }
138
139 this->_circumRadius = radius + 0.5*epsilon;
140 if constexpr (!PARTICLE) {
141 this->_myMin = {this->_pos[0] - this->getCircumRadius(), this->_pos[1] - this->getCircumRadius()};
142 this->_myMax = {this->_pos[0] + this->getCircumRadius(), this->_pos[1] + this->getCircumRadius()};
143 this->_theta = 0.;
144 this->init();
145 }
146}

Member Function Documentation

◆ calcMofiAndMass()

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

Definition at line 160 of file smoothIndicatorF2D.hh.

161{
162 const T radius = _ind.getRadius();
163 const T mass = getArea()*density;
164 const T mofi = 0.5 * mass * radius * radius;
165 return Vector<S,2>(mofi, mass);
166}

◆ distance()

template<typename T , typename S , bool PARTICLE>
bool olb::SmoothIndicatorCircle2D< T, S, PARTICLE >::distance ( S & distance,
const Vector< S, 2 > & origin,
const Vector< S, 2 > & direction,
S precision,
S pitch )
override

Definition at line 185 of file smoothIndicatorF2D.hh.

186{
187 Vector<S,2> dist = origin;
188 if constexpr(!PARTICLE) {
189 dist -= this->_pos;
190 }
191 return _ind.distance(distance, dist, direction, precision, pitch);
192}
bool distance(S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, S precision, S pitch) override

◆ getArea()

template<typename T , typename S , bool PARTICLE>
S olb::SmoothIndicatorCircle2D< T, S, PARTICLE >::getArea ( )
override

Definition at line 154 of file smoothIndicatorF2D.hh.

155{
156 return M_PI*_ind.getRadius()*_ind.getRadius();
157}
#define M_PI

References olb::IndicatorCircle2D< S >::getRadius(), and M_PI.

+ Here is the call graph for this function:

◆ getIndicator()

template<typename T , typename S , bool PARTICLE>
IndicatorCircle2D< S > & olb::SmoothIndicatorCircle2D< T, S, PARTICLE >::getIndicator ( )

Definition at line 149 of file smoothIndicatorF2D.hh.

149 {
150 return _ind;
151}

◆ signedDistance()

template<typename T , typename S , bool PARTICLE>
const S olb::SmoothIndicatorCircle2D< T, S, PARTICLE >::signedDistance ( const Vector< S, 2 > input)
override

Definition at line 175 of file smoothIndicatorF2D.hh.

176{
177 Vector<S,2> dist = input;
178 if constexpr(!PARTICLE) {
179 dist -= this->_pos;
180 }
181 return _ind.signedDistance(dist + _ind.getCenter());
182}

◆ surfaceNormal()

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

Definition at line 169 of file smoothIndicatorF2D.hh.

170{
171 return _ind.surfaceNormal(pos, meshSize);
172}

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