3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
8#include <dune/common/typeutilities.hh>
30template<
class Signature,
class EntitySet,
template<
class>
class DerivativeTraits=DefaultDerivativeTraits,
size_t bufferSize=56>
40 template<
class S,
class ES,
template<
class>
class DerivativeTraits,
size_t bufferSize>
41 struct GridFunctionTraits :
42 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
45 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
52 using Element =
typename EntitySet::Element;
55 using DerivativeSignature =
typename Base::DerivativeSignature;
61 using LocalSignature =
typename Base::Range(
typename EntitySet::LocalCoordinate);
68 using LocalFunctionTraits =
typename Dune::Functions::Imp::LocalFunctionTraits<LocalSignature, Element, LocalDerivativeTraits, bufferSize>;
74 using Concept = GridFunctionWrapperInterface<S, DerivativeInterface, LocalFunctionInterface, ES>;
78 using Model = GridFunctionWrapperImplementation<S, DerivativeInterface, LocalFunctionInterface, ES, B>;
95template<
class Range,
class Domain,
class ES,
template<
class>
class DerivativeTraits,
size_t bufferSize>
96class GridFunction<Range(Domain), ES, DerivativeTraits, bufferSize> :
98 typename Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::Concept,
99 Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::template Model>
101 using Traits = Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>;
109 using EntitySet =
typename Traits::EntitySet;
124 template<
class F, disableCopyMove<Gr
idFunction, F> = 0 >
126 Base(std::forward<F>(f))
128 static_assert(Dune::Functions::Concept::isGridFunction<F, Range(Domain), EntitySet>(),
"Trying to construct a GridFunction from type that does not model the GridFunction concept");
138 Range operator() (
const Domain& x)
const
140 return this->asInterface().operator()(x);
153 return t.asInterface().derivative();
167 return t.asInterface().wrappedLocalFunction();
178 return this->asInterface().wrappedEntitySet();
Definition: polynomial.hh:10
Definition: localfunction.hh:30
Base class for type-erased interface wrapper.
Definition: typeerasure.hh:165
Definition: gridfunction.hh:32
friend DerivativeInterface derivative(const GridFunction &t)
Get derivative of wrapped function.
Definition: gridfunction.hh:151
const EntitySet & entitySet() const
Get associated EntitySet.
Definition: gridfunction.hh:176
GridFunction(F &&f)
Construct from function.
Definition: gridfunction.hh:125
friend LocalFunctionInterface localFunction(const GridFunction &t)
Get local function of wrapped function.
Definition: gridfunction.hh:165
Derivative traits for local functions.
Definition: localderivativetraits.hh:28