dune-functions  2.6-dev
Classes | Functions | Friends
Function implementations

Concrete function implementations. More...

Collaboration diagram for Function implementations:

Classes

class  Dune::Functions::Polynomial< K >
 A scalar polynomial implementation. More...
 
class  Dune::Functions::TrigonometricFunction< K, sinFactor, cosFactor >
 A linear combination of trigonomic functions. More...
 
class  Dune::Functions::CallableFunctionWrapper< F >
 Wrap a Dune::VirtualFunction into a callable object. More...
 
class  Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F >
 Wrap a list of callable objects as derivative sequence modelling Concept::DifferentiableFunction<Range(Domain), DerivativeTraits> More...
 
class  Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F, DF, Derivatives... >
 Wrap a list of callable objects as derivative sequence modelling Concept::DifferentiableFunction<Range(Domain), DerivativeTraits> More...
 
class  Dune::Functions::AnalyticGridViewFunction< Range(Domain), GV, F, DerivativeTraits >
 Class wrapping any differentiable function as grid function. More...
 
class  Dune::Functions::DiscreteGlobalBasisFunction< B, TP, V, NTRE, R >
 A grid function induced by a global basis and a coefficient vector. More...
 

Functions

template<class K , int sinFactor, int cosFactor>
TrigonometricFunction< K, -cosFactor, sinFactor > Dune::Functions::derivative (const TrigonometricFunction< K, sinFactor, cosFactor > &f)
 Obtain derivative of TrigonometricFunction function. More...
 
template<class F >
CallableFunctionWrapper< F > Dune::Functions::callable (const F &f)
 Create a callable object from some Dune::VirtualFunction. More...
 
template<class F >
CallableFunctionWrapper< F > Dune::Functions::callable (const std::shared_ptr< F > &fp)
 Create a callable object from shared_ptr<F> More...
 
template<class Signature , template< class > class DerivativeTraits, class... F>
DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... > Dune::Functions::makeDifferentiableFunctionFromCallables (const SignatureTag< Signature, DerivativeTraits > &signatureTag, F &&... f)
 Create a DifferentiableFunction from callables. More...
 
template<typename... TT>
void Dune::Functions::localFunction (DiscreteGlobalBasisFunction< TT... > &&t)=delete
 Construction of local functions from a temporary DiscreteGlobalBasisFunction (forbidden) More...
 

Friends

Polynomial Dune::Functions::Polynomial< K >::derivative (const Polynomial &p)
 Obtain derivative of Polynomial function. More...
 
Derivative Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F >::derivative (const DifferentiableFunctionFromCallables &t)
 Get derivative of DifferentiableFunctionFromCallables. More...
 
Derivative Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F, DF, Derivatives... >::derivative (const DifferentiableFunctionFromCallables &t)
 Get derivative of DifferentiableFunctionFromCallables. More...
 
LocalFunction Dune::Functions::DiscreteGlobalBasisFunction< B, TP, V, NTRE, R >::localFunction (const DiscreteGlobalBasisFunction &t)
 Construct local function from a DiscreteGlobalBasisFunction. More...
 

Detailed Description

Concrete function implementations.

Function Documentation

◆ callable() [1/2]

template<class F >
CallableFunctionWrapper<F> Dune::Functions::callable ( const F &  f)

Create a callable object from some Dune::VirtualFunction.

Template Parameters
FFunction type derived from Dune::VirtualFunction
Parameters
fThe function to be wrapper

The returned object will only be valid as long f is valid. You can e.g. do the following:

// Create some F derived from VirtualFunction<D,R>
F f;
// store callable directly
auto fc = callable(f);
// store callable through default wrapper
std::function<R(D)> stdF = callable(f)

◆ callable() [2/2]

template<class F >
CallableFunctionWrapper<F> Dune::Functions::callable ( const std::shared_ptr< F > &  fp)

Create a callable object from shared_ptr<F>

Template Parameters
FFunction type derived from Dune::VirtualFunction
Parameters
fpshared_ptr<F> to the function to be wrapper

The returned object will share ownership of fp using a shared_ptr. You can e.g. do the following:

// Create some F derived from VirtualFunction<D,R>
auto f = make_shared<F>();
// store callable directly
auto f1 = callable(f);
// store callable through default wrapper
std::function<R(D)> f2 = callable(f)
// Create some F derived from VirtualFunction<D,R> and only store
// it in the callable wrapper
auto f3 = callable(make_shared<F>());

◆ derivative()

template<class K , int sinFactor, int cosFactor>
TrigonometricFunction<K, -cosFactor, sinFactor> Dune::Functions::derivative ( const TrigonometricFunction< K, sinFactor, cosFactor > &  f)

Obtain derivative of TrigonometricFunction function.

◆ localFunction()

template<typename... TT>
void Dune::Functions::localFunction ( DiscreteGlobalBasisFunction< TT... > &&  t)
delete

Construction of local functions from a temporary DiscreteGlobalBasisFunction (forbidden)

Since a DiscreteGlobalBasisFunction::LocalFunction stores a reference to the global DiscreteGlobalBasisFunction its life time is bound to the latter. Hence construction from a temporary DiscreteGlobalBasisFunction would lead to a dangling reference and is thus forbidden/deleted.

◆ makeDifferentiableFunctionFromCallables()

template<class Signature , template< class > class DerivativeTraits, class... F>
DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...> Dune::Functions::makeDifferentiableFunctionFromCallables ( const SignatureTag< Signature, DerivativeTraits > &  signatureTag,
F &&...  f 
)

Create a DifferentiableFunction from callables.

This will return a wrapper modelling the DifferentiableFunction interface where the evaluation of the function and its derivatives are implemented by the given callable objects.

Parameters
signatureTagA dummy parameter to pass the signature and derivative traits
fCallable objects implementing the evaluation of the function and its derivatives
Returns
Object modelling DifferentiableFunction interface

Friends

◆ derivative [1/3]

template<class Range , class Domain , template< class > class DerivativeTraits, class F >
Derivative derivative ( const DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F > &  t)
friend

◆ derivative [2/3]

template<class K >
Polynomial derivative ( const Polynomial< K > &  p)
friend

Obtain derivative of Polynomial function.

The derivative contains its own coefficient list and is not updated if the original function is changed.

◆ derivative [3/3]

template<class Range , class Domain , template< class > class DerivativeTraits, class F , class DF , class... Derivatives>
Derivative derivative ( const DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F, DF, Derivatives... > &  t)
friend

◆ localFunction

template<typename B, typename TP, typename V, typename NTRE = DefaultNodeToRangeMap<typename std::decay<decltype(std::declval<B>().localView().tree().child(std::declval<TP>()))>::type>, typename R = typename V::value_type>
LocalFunction localFunction ( const DiscreteGlobalBasisFunction< B, TP, V, NTRE, R > &  t)
friend

Construct local function from a DiscreteGlobalBasisFunction.

The obtained local function satisfies the concept Dune::Functions::Concept::LocalFunction and must be bound to an entity from the entity set of the DiscreteGlobalBasisFunction before it can be used.

Notice that the local function stores a reference to the global DiscreteGlobalBasisFunction. Hence calling any method of the local function after the DiscreteGlobalBasisFunction exceeded its life time leads to undefined behavior.