OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
olb::SmoothIndicatorF3D< T, S, true > 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, true >:
+ Collaboration diagram for olb::SmoothIndicatorF3D< T, S, true >:

Public Member Functions

const S & getCircumRadius () const
 
const S & getEpsilon () const
 
std::string name ()
 
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)
 
- 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

_circumRadius
 
_epsilon
 
std::string _name ="3D-Particle surface"
 

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, true >

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

Base class for specific SmoothIndicator implementation providing common data..

Definition at line 101 of file smoothIndicatorBaseF3D.h.

Constructor & Destructor Documentation

◆ SmoothIndicatorF3D()

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

Member Function Documentation

◆ calcCenterOfMass()

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

Definition at line 380 of file smoothIndicatorBaseF3D.hh.

381{
382 // TODO: Fallback
383 assert(false);
384 return S(std::numeric_limits<BaseType<S>>::quiet_NaN());
385}

◆ calcMofiAndMass()

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

Definition at line 372 of file smoothIndicatorBaseF3D.hh.

373{
374 // TODO: Fallback
375 assert(false);
376 return S(std::numeric_limits<BaseType<S>>::quiet_NaN());
377}

◆ distance()

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

Definition at line 293 of file smoothIndicatorBaseF3D.hh.

294{
295 S const halfEps = this->getEpsilon() * 0.5;
296 bool originValue;
297 bool currentValue;
298
299 // start at origin and move into given direction
300 PhysR<S,3> currentPoint(origin);
301
302 originValue = this->signedDistance(origin) <= halfEps;
303 currentValue = this->signedDistance(currentPoint) <= halfEps;
304
305 while (currentValue == originValue && this->isInsideCircumRadius(currentPoint)) {
306 currentPoint += direction;
307 // update currentValue until the first point on the other side (inside/outside) is found
308 currentValue = this->signedDistance(currentPoint) <= halfEps;
309 }
310
311 // return false if no point was found in given direction
312 if (!this->isInsideCircumRadius(currentPoint) && !originValue) {
313 return false;
314 }
315
316
317 while (pitch >= precision) {
318 if (!this->isInsideCircumRadius(currentPoint) && originValue) {
319 currentPoint -= pitch * direction;
320 pitch /= 2.;
321 }
322 else {
323 currentValue = this->signedDistance(currentPoint) <= halfEps;
324 if (currentValue == originValue) {
325 currentPoint += pitch * direction;
326 pitch /= 2.;
327 }
328 else {
329 currentPoint -= pitch * direction;
330 pitch /= 2.;
331 }
332 }
333 }
334
335 distance = norm(currentPoint - origin);
336 return true;
337}
bool isInsideCircumRadius(const PhysR< S, 3 > &input)
virtual bool distance(S &distance, const Vector< S, 3 > &origin, const Vector< S, 3 > &direction, S precision, S pitch)
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, true >::getCircumRadius ( ) const

Definition at line 340 of file smoothIndicatorBaseF3D.hh.

341{
342 return _circumRadius;
343}

◆ getEpsilon()

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

Definition at line 346 of file smoothIndicatorBaseF3D.hh.

347{
348 return _epsilon;
349}

◆ getVolume()

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

Definition at line 364 of file smoothIndicatorBaseF3D.hh.

365{
366 // TODO: Fallback
367 assert(false);
368 return std::numeric_limits<double>::quiet_NaN();
369}

◆ isInsideCircumRadius()

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

Definition at line 262 of file smoothIndicatorBaseF3D.hh.

263{
264 return norm(input) <= this->getCircumRadius();
265}

References olb::norm().

+ Here is the call graph for this function:

◆ name()

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

Definition at line 352 of file smoothIndicatorBaseF3D.hh.

353{
354 return _name;
355}

◆ operator()()

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

has to be implemented for 'every' derived class

Implements olb::GenericF< T, S >.

Definition at line 251 of file smoothIndicatorBaseF3D.hh.

252{
253#ifdef OLB_DEBUG
254 OstreamManager clout(std::cout, "SmoothIndicator3D");
255 clout << "WARNING: SmoothIndicatorF3D::operator() a particle (= true) SmoothIndicator does not consider the current position of the particle. Please use the evalSolidVolumeFraction method for this." << std::endl;
256#endif
257 T const signedDist = this->signedDistance(input);
258 return sdf::evalSolidVolumeFraction(output, signedDist, this->getEpsilon());
259}
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:

◆ setEpsilon()

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

Definition at line 358 of file smoothIndicatorBaseF3D.hh.

359{
360 _epsilon = epsilon;
361}

◆ signedDistance()

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

Definition at line 285 of file smoothIndicatorBaseF3D.hh.

286{
287 // TODO: Raymarching as fallback
288 assert(false);
289 return std::numeric_limits<double>::quiet_NaN();
290}

◆ surfaceNormal() [1/2]

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

Definition at line 268 of file smoothIndicatorBaseF3D.hh.

269{
270 return surfaceNormal(pos, meshSize, [&](const Vector<S,3>& pos) {
271 return pos;
272 });
273}
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, true >::surfaceNormal ( const Vector< S, 3 > & pos,
const S meshSize,
std::function< Vector< S, 3 >(const Vector< S, 3 > &)> transformPos )
virtual

Definition at line 276 of file smoothIndicatorBaseF3D.hh.

278{
279 return util::surfaceNormal(pos, meshSize, [&](const Vector<S,3>& pos) {
280 return this->signedDistance( transformPos(pos) );
281 });
282}
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, true >::_circumRadius
protected

Definition at line 104 of file smoothIndicatorBaseF3D.h.

◆ _epsilon

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

Definition at line 105 of file smoothIndicatorBaseF3D.h.

◆ _name

template<typename T , typename S >
std::string olb::SmoothIndicatorF3D< T, S, true >::_name ="3D-Particle surface"
protected

Definition at line 106 of file smoothIndicatorBaseF3D.h.


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