6#include <dune/common/diagonalmatrix.hh>
7#include <dune/common/fmatrix.hh>
8#include <dune/common/fvector.hh>
10#include <amdis/common/DerivativeTraits.hpp>
11#include <amdis/common/TypeTraits.hpp>
12#include <amdis/gridfunctions/AnalyticGridFunction.hpp>
13#include <amdis/gridfunctions/GridFunction.hpp>
18 template <
class Signature,
class LocalContext,
class Function>
23 template <
class R,
class D,
class LC,
class T>
34 enum { hasDerivative =
true };
37 using LocalContext = LC;
38 using Geometry =
typename LC::Geometry;
46 void bind(LocalContext
const& element)
48 localContext_.emplace(element);
56 return !!localContext_;
59 LocalContext
const& localContext()
const
61 assert( !!localContext_ );
62 return *localContext_;
76 using RawSignature =
typename Dune::Functions::SignatureTraits<R(D)>::RawSignature;
78 DerivativeRange diff(0);
82 df.bind(*localContext_);
94 std::optional<LocalContext> localContext_;
107 template <
class T,
class Gr
idView>
111 using EntitySet = Dune::Functions::GridViewEntitySet<GridView, 0>;
112 using Domain =
typename EntitySet::GlobalCoordinate;
113 using Range = Underlying_t<T>;
115 enum { hasDerivative =
false };
118 using Element =
typename EntitySet::Element;
119 using LocalDomain =
typename EntitySet::LocalCoordinate;
126 , entitySet_(gridView)
135 EntitySet
const& entitySet()
const
148 EntitySet entitySet_;
162 : std::is_arithmetic<T> {};
168 template <
class T,
int N>
172 template <
class T,
int N,
int M>
176 template <
class T,
int N>
195 template <
class Value>
198 template <
class Gr
idView>
199 static auto create(Value
const& value, GridView
const& gridView)
Gridfunction returning a constant value.
Definition: ConstantGridFunction.hpp:109
LocalFunction makeLocalFunction() const
Create an ConstantLocalFunction with the stores value_.
Definition: ConstantGridFunction.hpp:141
Range const & operator()(Domain const &) const
Return the constant value_
Definition: ConstantGridFunction.hpp:130
ConstantGridFunction(T const &value, GridView const &gridView)
Constructor. Stores the function fct and creates an EntitySet.
Definition: ConstantGridFunction.hpp:124
D Domain
The LocalDomain this LocalFunction can be evaluated in.
Definition: ConstantGridFunction.hpp:28
bool bound() const
Check whether this localfunction is bound to an element.
Definition: ConstantGridFunction.hpp:54
Range const & operator()(Domain const &) const
Return the constant value_.
Definition: ConstantGridFunction.hpp:66
R Range
The range type of the LocalFunction.
Definition: ConstantGridFunction.hpp:31
int order() const
Return the constant polynomial order 0.
Definition: ConstantGridFunction.hpp:87
auto makeDerivative(Type const &) const
Create a ConstantLocalFunction representing the derivative of a constant function,...
Definition: ConstantGridFunction.hpp:74
ConstantLocalFunction(T const &value)
Constructor. Stores the constant value.
Definition: ConstantGridFunction.hpp:42
Definition: ConstantGridFunction.hpp:19
constexpr bool ConstantToGridFunction
Concepts that is true for all ''simple'' types that can be converted automatically to a GridFunction,...
Definition: ConstantGridFunction.hpp:187
Definition: ConstantGridFunction.hpp:162
Definition: DerivativeTraits.hpp:29
Definition: GridFunction.hpp:97