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

SmoothIndicatorF3D is an application from $ \Omega \subset R^3 \to [0,1] $. More...

#include <smoothIndicatorBaseF3D.h>

+ Inheritance diagram for olb::SmoothIndicatorF3D< T, S, false >:
+ Collaboration diagram for olb::SmoothIndicatorF3D< T, S, false >:

Public Member Functions

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 S getVolume ()
 
virtual Vector< S, 4 > calcMofiAndMass (S density)
 
virtual Vector< S, 3 > calcCenterOfMass ()
 
virtual Vector< S, 3 > surfaceNormal (const Vector< S, 3 > &pos, const S meshSize)
 
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)
 

Protected Member Functions

 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

Vector< S, 3 > _myMin
 
Vector< S, 3 > _myMax
 
Vector< S, 3 > _pos
 
Vector< S, 9 > _rotMat
 
_circumRadius
 
Vector< S, 3 > _theta
 
_epsilon
 
std::string _name = "smoothIndicator3D"
 

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
 

Detailed Description

template<typename T, typename S>
class olb::SmoothIndicatorF3D< T, S, false >

SmoothIndicatorF3D is an application from $ \Omega \subset R^3 \to [0,1] $.

Parameters
_myMinholds minimal(component wise) vector of the domain $ \Omega $.
_myMaxholds maximal(component wise) vector of the domain $ \Omega $.
_center
_diam_

Definition at line 47 of file smoothIndicatorBaseF3D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorF3D()

template<typename T , typename S >
olb::SmoothIndicatorF3D< T, S, false >::SmoothIndicatorF3D ( )
protected

Member Function Documentation

◆ calcCenterOfMass()

template<typename T , typename S >
Vector< S, 3 > olb::SmoothIndicatorF3D< T, S, false >::calcCenterOfMass ( )
virtual

Definition at line 132 of file smoothIndicatorBaseF3D.hh.

133{
134 // TODO: Fallback
135 assert(false);
136 return Vector<S,3>(std::numeric_limits<BaseType<S>>::quiet_NaN());
137}

◆ calcMofiAndMass()

template<typename T , typename S >
Vector< S, 4 > olb::SmoothIndicatorF3D< T, S, false >::calcMofiAndMass ( S density)
virtual

Definition at line 124 of file smoothIndicatorBaseF3D.hh.

125{
126 // TODO: Fallback
127 assert(false);
128 return Vector<S,4>(std::numeric_limits<BaseType<S>>::quiet_NaN());
129}

◆ distance()

template<typename T , typename S >
bool olb::SmoothIndicatorF3D< T, S, false >::distance ( S & distance,
const Vector< S, 3 > & origin,
const Vector< S, 3 > & direction,
S precision,
S pitch )
virtual

Definition at line 178 of file smoothIndicatorBaseF3D.hh.

179{
180 S const halfEps = this->getEpsilon() * 0.5;
181 bool originValue;
182 bool currentValue;
183
184 // start at origin and move into given direction
185 PhysR<S,3> currentPoint(origin);
186
187 originValue = this->signedDistance(origin) <= halfEps;
188 currentValue = this->signedDistance(currentPoint) <= halfEps;
189
190 while (currentValue == originValue && this->isInsideCircumRadius(currentPoint)) {
191 currentPoint += direction;
192 // update currentValue until the first point on the other side (inside/outside) is found
193 currentValue = this->signedDistance(currentPoint) <= halfEps;
194 }
195
196 // return false if no point was found in given direction
197 if (!this->isInsideCircumRadius(currentPoint) && !originValue) {
198 return false;
199 }
200
201
202 while (pitch >= precision) {
203 if (!this->isInsideCircumRadius(currentPoint) && originValue) {
204 currentPoint -= pitch * direction;
205 pitch /= 2.;
206 }
207 else {
208 currentValue = this->signedDistance(currentPoint) <= halfEps;
209 if (currentValue == originValue) {
210 currentPoint += pitch * direction;
211 pitch /= 2.;
212 }
213 else {
214 currentPoint -= pitch * direction;
215 pitch /= 2.;
216 }
217 }
218 }
219
220 distance = norm(currentPoint - origin);
221 return true;
222}
virtual bool distance(S &distance, const Vector< S, 3 > &origin, const Vector< S, 3 > &direction, S precision, S pitch)
bool isInsideCircumRadius(const PhysR< S, 3 > &input)
virtual const S signedDistance(const PhysR< T, 3 > input)
constexpr T norm(const ScalarVector< T, D, IMPL > &a)
Euclidean vector norm.

