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

AnalyticalLinear2D: 2D -> 1D troughout given points (x0,y0,v0), (x1,y1,v1), (x2,y2,v2) More...

#include <analyticalF.h>

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

Public Types

template<typename V , typename U >
using exchange_type = AnalyticalLinear2D<V,U>
 
- 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 Member Functions

 AnalyticalLinear2D (T a, T b, T c)
 
 AnalyticalLinear2D (S x0, S y0, T v0, S x1, S y1, T v1, S x2, S y2, T v2)
 
bool operator() (T output[], const S x[]) override
 has to be implemented for 'every' derived class
 
template<typename V , typename U >
auto copyAs () const
 
- 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
 

Additional Inherited Members

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

AnalyticalLinear2D: 2D -> 1D troughout given points (x0,y0,v0), (x1,y1,v1), (x2,y2,v2)

Definition at line 496 of file analyticalF.h.

Member Typedef Documentation

◆ exchange_type

template<typename T , typename S >
template<typename V , typename U >
using olb::AnalyticalLinear2D< T, S >::exchange_type = AnalyticalLinear2D<V,U>

Definition at line 507 of file analyticalF.h.

Constructor & Destructor Documentation

◆ AnalyticalLinear2D() [1/2]

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

Definition at line 510 of file analyticalF.hh.

511 : AnalyticalF2D<T,S>(1), _a(a), _b(b), _c(c)
512{
513 this->getName() = "linear";
514}
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:

◆ AnalyticalLinear2D() [2/2]

template<typename T , typename S >
olb::AnalyticalLinear2D< T, S >::AnalyticalLinear2D ( S x0,
S y0,
T v0,
S x1,
S y1,
T v1,
S x2,
S y2,
T v2 )

Definition at line 517 of file analyticalF.hh.

519 : AnalyticalF2D<T,S>(1)
520{
521 this->getName() = "linear";
522 T n2= (x1-x0)*(y2-y0) - (y1-y0)*(x2-x0);
523 if ( util::nearZero(n2) ) {
524 std::cout << "Error function" << std::endl;
525 }
526 else {
527 T n0 = (y1-y0)*(v2-v0) - (v1-v0)*(y2-y0);
528 T n1 = (v1-v0)*(x2-x0) - (x1-x0)*(v2-v0);
529 _a = -n0 / n2;
530 _b = -n1 / n2;
531 _c = (x0*n0 + y0*n1 + v0*n2) / n2;
532 }
533}
bool nearZero(const ADf< T, DIM > &a)
Definition aDiff.h:1087

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

+ Here is the call graph for this function:

Member Function Documentation

◆ copyAs()

template<typename T , typename S >
template<typename V , typename U >
auto olb::AnalyticalLinear2D< T, S >::copyAs ( ) const
inline

Definition at line 510 of file analyticalF.h.

510 {
511 return exchange_type<V,U>(_a, _b, _c);
512 }

References olb::AnalyticalLinear2D< T, S >::_a, olb::AnalyticalLinear2D< T, S >::_b, and olb::AnalyticalLinear2D< T, S >::_c.

◆ operator()()

template<typename T , typename S >
bool olb::AnalyticalLinear2D< 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 536 of file analyticalF.hh.

537{
538 output[0]=_a*x[0] + _b*x[1] + _c;
539 return true;
540}

Member Data Documentation

◆ _a

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

Definition at line 498 of file analyticalF.h.

◆ _b

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

Definition at line 499 of file analyticalF.h.

◆ _c

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

Definition at line 500 of file analyticalF.h.


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