OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
olb::AnalyticalTypecast< D, OldT, NewT, OldS, NewS > Class Template Reference

Perform explicit typecast for the arguments and results of functor. More...

#include <analyticalBaseF.h>

+ Inheritance diagram for olb::AnalyticalTypecast< D, OldT, NewT, OldS, NewS >:
+ Collaboration diagram for olb::AnalyticalTypecast< D, OldT, NewT, OldS, NewS >:

Public Member Functions

 AnalyticalTypecast (AnalyticalF< D, OldT, OldS > &f)
 
bool operator() (NewT output[], const NewS input[]) override
 
- Public Member Functions inherited from olb::AnalyticalF< D, NewT, NewS >
AnalyticalF< D, NewT, NewS > & operator- (AnalyticalF< D, NewT, NewS > &rhs)
 
AnalyticalF< D, NewT, NewS > & operator+ (AnalyticalF< D, NewT, NewS > &rhs)
 
AnalyticalF< D, NewT, NewS > & operator* (AnalyticalF< D, NewT, NewS > &rhs)
 
AnalyticalF< D, NewT, NewS > & operator/ (AnalyticalF< D, NewT, NewS > &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

AnalyticalF< D, OldT, OldS > & _f
 

Additional Inherited Members

- Public Types inherited from olb::AnalyticalF< D, NewT, NewS >
using identity_functor_type
 
- 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, NewT, NewS >
static constexpr unsigned dim
 
- Protected Member Functions inherited from olb::AnalyticalF< D, NewT, NewS >
 AnalyticalF (int n)
 
- Protected Member Functions inherited from olb::GenericF< T, S >
 GenericF (int targetDim, int sourceDim)
 

Detailed Description

template<unsigned D, typename OldT, typename NewT, typename OldS, typename NewS>
class olb::AnalyticalTypecast< D, OldT, NewT, OldS, NewS >

Perform explicit typecast for the arguments and results of functor.

Definition at line 76 of file analyticalBaseF.h.

Constructor & Destructor Documentation

◆ AnalyticalTypecast()

template<unsigned D, typename OldT , typename NewT , typename OldS , typename NewS >
olb::AnalyticalTypecast< D, OldT, NewT, OldS, NewS >::AnalyticalTypecast ( AnalyticalF< D, OldT, OldS > & f)

Definition at line 50 of file analyticalBaseF.hh.

52 : AnalyticalF<D,NewT,NewS>(f.getTargetDim()), _f(f)
53{
54 this->getName() = _f.getName();
55 // pass through the shared_ptr from _f, e.g. an arithemticClass, to the identity
56 //std::swap( _f._ptrCalcC, this->_ptrCalcC );
57}
AnalyticalF< D, OldT, OldS > & _f
int getTargetDim() const
read only access to member variable _n
Definition genericF.hh:45
std::string & getName()
read and write access to name
Definition genericF.hh:51

References olb::AnalyticalTypecast< D, OldT, NewT, OldS, NewS >::_f, and olb::GenericF< T, S >::getName().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<unsigned D, typename OldT , typename NewT , typename OldS , typename NewS >
bool olb::AnalyticalTypecast< D, OldT, NewT, OldS, NewS >::operator() ( NewT output[],
const NewS input[] )
override

Definition at line 60 of file analyticalBaseF.hh.

61{
62 OldS inputConv[D];
63 for (unsigned i = 0; i < D; ++i) {
64 inputConv[i] = OldS {input[i]};
65 }
66 OldT outputConv[this->getTargetDim()];
67
68 _f(outputConv,inputConv);
69
70 for (int i = 0; i < this->getTargetDim(); ++i) {
71 output[i] = NewT {outputConv[i]};
72 }
73 return true;
74}

Member Data Documentation

◆ _f

template<unsigned D, typename OldT , typename NewT , typename OldS , typename NewS >
AnalyticalF<D,OldT,OldS>& olb::AnalyticalTypecast< D, OldT, NewT, OldS, NewS >::_f
protected

Definition at line 78 of file analyticalBaseF.h.


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