References olb::norm().

+ Here is the call graph for this function:

◆ getCircumRadius()

template<typename T , typename S >
const S & olb::SmoothIndicatorF3D< T, S, false >::getCircumRadius ( ) const

Definition at line 67 of file smoothIndicatorBaseF3D.hh.

68{
69 return _circumRadius;
70}

◆ getEpsilon()

template<typename T , typename S >
const S & olb::SmoothIndicatorF3D< T, S, false >::getEpsilon ( ) const

Definition at line 85 of file smoothIndicatorBaseF3D.hh.

86{
87 return _epsilon;
88}

◆ getMax()

template<typename T , typename S >
const Vector< S, 3 > & olb::SmoothIndicatorF3D< T, S, false >::getMax ( ) const

Definition at line 55 of file smoothIndicatorBaseF3D.hh.

56{
57 return _myMax;
58}
+ Here is the caller graph for this function:

◆ getMin()

template<typename T , typename S >
const Vector< S, 3 > & olb::SmoothIndicatorF3D< T, S, false >::getMin ( ) const

Definition at line 49 of file smoothIndicatorBaseF3D.hh.

50{
51 return _myMin;
52}
+ Here is the caller graph for this function:

◆ getPos()

template<typename T , typename S >
const Vector< S, 3 > & olb::SmoothIndicatorF3D< T, S, false >::getPos ( ) const

Definition at line 61 of file smoothIndicatorBaseF3D.hh.

62{
63 return _pos;
64}

◆ getRotationMatrix()

template<typename T , typename S >
const Vector< S, 9 > & olb::SmoothIndicatorF3D< T, S, false >::getRotationMatrix ( ) const

Definition at line 73 of file smoothIndicatorBaseF3D.hh.

74{
75 return _rotMat;
76}

◆ getTheta()

template<typename T , typename S >
const Vector< S, 3 > & olb::SmoothIndicatorF3D< T, S, false >::getTheta ( ) const

Definition at line 79 of file smoothIndicatorBaseF3D.hh.

80{
81 return _theta;
82}

◆ getVolume()

template<typename T , typename S >
S olb::SmoothIndicatorF3D< T, S, false >::getVolume ( )
virtual

Definition at line 116 of file smoothIndicatorBaseF3D.hh.

117{
118 // TODO: Fallback
119 assert(false);
120 return S(std::numeric_limits<BaseType<S>>::quiet_NaN());
121}

◆ init()

template<typename T , typename S >
void olb::SmoothIndicatorF3D< T, S, false >::init ( )

Definition at line 43 of file smoothIndicatorBaseF3D.hh.

44{
45 _rotMat = util::calculateInverseRotationMatrix<T,3>( this->_theta );
46}

◆ isInsideCircumRadius()

template<typename T , typename S >
bool olb::SmoothIndicatorF3D< T, S, false >::isInsideCircumRadius ( const PhysR< S, 3 > & input)

Definition at line 147 of file smoothIndicatorBaseF3D.hh.

148{
149 return norm(input-this->getPos()) <= this->getCircumRadius();
150}

References olb::norm().

+ Here is the call graph for this function:

◆ name()

template<typename T , typename S >
std::string olb::SmoothIndicatorF3D< T, S, false >::name ( )

Definition at line 91 of file smoothIndicatorBaseF3D.hh.

◆ operator()()

template<typename T , typename S >
bool olb::SmoothIndicatorF3D< T, S, false >::operator() ( T output[],
const S input[] )
virtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, S >.

Reimplemented in olb::SmoothIndicatorIdentity3D< T, S >.

Definition at line 140 of file smoothIndicatorBaseF3D.hh.

141{
142 T const signedDist = this->signedDistance(input);
143 return sdf::evalSolidVolumeFraction(output, signedDist, this->getEpsilon());
144}
bool evalSolidVolumeFraction(T output[], T signedDist, T eps) any_platform
Definition sdf.h:453

References olb::sdf::evalSolidVolumeFraction().

+ Here is the call graph for this function:

◆ operator+()

template<typename T , typename S >
SmoothIndicatorF3D< T, S, false > & olb::SmoothIndicatorF3D< T, S, false >::operator+ ( SmoothIndicatorF3D< T, S, false > & rhs)

