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

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

#include <smoothIndicatorBaseF2D.h>

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

Public Member Functions

void init ()
 
const Vector< S, 2 > & getMin () const
 
const Vector< S, 2 > & getMax () const
 
const Vector< S, 2 > & getPos () const
 
const Vector< S, 4 > & getRotationMatrix () const
 
const S & getCircumRadius () const
 
const S & getTheta () const
 
const S & getEpsilon () const
 
std::string name ()
 
void setPos (Vector< S, 2 > pos)
 
void setTheta (S theta)
 
void setEpsilon (S epsilon)
 
virtual S getArea ()
 
virtual Vector< S, 2 > calcMofiAndMass (S density)
 
virtual Vector< S, 2 > surfaceNormal (const Vector< S, 2 > &pos, const S meshSize)
 
virtual Vector< S, 2 > surfaceNormal (const Vector< S, 2 > &pos, const S meshSize, std::function< Vector< S, 2 >(const Vector< S, 2 > &)> transformPos)
 
virtual const S signedDistance (const PhysR< T, 2 > input)
 
virtual bool distance (S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &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, 2 > &input)
 
SmoothIndicatorF2D< T, S, false > & operator+ (SmoothIndicatorF2D< 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

 SmoothIndicatorF2D ()
 
- 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, 2 > _myMin
 
Vector< S, 2 > _myMax
 
Vector< S, 2 > _pos
 
Vector< S, 4 > _rotMat
 
_circumRadius
 
_theta
 
_epsilon
 
std::string _name = "smoothIndicator2D"
 

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::SmoothIndicatorF2D< T, S, false >

SmoothIndicatorF2D 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 46 of file smoothIndicatorBaseF2D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorF2D()

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

Member Function Documentation

◆ calcMofiAndMass()

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

Definition at line 122 of file smoothIndicatorBaseF2D.hh.

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

◆ distance()

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

Definition at line 155 of file smoothIndicatorBaseF2D.hh.

156{
157 S const halfEps = this->getEpsilon() * 0.5;
158 bool originValue;
159 bool currentValue;
160
161 // start at origin and move into given direction
162 PhysR<S,2> currentPoint(origin);
163
164 originValue = this->signedDistance(origin) <= halfEps;
165 currentValue = this->signedDistance(currentPoint) <= halfEps;
166
167 while (currentValue == originValue && this->isInsideCircumRadius(currentPoint)) {
168 currentPoint += direction;
169 // update currentValue until the first point on the other side (inside/outside) is found
170 currentValue = this->signedDistance(currentPoint) <= halfEps;
171 }
172
173 // return false if no point was found in given direction
174 if (!this->isInsideCircumRadius(currentPoint) && !originValue) {
175 return false;
176 }
177
178
179 while (pitch >= precision) {
180 if (!this->isInsideCircumRadius(currentPoint) && originValue) {
181 currentPoint -= pitch * direction;
182 pitch /= 2.;
183 }
184 else {
185 currentValue = this->signedDistance(currentPoint) <= halfEps;
186 if (currentValue == originValue) {
187 currentPoint += pitch * direction;
188 pitch /= 2.;
189 }
190 else {
191 currentPoint -= pitch * direction;
192 pitch /= 2.;
193 }
194 }
195 }
196
197 distance = norm(currentPoint - origin);
198 return true;
199}
virtual const S signedDistance(const PhysR< T, 2 > input)
bool isInsideCircumRadius(const PhysR< S, 2 > &input)
virtual bool distance(S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, S precision, S pitch)
constexpr T norm(const ScalarVector< T, D, IMPL > &a)
Euclidean vector norm.

References olb::norm().

+ Here is the call graph for this function:

◆ getArea()

template<typename T , typename S >
S olb::SmoothIndicatorF2D< T, S, false >::getArea ( )
virtual

Definition at line 114 of file smoothIndicatorBaseF2D.hh.

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

◆ getCircumRadius()

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

Definition at line 71 of file smoothIndicatorBaseF2D.hh.

72{
73 return _circumRadius;
74}

◆ getEpsilon()

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

Definition at line 83 of file smoothIndicatorBaseF2D.hh.

84{
85 return _epsilon;
86}

◆ getMax()

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

Definition at line 53 of file smoothIndicatorBaseF2D.hh.

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

◆ getMin()

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

Definition at line 47 of file smoothIndicatorBaseF2D.hh.

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

◆ getPos()

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

Definition at line 59 of file smoothIndicatorBaseF2D.hh.

60{
61 return _pos;
62}

◆ getRotationMatrix()

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

Definition at line 65 of file smoothIndicatorBaseF2D.hh.

66{
67 return _rotMat;
68}

◆ getTheta()

template<typename T , typename S >
const S & olb::SmoothIndicatorF2D< T, S, false >::getTheta ( ) const

Definition at line 77 of file smoothIndicatorBaseF2D.hh.

78{
79 return _theta;
80}

◆ init()

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

Definition at line 41 of file smoothIndicatorBaseF2D.hh.

42{
43 _rotMat = util::calculateInverseRotationMatrix<T,2>( Vector<T,1>(this->_theta) );
44}

◆ isInsideCircumRadius()

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

Definition at line 209 of file smoothIndicatorBaseF2D.hh.

210{
211 return norm(input) <= this->getCircumRadius();
212}

References olb::norm().

+ Here is the call graph for this function:

◆ name()

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

Definition at line 89 of file smoothIndicatorBaseF2D.hh.

◆ operator()()

template<typename T , typename S >
bool olb::SmoothIndicatorF2D< 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::SmoothIndicatorIdentity2D< T, S >.

Definition at line 202 of file smoothIndicatorBaseF2D.hh.

203{
204 T const signedDist = this->signedDistance(input);
205 return sdf::evalSolidVolumeFraction(output, signedDist, this->getEpsilon());
206}
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 >
SmoothIndicatorF2D< T, S, false > & olb::SmoothIndicatorF2D< T, S, false >::operator+ ( SmoothIndicatorF2D< T, S, false > & rhs)

◆ setEpsilon()

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

Definition at line 108 of file smoothIndicatorBaseF2D.hh.

109{
110 _epsilon = epsilon;
111}

◆ setPos()

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

Definition at line 95 of file smoothIndicatorBaseF2D.hh.

96{
97 _pos = pos;
98}

◆ setTheta()

template<typename T , typename S >
void olb::SmoothIndicatorF2D< T, S, false >::setTheta ( S theta)

Definition at line 101 of file smoothIndicatorBaseF2D.hh.

102{
103 _theta = theta;
104 init();
105}

◆ signedDistance()

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

Definition at line 147 of file smoothIndicatorBaseF2D.hh.

148{
149 // TODO: Raymarching as fallback
150 assert(false);
151 return std::numeric_limits<double>::quiet_NaN();
152}

◆ surfaceNormal() [1/2]

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

Definition at line 130 of file smoothIndicatorBaseF2D.hh.

131{
132 return surfaceNormal(pos, meshSize, [&](const Vector<S,2>& pos) {
133 return pos;
134 });
135}
virtual Vector< S, 2 > surfaceNormal(const Vector< S, 2 > &pos, const S meshSize)

◆ surfaceNormal() [2/2]

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

Definition at line 138 of file smoothIndicatorBaseF2D.hh.

140{
141 return util::surfaceNormal(pos, meshSize, [&](const Vector<S,2>& pos) {
142 return this->signedDistance( transformPos(pos) );
143 });
144}
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::SmoothIndicatorF2D< T, S, false >::_circumRadius
protected

Definition at line 53 of file smoothIndicatorBaseF2D.h.

◆ _epsilon

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

Definition at line 55 of file smoothIndicatorBaseF2D.h.

◆ _myMax

template<typename T , typename S >
Vector<S,2> olb::SmoothIndicatorF2D< T, S, false >::_myMax
protected

Definition at line 50 of file smoothIndicatorBaseF2D.h.

◆ _myMin

template<typename T , typename S >
Vector<S,2> olb::SmoothIndicatorF2D< T, S, false >::_myMin
protected

Definition at line 49 of file smoothIndicatorBaseF2D.h.

◆ _name

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

Definition at line 56 of file smoothIndicatorBaseF2D.h.

◆ _pos

template<typename T , typename S >
Vector<S,2> olb::SmoothIndicatorF2D< T, S, false >::_pos
protected

Definition at line 51 of file smoothIndicatorBaseF2D.h.

◆ _rotMat

template<typename T , typename S >
Vector<S,4> olb::SmoothIndicatorF2D< T, S, false >::_rotMat
protected

Definition at line 52 of file smoothIndicatorBaseF2D.h.

◆ _theta

template<typename T , typename S >
S olb::SmoothIndicatorF2D< T, S, false >::_theta
protected

Definition at line 54 of file smoothIndicatorBaseF2D.h.


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