dune-functions
2.5-dev
|
Class storing local functions using type erasure. More...
#include <dune/functions/common/localfunction.hh>
Public Member Functions | |
template<class F , disableCopyMove< LocalFunction, F > = 0> | |
LocalFunction (F &&f) | |
Construct from function. More... | |
LocalFunction ()=default | |
Range | operator() (const Domain &x) const |
Evaluation of wrapped function. More... | |
void | bind (const LocalContext &context) |
Bind function to a local context. More... | |
void | unbind () |
Unbind from local context. More... | |
const LocalContext & | localContext () const |
Obtain local contex this LocalFunction is bound to. More... | |
Imp::LocalFunctionTraits< Range(Domain), LocalContext, DerivativeTraits, bufferSize >::Concept & | asInterface () |
Get mutable reference to wrapped object. More... | |
const Imp::LocalFunctionTraits< Range(Domain), LocalContext, DerivativeTraits, bufferSize >::Concept & | asInterface () const |
Get reference to wrapped object. More... | |
virtual const std::type_info & | target_type () const |
Get type of stored object. More... | |
Protected Attributes | |
PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< Imp::LocalFunctionTraits< Range(Domain), LocalContext, DerivativeTraits, bufferSize >::Concept >, 56 > | wrapped_ |
Friends | |
DerivativeInterface | derivative (const LocalFunction &t) |
Get derivative of wrapped function. More... | |
Class storing local functions using type erasure.
Range | Range type |
Domain | Domain type |
LocalContext | Type of local context where this function is defined on |
DerivativeTraits | Traits class to determine range of derivative. |
bufferSize | Size of stack buffer for small object optimization (defaults to 56) |
This models the Concept::LocalFunction<Range(Domain), LocalContext, DerivativeTraits> concept. Objects of this type are returned as local functions by the GridFunction wrapper. Notice that the DerivativeTraits type used here should normally be LocalDerivativeTraits<E,GDE> where GDE is the DerivativeTraits type of the corresponding global function. Small object optimization is used to store the given function. If its size exceed bufferSize
, memory will be allocated dynamically.
|
inline |
Construct from function.
F | Function type |
f | Function of type F |
Calling derivative(DifferentiableFunction) will result in an exception if the passed function does provide a free derivative() function found via ADL.
|
default |
|
inlineinherited |
Get mutable reference to wrapped object.
|
inlineinherited |
Get reference to wrapped object.
|
inline |
Bind function to a local context.
You must bind a LocalFunction to a local context before you can evaluate it.
|
inline |
Obtain local contex this LocalFunction is bound to.
|
inline |
Evaluation of wrapped function.
|
inlinevirtualinherited |
Get type of stored object.
|
inline |
Unbind from local context.
|
protectedinherited |