OpenLB 1.7
|
Helper functions for building functors via composition. More...
Functions | |
template<typename T , typename W > | |
std::shared_ptr< SuperF2D< T, W > > | lift (SuperF2D< T, W > &f) |
Lifts functor reference to std::shared_ptr functor arithmetic. | |
template<typename T , typename W > | |
std::shared_ptr< SuperF2D< T, W > > | lift (SuperF2D< T, W > *f) |
Lifts functor pointer to std::shared_ptr functor arithmetic. | |
template<typename T , typename W > | |
std::shared_ptr< AnalyticalF2D< T, W > > | lift (AnalyticalF2D< T, W > &f) |
Lifts functor reference to std::shared_ptr functor arithmetic. | |
template<typename T , typename W > | |
std::shared_ptr< AnalyticalF2D< T, W > > | lift (AnalyticalF2D< T, W > *f) |
Lifts functor pointer to std::shared_ptr functor arithmetic. | |
template<typename T , typename W > | |
std::shared_ptr< SuperF2D< T, W > > | pow (std::shared_ptr< SuperF2D< T, W > > baseF, std::shared_ptr< SuperF2D< T, W > > exponentF) |
Returns baseF raised to the power of exponentF. | |
template<typename T , typename W , typename E > | |
std::shared_ptr< SuperF2D< T, W > > | pow (std::shared_ptr< SuperF2D< T, W > > baseF, E exponent) |
Returns baseF raised to the power of exponent. | |
template<typename T , typename W , typename B > | |
std::shared_ptr< SuperF2D< T, W > > | pow (B base, std::shared_ptr< SuperF2D< T, W > > exponentF) |
Returns base raised to the power of exponentF. | |
template<int P, typename T , typename W > | |
std::shared_ptr< SuperF2D< T, W > > | norm (std::shared_ptr< SuperF2D< T, W > > f, std::shared_ptr< SuperIndicatorF2D< T > > indicatorF) |
Returns Lp norm for a functor f on the subset described by indicatorF. | |
template<typename T , typename W , typename DESCRIPTOR > | |
std::shared_ptr< SuperF2D< T, W > > | restrictF (std::shared_ptr< AnalyticalF2D< T, W > > f, SuperLattice< T, DESCRIPTOR > &sLattice) |
Returns restriction of a analytical functor f to the lattice sLattice. | |
template<typename T , typename DESCRIPTOR , typename FIELD > | |
std::enable_if_t< DESCRIPTOR::d==2, std::shared_ptr< SuperF2D< T > > > | field (SuperLattice< T, DESCRIPTOR > &sLattice) |
Returns external field functor. | |
template<typename T , typename W > | |
std::shared_ptr< SuperF3D< T, W > > | lift (SuperF3D< T, W > &f) |
Lifts functor reference to std::shared_ptr functor arithmetic. | |
template<typename T , typename W > | |
std::shared_ptr< SuperF3D< T, W > > | lift (SuperF3D< T, W > *f) |
Lifts functor pointer to std::shared_ptr functor arithmetic. | |
template<typename T , typename W > | |
std::shared_ptr< AnalyticalF3D< T, W > > | lift (AnalyticalF3D< T, W > &f) |
Lifts functor reference to std::shared_ptr functor arithmetic. | |
template<typename T , typename W > | |
std::shared_ptr< AnalyticalF3D< T, W > > | lift (AnalyticalF3D< T, W > *f) |
Lifts functor pointer to std::shared_ptr functor arithmetic. | |
template<typename T , typename W > | |
std::shared_ptr< SuperF3D< T, W > > | pow (std::shared_ptr< SuperF3D< T, W > > baseF, std::shared_ptr< SuperF3D< T, W > > exponentF) |
Returns baseF raised to the power of exponentF. | |
template<typename T , typename W , typename E > | |
std::shared_ptr< SuperF3D< T, W > > | pow (std::shared_ptr< SuperF3D< T, W > > baseF, E exponent) |
Returns baseF raised to the power of exponent. | |
template<typename T , typename W , typename B > | |
std::shared_ptr< SuperF3D< T, W > > | pow (B base, std::shared_ptr< SuperF3D< T, W > > exponentF) |
Returns base raised to the power of exponentF. | |
template<int P, typename T , typename W > | |
std::shared_ptr< SuperF3D< T, W > > | norm (std::shared_ptr< SuperF3D< T, W > > f, std::shared_ptr< SuperIndicatorF3D< T > > indicatorF) |
Returns Lp norm for a functor f on the subset described by indicatorF. | |
template<typename T , typename W , typename DESCRIPTOR > | |
std::shared_ptr< SuperF3D< T, W > > | restrictF (std::shared_ptr< AnalyticalF3D< T, W > > f, SuperLattice< T, DESCRIPTOR > &sLattice) |
Returns restriction of a analytical functor f to the lattice sLattice. | |
template<typename T , typename DESCRIPTOR , typename FIELD > | |
std::enable_if_t< DESCRIPTOR::d==3, std::shared_ptr< SuperF3D< T > > > | field (SuperLattice< T, DESCRIPTOR > &sLattice) |
Returns external field functor. | |
Helper functions for building functors via composition.
Certain types of functors such as error norms (see e.g. SuperRelativeErrorLpNorm3D) lend themselves to being expressed as a composition of existing functors.
std::shared_ptr based functor arithmetic offers a memory-safe way to perform functor composition. However common operations such as lifting stack-allocated functors into the std::shared_ptr context, constructing Lp norms or restricting analytical functors on a lattice can become quite verbose.
This is why the functor_dsl
namespace contains a set of conveniently named helper functions that aim to ease writing composed functors.
e.g. a slightly modified version of SuperRelativeErrorLpNorm3D's constructor:
Note that any of the functors managed by std::shared_ptr may be returned and reused independently.
i.e. it is not necessary to manually assure the lifetime of any functor used by the composition.
std::enable_if_t< DESCRIPTOR::d==2, std::shared_ptr< SuperF2D< T > > > olb::functor_dsl::field | ( | SuperLattice< T, DESCRIPTOR > & | sLattice | ) |
Returns external field functor.
Definition at line 110 of file functorDsl2D.hh.
std::enable_if_t< DESCRIPTOR::d==3, std::shared_ptr< SuperF3D< T > > > olb::functor_dsl::field | ( | SuperLattice< T, DESCRIPTOR > & | sLattice | ) |
Returns external field functor.
Definition at line 111 of file functorDsl3D.hh.
std::shared_ptr< AnalyticalF2D< T, W > > olb::functor_dsl::lift | ( | AnalyticalF2D< T, W > & | f | ) |
Lifts functor reference to std::shared_ptr functor arithmetic.
Definition at line 49 of file functorDsl2D.hh.
std::shared_ptr< AnalyticalF2D< T, W > > olb::functor_dsl::lift | ( | AnalyticalF2D< T, W > * | f | ) |
Lifts functor pointer to std::shared_ptr functor arithmetic.
Definition at line 55 of file functorDsl2D.hh.
std::shared_ptr< AnalyticalF3D< T, W > > olb::functor_dsl::lift | ( | AnalyticalF3D< T, W > & | f | ) |
Lifts functor reference to std::shared_ptr functor arithmetic.
Definition at line 50 of file functorDsl3D.hh.
std::shared_ptr< AnalyticalF3D< T, W > > olb::functor_dsl::lift | ( | AnalyticalF3D< T, W > * | f | ) |
Lifts functor pointer to std::shared_ptr functor arithmetic.
Definition at line 56 of file functorDsl3D.hh.
std::shared_ptr< SuperF2D< T, W > > olb::functor_dsl::lift | ( | SuperF2D< T, W > & | f | ) |
Lifts functor reference to std::shared_ptr functor arithmetic.
Definition at line 37 of file functorDsl2D.hh.
std::shared_ptr< SuperF2D< T, W > > olb::functor_dsl::lift | ( | SuperF2D< T, W > * | f | ) |
Lifts functor pointer to std::shared_ptr functor arithmetic.
Definition at line 43 of file functorDsl2D.hh.
std::shared_ptr< SuperF3D< T, W > > olb::functor_dsl::lift | ( | SuperF3D< T, W > & | f | ) |
Lifts functor reference to std::shared_ptr functor arithmetic.
Definition at line 38 of file functorDsl3D.hh.
std::shared_ptr< SuperF3D< T, W > > olb::functor_dsl::lift | ( | SuperF3D< T, W > * | f | ) |
Lifts functor pointer to std::shared_ptr functor arithmetic.
Definition at line 44 of file functorDsl3D.hh.
std::shared_ptr< SuperF2D< T, W > > olb::functor_dsl::norm | ( | std::shared_ptr< SuperF2D< T, W > > | f, |
std::shared_ptr< SuperIndicatorF2D< T > > | indicatorF ) |
Returns Lp norm for a functor f on the subset described by indicatorF.
Definition at line 91 of file functorDsl2D.hh.
std::shared_ptr< SuperF3D< T, W > > olb::functor_dsl::norm | ( | std::shared_ptr< SuperF3D< T, W > > | f, |
std::shared_ptr< SuperIndicatorF3D< T > > | indicatorF ) |
Returns Lp norm for a functor f on the subset described by indicatorF.
Definition at line 92 of file functorDsl3D.hh.
std::shared_ptr< SuperF2D< T, W > > olb::functor_dsl::pow | ( | B | base, |
std::shared_ptr< SuperF2D< T, W > > | exponentF ) |
Returns base raised to the power of exponentF.
Definition at line 81 of file functorDsl2D.hh.
std::shared_ptr< SuperF3D< T, W > > olb::functor_dsl::pow | ( | B | base, |
std::shared_ptr< SuperF3D< T, W > > | exponentF ) |
Returns base raised to the power of exponentF.
Definition at line 82 of file functorDsl3D.hh.
std::shared_ptr< SuperF2D< T, W > > olb::functor_dsl::pow | ( | std::shared_ptr< SuperF2D< T, W > > | baseF, |
E | exponent ) |
Returns baseF raised to the power of exponent.
Definition at line 71 of file functorDsl2D.hh.
std::shared_ptr< SuperF2D< T, W > > olb::functor_dsl::pow | ( | std::shared_ptr< SuperF2D< T, W > > | baseF, |
std::shared_ptr< SuperF2D< T, W > > | exponentF ) |
Returns baseF raised to the power of exponentF.
Definition at line 61 of file functorDsl2D.hh.
std::shared_ptr< SuperF3D< T, W > > olb::functor_dsl::pow | ( | std::shared_ptr< SuperF3D< T, W > > | baseF, |
E | exponent ) |
Returns baseF raised to the power of exponent.
Definition at line 72 of file functorDsl3D.hh.
std::shared_ptr< SuperF3D< T, W > > olb::functor_dsl::pow | ( | std::shared_ptr< SuperF3D< T, W > > | baseF, |
std::shared_ptr< SuperF3D< T, W > > | exponentF ) |
Returns baseF raised to the power of exponentF.
Definition at line 62 of file functorDsl3D.hh.
std::shared_ptr< SuperF2D< T, W > > olb::functor_dsl::restrictF | ( | std::shared_ptr< AnalyticalF2D< T, W > > | f, |
SuperLattice< T, DESCRIPTOR > & | sLattice ) |
Returns restriction of a analytical functor f to the lattice sLattice.
Definition at line 101 of file functorDsl2D.hh.
std::shared_ptr< SuperF3D< T, W > > olb::functor_dsl::restrictF | ( | std::shared_ptr< AnalyticalF3D< T, W > > | f, |
SuperLattice< T, DESCRIPTOR > & | sLattice ) |
Returns restriction of a analytical functor f to the lattice sLattice.
Definition at line 102 of file functorDsl3D.hh.