7#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
8#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
12#include <dune/common/typeutilities.hh>
32template<
class Signature,
class LocalContext,
template<
class>
class DerivativeTraits=
DefaultDerivativeTraits,
size_t bufferSize=56>
42 template<
class S,
class L,
template<
class>
class DerivativeTraits,
size_t bufferSize>
43 struct LocalFunctionTraits :
44 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
47 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
51 using LocalContext = L;
54 using DerivativeSignature =
typename Base::DerivativeSignature;
60 using Concept = LocalFunctionWrapperInterface<S, DerivativeInterface, L>;
64 using Model = LocalFunctionWrapperImplementation<S, DerivativeInterface, L, B>;
90template<
class Range,
class Domain,
class LocalContext,
template<
class>
class DerivativeTraits,
size_t bufferSize>
91class LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize> :
93 typename Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::Concept,
94 Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::template Model>
96 using Traits = Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>;
100 using DerivativeInterface =
typename Traits::DerivativeInterface;
115 template<
class F, disableCopyMove<LocalFunction, F> = 0 >
117 Base(std::forward<F>(f))
127 Range operator() (
const Domain& x)
const
141 return t.asInterface().derivative();
150 void bind(
const LocalContext& context)
static constexpr bool isLocalFunction()
Check if F models the LocalFunction concept with given signature and local context.
Definition functionconcepts.hh:170
friend DerivativeInterface derivative(const LocalFunction &t)
Get derivative of wrapped function.
Definition localfunction.hh:139
Definition monomialset.hh:19
Definition monomialset.hh:19
Definition backends/concepts.hh:17
Default implementation for derivative traits.
Definition defaultderivativetraits.hh:41
Definition localfunction.hh:34
const LocalContext & localContext() const
Obtain local context this LocalFunction is bound to.
Definition localfunction.hh:173
LocalFunction(F &&f)
Construct from function.
Definition localfunction.hh:116
void unbind()
Unbind from local context.
Definition localfunction.hh:158
bool bound() const
Return if the local function is bound to a grid element.
Definition localfunction.hh:165
void bind(const LocalContext &context)
Bind function to a local context.
Definition localfunction.hh:150
TypeErasureBase(T &&t)
Definition typeerasure.hh:174
Imp::LocalFunctionTraits< Range(Domain), LocalContext, DerivativeTraits, bufferSize >::Concept & asInterface()
Definition typeerasure.hh:182