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

#include <frameChangeF2D.h>

+ Inheritance diagram for olb::PowerLaw2D< T >:
+ Collaboration diagram for olb::PowerLaw2D< T >:

Public Member Functions

 PowerLaw2D (std::vector< T > axisPoint, std::vector< T > axisDirection, T maxVelocity, T radius, T exponent)
 
 PowerLaw2D (SuperGeometry< T, 2 > &superGeometry, int material, T maxVelocity, T distance2Wall, T exponent)
 construct from material number, note: untested
 
bool operator() (T output[], const T input[]) override
 
- 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
 
virtual bool operator() (T output[], const S input[])=0
 has to be implemented for 'every' derived class
 
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 Attributes

std::vector< T > _axisPoint
 
std::vector< T > _axisDirection
 
_maxVelocity
 
_radius
 
_exponent
 

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
 
- 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)
 

Detailed Description

template<typename T>
class olb::PowerLaw2D< T >

Definition at line 64 of file frameChangeF2D.h.

Constructor & Destructor Documentation

◆ PowerLaw2D() [1/2]

template<typename T >
olb::PowerLaw2D< T >::PowerLaw2D ( std::vector< T > axisPoint,
std::vector< T > axisDirection,
T maxVelocity,
T radius,
T exponent )

Definition at line 46 of file frameChangeF2D.hh.

46 : AnalyticalF2D<T,T>(2)
47{
48 this->getName() = "PowerLaw2D";
49 _axisPoint.resize(2);
50 _axisDirection.resize(2);
51 for (int i = 0; i < 2; ++i) {
52 _axisDirection[i] = axisDirection[i];
53 _axisPoint[i] = axisPoint[i];
54 }
55 _maxVelocity = maxVelocity;
56 _radius = radius;
57 _exponent = exponent;
58}
std::string & getName()
read and write access to name
Definition genericF.hh:51
std::vector< T > _axisDirection
std::vector< T > _axisPoint

References olb::PowerLaw2D< T >::_axisDirection, olb::PowerLaw2D< T >::_axisPoint, olb::PowerLaw2D< T >::_exponent, olb::PowerLaw2D< T >::_maxVelocity, olb::PowerLaw2D< T >::_radius, and olb::GenericF< T, S >::getName().

+ Here is the call graph for this function:

◆ PowerLaw2D() [2/2]

template<typename T >
olb::PowerLaw2D< T >::PowerLaw2D ( SuperGeometry< T, 2 > & superGeometry,
int material,
T maxVelocity,
T distance2Wall,
T exponent )

construct from material number, note: untested

Definition at line 61 of file frameChangeF2D.hh.

61 : AnalyticalF2D<T,T>(2)
62{
63 this->getName() = "PowerLaw2D";
64 _axisPoint.resize(2);
65 _axisDirection.resize(2);
66 _axisPoint = superGeometry.getStatistics().getCenterPhysR(material);
67 std::vector<int> discreteNormal = superGeometry.getStatistics().computeDiscreteNormal(material);
68 for (int i = 0; i < 2; ++i) {
69 _axisDirection[i] = discreteNormal[i];
70 }
71
72 _radius = T(distance2Wall);
73 for (int iD = 0; iD < 2; iD++) {
74 _radius += (superGeometry.getStatistics().getPhysRadius(material)[iD]);
75 }
76 _maxVelocity = maxVelocity;
77 _exponent = exponent;
78}
SuperGeometryStatistics< T, D > & getStatistics()
Returns the statistics object.

References olb::PowerLaw2D< T >::_axisDirection, olb::PowerLaw2D< T >::_axisPoint, olb::PowerLaw2D< T >::_exponent, olb::PowerLaw2D< T >::_maxVelocity, olb::PowerLaw2D< T >::_radius, olb::GenericF< T, S >::getName(), and olb::SuperGeometry< T, D >::getStatistics().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename T >
bool olb::PowerLaw2D< T >::operator() ( T output[],
const T input[] )
override

Definition at line 82 of file frameChangeF2D.hh.

83{
84 T d = util::fabs(_axisDirection[1]*(x[0] - _axisPoint[0]) - _axisDirection[0]*(x[1] - _axisPoint[1]));
85 output[0] = _maxVelocity*_axisDirection[0]*(1. - util::pow(d/_radius,_exponent));
86 output[1] = _maxVelocity*_axisDirection[1]*(1. - util::pow(d/_radius,_exponent));
87 if ( 1. - util::pow(d/_radius,_exponent) < 0.) {
88 output[0] = T();
89 output[1] = T();
90 }
91 return true;
92}
constexpr int d() any_platform
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112
cpu::simd::Pack< T > fabs(cpu::simd::Pack< T > value)
Definition pack.h:106

References olb::util::fabs(), and olb::util::pow().

+ Here is the call graph for this function:

Member Data Documentation

◆ _axisDirection

template<typename T >
std::vector<T> olb::PowerLaw2D< T >::_axisDirection
protected

Definition at line 67 of file frameChangeF2D.h.

◆ _axisPoint

template<typename T >
std::vector<T> olb::PowerLaw2D< T >::_axisPoint
protected

Definition at line 66 of file frameChangeF2D.h.

◆ _exponent

template<typename T >
T olb::PowerLaw2D< T >::_exponent
protected

Definition at line 70 of file frameChangeF2D.h.

◆ _maxVelocity

template<typename T >
T olb::PowerLaw2D< T >::_maxVelocity
protected

Definition at line 68 of file frameChangeF2D.h.

◆ _radius

template<typename T >
T olb::PowerLaw2D< T >::_radius
protected

Definition at line 69 of file frameChangeF2D.h.


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