◆ setEpsilon()

template<typename T , typename S >
void olb::SmoothIndicatorF3D< T, S, false >::setEpsilon ( S epsilon)

Definition at line 110 of file smoothIndicatorBaseF3D.hh.

111{
112 _epsilon = epsilon;
113}

◆ setPos()

template<typename T , typename S >
void olb::SmoothIndicatorF3D< T, S, false >::setPos ( Vector< S, 3 > pos)

Definition at line 97 of file smoothIndicatorBaseF3D.hh.

98{
99 _pos = pos;
100}

◆ setTheta()

template<typename T , typename S >
void olb::SmoothIndicatorF3D< T, S, false >::setTheta ( Vector< S, 3 > theta)

Definition at line 103 of file smoothIndicatorBaseF3D.hh.

104{
105 _theta = theta;
106 init();
107}

◆ signedDistance()

template<typename T , typename S >
const S olb::SmoothIndicatorF3D< T, S, false >::signedDistance ( const PhysR< T, 3 > input)
virtual

Definition at line 170 of file smoothIndicatorBaseF3D.hh.

171{
172 // TODO: Raymarching as fallback
173 assert(false);
174 return std::numeric_limits<double>::quiet_NaN();
175}

◆ surfaceNormal() [1/2]

template<typename T , typename S >
Vector< S, 3 > olb::SmoothIndicatorF3D< T, S, false >::surfaceNormal ( const Vector< S, 3 > & pos,
const S meshSize )
virtual

Definition at line 153 of file smoothIndicatorBaseF3D.hh.

154{
155 return surfaceNormal(pos, meshSize, [&](const Vector<S,3>& pos) {
156 return pos;
157 });
158}
virtual Vector< S, 3 > surfaceNormal(const Vector< S, 3 > &pos, const S meshSize)

◆ surfaceNormal() [2/2]

template<typename T , typename S >
Vector< S, 3 > olb::SmoothIndicatorF3D< T, S, false >::surfaceNormal ( const Vector< S, 3 > & pos,
const S meshSize,
std::function< Vector< S, 3 >(const Vector< S, 3 > &)> transformPos )
virtual

Definition at line 161 of file smoothIndicatorBaseF3D.hh.

163{
164 return util::surfaceNormal(pos, meshSize, [&](const Vector<S,3>& pos) {
165 return this->signedDistance( transformPos(pos) );
166 });
167}
Vector< S, D > surfaceNormal(const Vector< S, D > &pos, const S meshSize, F1 sdf)

References olb::util::surfaceNormal().

+ Here is the call graph for this function:

Member Data Documentation

◆ _circumRadius

template<typename T , typename S >
S olb::SmoothIndicatorF3D< T, S, false >::_circumRadius
protected

Definition at line 55 of file smoothIndicatorBaseF3D.h.

◆ _epsilon

template<typename T , typename S >
S olb::SmoothIndicatorF3D< T, S, false >::_epsilon
protected

Definition at line 58 of file smoothIndicatorBaseF3D.h.

◆ _myMax

template<typename T , typename S >
Vector<S,3> olb::SmoothIndicatorF3D< T, S, false >::_myMax
protected

Definition at line 52 of file smoothIndicatorBaseF3D.h.

◆ _myMin

template<typename T , typename S >
Vector<S,3> olb::SmoothIndicatorF3D< T, S, false >::_myMin
protected

Definition at line 51 of file smoothIndicatorBaseF3D.h.

◆ _name

template<typename T , typename S >
std::string olb::SmoothIndicatorF3D< T, S, false >::_name = "smoothIndicator3D"
protected

Definition at line 59 of file smoothIndicatorBaseF3D.h.

◆ _pos

template<typename T , typename S >
Vector<S,3> olb::SmoothIndicatorF3D< T, S, false >::_pos
protected

Definition at line 53 of file smoothIndicatorBaseF3D.h.

◆ _rotMat

template<typename T , typename S >
Vector<S,9> olb::SmoothIndicatorF3D< T, S, false >::_rotMat
protected

Definition at line 54 of file smoothIndicatorBaseF3D.h.

◆ _theta

template<typename T , typename S >
Vector<S,3> olb::SmoothIndicatorF3D< T, S, false >::_theta
protected

Definition at line 56 of file smoothIndicatorBaseF3D.h.


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