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

arithmetic helper class for analytical functors More...

#include <analyticCalcF.h>

+ Inheritance diagram for olb::AnalyticCalcF< D, T, S, F >:
+ Collaboration diagram for olb::AnalyticCalcF< D, T, S, F >:

Public Member Functions

 AnalyticCalcF (FunctorPtr< AnalyticalF< D, T, S > > &&f, FunctorPtr< AnalyticalF< D, T, S > > &&g)
 
 AnalyticCalcF (T scalar, FunctorPtr< AnalyticalF< D, T, S > > &&g)
 
 AnalyticCalcF (FunctorPtr< AnalyticalF< D, T, S > > &&f, T scalar)
 
bool operator() (T output[], const S input[]) 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

FunctorPtr< AnalyticalF< D, T, S > > _f
 
FunctorPtr< AnalyticalF< D, T, S > > _g
 

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<unsigned D, typename T, typename S, template< typename > class F>
class olb::AnalyticCalcF< D, T, S, F >

arithmetic helper class for analytical functors

Definition at line 38 of file analyticCalcF.h.

Constructor & Destructor Documentation

◆ AnalyticCalcF() [1/3]

template<unsigned D, typename T , typename S , template< typename > class F>
olb::AnalyticCalcF< D, T, S, F >::AnalyticCalcF ( FunctorPtr< AnalyticalF< D, T, S > > && f,
FunctorPtr< AnalyticalF< D, T, S > > && g )

Definition at line 37 of file analyticCalcF.hh.

39 : AnalyticalF<D,T,S>(f->getTargetDim()),
40 _f(std::move(f)),
41 _g(std::move(g))
42{
43 OLB_ASSERT(g->getTargetDim() == f->getTargetDim(),
44 "the dimensions of both functors need to be equal");
45 std::swap(f->_ptrCalcC, this->_ptrCalcC);
46 this->getName() = "(" + _f->getName() + F<T>::symbol + _g->getName() + ")";
47}
FunctorPtr< AnalyticalF< D, T, S > > _g
FunctorPtr< AnalyticalF< D, T, S > > _f
std::string & getName()
read and write access to name
Definition genericF.hh:51
#define OLB_ASSERT(COND, MESSAGE)
Definition olbDebug.h:45

References olb::AnalyticCalcF< D, T, S, F >::_f, olb::AnalyticCalcF< D, T, S, F >::_g, olb::GenericF< T, S >::getName(), and OLB_ASSERT.

+ Here is the call graph for this function:

◆ AnalyticCalcF() [2/3]

template<unsigned D, typename T , typename S , template< typename > class F>
olb::AnalyticCalcF< D, T, S, F >::AnalyticCalcF ( T scalar,
FunctorPtr< AnalyticalF< D, T, S > > && g )

Definition at line 50 of file analyticCalcF.hh.

52 std::unique_ptr<AnalyticalF<D,T,S>>(
53 new AnalyticalConst<D,T,S>(std::vector<T>(g->getTargetDim(), scalar))),
54 std::forward<decltype(g)>(g))
55{ }
AnalyticCalcF(FunctorPtr< AnalyticalF< D, T, S > > &&f, FunctorPtr< AnalyticalF< D, T, S > > &&g)

◆ AnalyticCalcF() [3/3]

template<unsigned D, typename T , typename S , template< typename > class F>
olb::AnalyticCalcF< D, T, S, F >::AnalyticCalcF ( FunctorPtr< AnalyticalF< D, T, S > > && f,
T scalar )

Definition at line 58 of file analyticCalcF.hh.

60 std::forward<decltype(f)>(f),
61 std::unique_ptr<AnalyticalF<D,T,S>>(
62 new AnalyticalConst<D,T,S>(std::vector<T>(f->getTargetDim(), scalar))))
63{ }

Member Function Documentation

◆ operator()()

template<unsigned D, typename T , typename S , template< typename > class F>
bool olb::AnalyticCalcF< D, T, S, F >::operator() ( T output[],
const S input[] )
overridevirtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, S >.

Definition at line 66 of file analyticCalcF.hh.

67{
68 T outputTmp[this->_g->getTargetDim()];
69 this->_g(outputTmp, input);
70 this->_f(output, input);
71 for (int i = 0; i < this->_f->getTargetDim(); ++i) {
72 output[i] = F<T>()(output[i], outputTmp[i]);
73 }
74 return true;
75}

Member Data Documentation

◆ _f

template<unsigned D, typename T , typename S , template< typename > class F>
FunctorPtr<AnalyticalF<D,T,S> > olb::AnalyticCalcF< D, T, S, F >::_f
protected

Definition at line 40 of file analyticCalcF.h.

◆ _g

template<unsigned D, typename T , typename S , template< typename > class F>
FunctorPtr<AnalyticalF<D,T,S> > olb::AnalyticCalcF< D, T, S, F >::_g
protected

Definition at line 41 of file analyticCalcF.h.


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