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

3D//////////////////////////////////////////// AnalyticalLinear3D: 3D -> 1D troughout given points (x0,y0,z0,v0), (x1,y1,z1,v1), (x2,y2,z2,v2), (x3,y3,z3,v3) More...

#include <analyticalF.h>

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

Public Member Functions

 AnalyticalLinear3D (T a, T b, T c, T d)
 
 AnalyticalLinear3D (S x0, S y0, S z0, T v0, S x1, S y1, S z1, T v1, S x2, S y2, S z2, T v2, S x3, S y3, S z3, T v3)
 
bool operator() (T output[], const S x[]) override
 has to be implemented for 'every' derived class
 
- 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 Attributes

_a
 
_b
 
_c
 
_d
 

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, typename S>
class olb::AnalyticalLinear3D< T, S >

3D//////////////////////////////////////////// AnalyticalLinear3D: 3D -> 1D troughout given points (x0,y0,z0,v0), (x1,y1,z1,v1), (x2,y2,z2,v2), (x3,y3,z3,v3)

Definition at line 531 of file analyticalF.h.

Constructor & Destructor Documentation

◆ AnalyticalLinear3D() [1/2]

template<typename T , typename S >
olb::AnalyticalLinear3D< T, S >::AnalyticalLinear3D ( T a,
T b,
T c,
T d )

Definition at line 571 of file analyticalF.hh.

572 : AnalyticalF3D<T,S>(1), _a(a), _b(b), _c(c), _d(d)
573{
574 this->getName() = "linear";
575}
std::string & getName()
read and write access to name
Definition genericF.hh:51

References olb::GenericF< T, S >::getName().

+ Here is the call graph for this function:

◆ AnalyticalLinear3D() [2/2]

template<typename T , typename S >
olb::AnalyticalLinear3D< T, S >::AnalyticalLinear3D ( S x0,
S y0,
S z0,
T v0,
S x1,
S y1,
S z1,
T v1,
S x2,
S y2,
S z2,
T v2,
S x3,
S y3,
S z3,
T v3 )

Definition at line 578 of file analyticalF.hh.

580 : AnalyticalF3D<T,S>(1)
581{
582 this->getName() = "linear";
583 T n = ( (y3-y0)*(x1-x0)-(x3-x0)*(y1-y0) ) * ( (x2-x0)*(z1-z0)-(z2-z0)*(x1-x0) )
584 +( (z3-z0)*(x1-x0)-(x3-x0)*(z1-z0) ) * ( (y2-y0)*(x1-x0)-(x2-x0)*(y1-y0) );
585 if ( util::nearZero(n) ) {
586 std::cout << "Error function" << std::endl;
587 }
588 else {
589 T w = ( (y1-y0)*(x3-x0)-(x1-x0)*(y3-y0) ) * ( (v2-v0)-(x2-x0)*(v1-v0) / (x1-x0) )
590 /( (y2-y0)*(x1-x0)-(x2-x0)*(y1-y0) ) + (v3-v0) - (x3-x0)*(v1-v0) / (x1-x0);
591 T zx = (y1-y0)*( (x2-x0)*(z1-z0)-(z2-z0)*(x1-x0) )
592 -(z1-z0)*( (y2-y0)*(x1-x0)-(x2-x0)*(y1-y0) );
593 T rx = (v1-v0)/(x1-x0) - (y1-y0)*(v2-v0) / ( (y2-y0)*(x1-x0)-(x2-x0)*(y1-y0) )
594 +(y1-y0)*(x2-x0)*(v1-v0) / ( (y2-y0)*(x1-x0)*(x1-x0)-(x2-x0)*(y1-y0)*(x1-x0) );
595 T zy = (x1-x0)*( (x2-x0)*(z1-z0)-(z2-z0)*(x1-x0) );
596 T ry = ( (x1-x0)*(v2-v0)-(x2-x0)*(v1-v0) ) / ( (y2-y0)*(x1-x0)-(x2-x0)*(y1-y0) );
597 T zz = (x1-x0)*( (y2-y0)*(x1-x0)-(x2-x0)*(y1-y0) );
598 T h = w/n;
599 _a = rx + zx*h;
600 _b = ry + zy*h;
601 _c = zz*h;
602 _d = v0 - x0*_a - y0*_b - z0*_c;
603 }
604}
bool nearZero(const ADf< T, DIM > &a)
Definition aDiff.h:1087

References olb::AnalyticalLinear3D< T, S >::_a, olb::AnalyticalLinear3D< T, S >::_b, olb::AnalyticalLinear3D< T, S >::_c, olb::AnalyticalLinear3D< T, S >::_d, olb::GenericF< T, S >::getName(), and olb::util::nearZero().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename T , typename S >
bool olb::AnalyticalLinear3D< T, S >::operator() ( T output[],
const S input[] )
overridevirtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, S >.

Definition at line 607 of file analyticalF.hh.

608{
609 output[0]=_a*x[0] + _b*x[1] + _c*x[2] + _d;
610 return true;
611}

Member Data Documentation

◆ _a

template<typename T , typename S >
T olb::AnalyticalLinear3D< T, S >::_a
protected

Definition at line 533 of file analyticalF.h.

◆ _b

template<typename T , typename S >
T olb::AnalyticalLinear3D< T, S >::_b
protected

Definition at line 534 of file analyticalF.h.

◆ _c

template<typename T , typename S >
T olb::AnalyticalLinear3D< T, S >::_c
protected

Definition at line 535 of file analyticalF.h.

◆ _d

template<typename T , typename S >
T olb::AnalyticalLinear3D< T, S >::_d
protected

Definition at line 536 of file analyticalF.h.


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