Extension: Geometries
#include "dg/geometries/geometries.h"
dg::geo::RealCylindricalFunctor< real_type > Struct Template Reference

Inject both 2d and 3d operator() to a 2d functor. More...

Public Member Functions

 RealCylindricalFunctor ()
 
template<class BinaryFunctor >
 RealCylindricalFunctor (BinaryFunctor f)
 Construct from any binary functor. More...
 
real_type operator() (real_type R, real_type Z) const
 
real_type operator() (real_type R, real_type Z, real_type phi) const
 

Detailed Description

template<class real_type>
struct dg::geo::RealCylindricalFunctor< real_type >

Inject both 2d and 3d operator() to a 2d functor.

The purpose of this class is to extend any 2d Functor to a 3d Functor by defining \( f(x,y,z) := f(x,y)\). This class is especially useful in an interface since any 2d functor can be converted to it (type erasure property of the std::function that we use to implement this class).

Note
If you want to write a functor that is both 2d and 3d directly, it is easier to derive from aCylindricalFunctor
See also
this class is an alternative to aCylindricalFunctor and aCylindricalFunctor can be converted to this class

Constructor & Destructor Documentation

◆ RealCylindricalFunctor() [1/2]

template<class real_type >
dg::geo::RealCylindricalFunctor< real_type >::RealCylindricalFunctor ( )
inline

◆ RealCylindricalFunctor() [2/2]

template<class real_type >
template<class BinaryFunctor >
dg::geo::RealCylindricalFunctor< real_type >::RealCylindricalFunctor ( BinaryFunctor  f)
inline

Construct from any binary functor.

Template Parameters
BinaryFunctorInterface must be real_type(real_type x, real_type y)
Parameters
fa 2d functor

Member Function Documentation

◆ operator()() [1/2]

template<class real_type >
real_type dg::geo::RealCylindricalFunctor< real_type >::operator() ( real_type  R,
real_type  Z 
) const
inline
Returns
f(R,Z)

◆ operator()() [2/2]

template<class real_type >
real_type dg::geo::RealCylindricalFunctor< real_type >::operator() ( real_type  R,
real_type  Z,
real_type  phi 
) const
inline
Returns
f(R,Z)

The documentation for this struct was generated from the following file: