5#include <dune/common/typeutilities.hh>
6#include <dune/functions/common/functionconcepts.hh>
8#include <amdis/common/Concepts.hpp>
9#include <amdis/common/Logical.hpp>
10#include <amdis/common/Order.hpp>
11#include <amdis/gridfunctions/Derivative.hpp>
16 template <
class Gr
idFunction>
17 auto localFunction(GridFunction
const& gf)
18 ->
decltype(gf.makeLocalFunction())
20 return gf.makeLocalFunction();
44 auto require(F&& f) ->
decltype(
52 auto require(GF
const& ) -> std::void_t<
55 typename GF::EntitySet
60 template<
class GF,
class Domain =
typename GF::EntitySet::GlobalCoordinate>
61 auto require(GF
const& gf) ->
decltype(
62 Dune::Concept::requireConcept< Dune::Functions::Concept::GridFunction<
63 TYPEOF(gf(std::declval<Domain>()))(Domain),
64 TYPEOF(gf.entitySet())
70 template<
class GF,
class Domain =
typename GF::EntitySet::GlobalCoordinate>
71 auto require(GF
const& gf) ->
decltype(
72 Dune::Concept::requireConcept<GridFunction>(gf),
73 gf.entitySet().gridView());
93 using GridFunction_t = bool_t<GridFunction<GF>>;
103 using GridViewFunction_t = bool_t<GridViewFunction<GF>>;
107 template <
class... GFs>
109 (GridFunction<remove_cvref_t<GFs>> ||...) ||
112 template <
class... GFs>
121 template <
class PreGr
idFct,
class =
void>
123 : PreGridFct::Creator {};
126 template <
class Function>
132 template <
class Gr
idFct,
class Gr
idView>
133 GridFct
const& makeGridFunctionImpl(GridFct
const& gridFct, GridView
const& , std::true_type, Dune::PriorityTag<2>)
139 template <
class F,
class GridView,
140 class Coordinate =
typename GridView::template Codim<0>::Entity::Geometry::GlobalCoordinate,
141 std::enable_if_t<std::is_invocable_v<F, Coordinate>,
int> = 0>
142 auto makeGridFunctionImpl(F
const& f, GridView
const& gridView, std::false_type, Dune::PriorityTag<1>)
144 AnalyticPreGridFunction<F> preGridFct{f};
145 return AnalyticPreGridFunction<F>::Creator::create(preGridFct, gridView);
149 template <
class PreGridFct,
class GridView,
150 class Creator = GridFunctionCreator<PreGridFct>>
151 decltype(
auto) makeGridFunctionImpl(PreGridFct
const& preGridFct, GridView
const& gridView, std::false_type, Dune::PriorityTag<0>)
153 return Creator::create(preGridFct, gridView);
193 template <
class PreGr
idFct,
class Gr
idView>
196 using isGridFct = Concepts::GridFunction_t<PreGridFct>;
197 return Impl::makeGridFunctionImpl(preGridFct, gridView, isGridFct{}, Dune::PriorityTag<5>{});
constexpr bool HasLocalFunction
GridFunction GF has free function localFunction(GF)
Definition GridFunction.hpp:81
constexpr bool GridFunction
GridFunction GF is a Type that has LocalFunction, provides some typedefs for Domain,...
Definition GridFunction.hpp:89
constexpr bool AnyGridFunction
Concept is fulfilled, if at least one of the massed Expressions can be converted to a GridFunction,...
Definition GridFunction.hpp:108
constexpr bool GridViewFunction
GridViewFunction GF is a Type that has LocalFunction, provides some typedefs for Domain,...
Definition GridFunction.hpp:99
decltype(auto) makeGridFunction(PreGridFct const &preGridFct, GridView const &gridView)
Generator for Gridfunctions from Expressions (PreGridfunctions)
Definition GridFunction.hpp:194
Definition AnalyticGridFunction.hpp:221
Definition GridFunction.hpp:59
Definition GridFunction.hpp:69
Definition GridFunction.hpp:50
Definition GridFunction.hpp:42
Definition GridFunction.hpp:123
Definition GridFunction.hpp:28