2 #ifndef DUNE_PDELAB_FUNCTION_LOCALFUNCTION_HH 3 #define DUNE_PDELAB_FUNCTION_LOCALFUNCTION_HH 10 #include <dune/functions/common/signature.hh> 11 #include <dune/functions/gridfunctions/gridviewfunction.hh> 16 template<
class F, std::
size_t k>
18 :
public TypeTree::PowerNode<F,k>
20 typedef TypeTree::PowerNode<F,k> NodeType;
25 template <
typename TT>
28 TypeTree::applyToTree(*
this,visitor);
31 template <
typename Entity>
34 TypeTree::applyToTree(*
this,visitor);
39 TypeTree::applyToTree(*
this,visitor);
56 template<
typename C0,
typename C1,
typename... Children>
58 : NodeType(
std::forward(c0),
std::forward(c1),
std::forward(children)...)
69 template<
typename... Children>
71 :
public TypeTree::CompositeNode<Children...>
73 typedef TypeTree::CompositeNode<Children...> NodeType;
78 template <
typename TT>
81 TypeTree::applyToTree(*
this,visitor);
84 template <
typename Entity>
87 TypeTree::applyToTree(*
this,visitor);
92 TypeTree::applyToTree(*
this,visitor);
100 template<
typename... Args,
typename =
typename std::enable_if<(
sizeof...(Args) ==
sizeof...(Children))>::type>
102 : NodeType(std::forward<Args>(args)...)
118 template<
class F,
class GV,
119 typename std::enable_if<
121 models< Dune::Functions::Imp::HasFreeLocalFunction, F>()
123 not(TypeTree::has_node_tag<
typename std::decay<F>::type>::
value),
int>::type = 0>
130 template<
class F,
class GV,
132 typename std::enable_if<
133 Dune::Functions::Concept::isCallable<F, typename GV::template Codim<0>::Entity::Geometry::GlobalCoordinate>()
135 not(models< Dune::Functions::Imp::HasFreeLocalFunction, F>())
137 not(TypeTree::has_node_tag<
typename std::decay<F>::type>::
value),
int>::type = 0>
144 template<
class F,
class GV,
145 typename std::enable_if<
147 models< Dune::Functions::Imp::HasFreeLocalFunction, F>()
149 TypeTree::has_node_tag<
typename std::decay<F>::type>::
value,
int>::type = 0>
151 -> decltype(localView(f))
153 return localView(std::forward(f));
158 template<
typename LeafNode>
159 Dune::TypeTree::GenericLeafNodeTransformation<LeafNode,GridFunctionToLocalViewTransformation, Imp::LocalGridViewFunctionAdapter<LeafNode> >
162 template<
typename PowerNode>
163 Dune::TypeTree::SimplePowerNodeTransformation<PowerNode,GridFunctionToLocalViewTransformation,PowerLocalFunction>
166 template<
typename CompositeNode>
167 Dune::TypeTree::SimpleCompositeNodeTransformation<CompositeNode,GridFunctionToLocalViewTransformation,CompositeLocalFunction>
170 template<
class F,
class GV,
171 typename std::enable_if<
175 ->
typename Dune::TypeTree::TransformTree<typename std::decay<F>::type,
179 return Dune::TypeTree::TransformTree<typename std::decay<F>::type,
183 template<
class F,
class GV,
184 typename std::enable_if<
186 not(IsGridFunction<F>::value)
188 std::is_same<TypeTree::NodeTag<F>,TypeTree::LeafNodeTag>
::value,
int>::type = 0>
199 #endif // DUNE_PDELAB_FUNCTION_LOCALFUNCTION_HH void unbind()
Definition: localfunction.hh:37
const Entity & e
Definition: localfunctionspace.hh:111
CompositeLocalFunction(Args &&... args)
Initialize all children with the passed-in objects.
Definition: localfunction.hh:101
void bind(const Entity &e)
Definition: localfunction.hh:32
Definition: function.hh:287
void unbind()
Definition: localfunction.hh:90
PowerLocalFunction(const Dune::array< Dune::shared_ptr< F >, k > &children)
Transformation Constructor, taking the set of new children.
Definition: localfunction.hh:63
Dune::TypeTree::GenericLeafNodeTransformation< LeafNode, GridFunctionToLocalViewTransformation, Imp::LocalGridViewFunctionAdapter< LeafNode > > registerNodeTransformation(LeafNode *l, GridFunctionToLocalViewTransformation *t, GridFunctionTag *tag)
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
PowerLocalFunction(F &f)
Construct a PowerGridFunction with k clones of the function t.
Definition: localfunction.hh:47
const P & p
Definition: constraints.hh:147
Definition: localfunctionhelper.hh:15
Definition: function.hh:356
CompositeLocalFunction()
Default Constructor.
Definition: localfunction.hh:96
void setTime(TT time)
Set the time in all leaf nodes of this function tree.
Definition: localfunction.hh:79
PowerDifferentiableFunctionLocalViewTag ImplementationTag
Definition: localfunction.hh:22
a GridFunction maps x in DomainType to y in RangeType
Definition: function.hh:187
Definition: function.hh:516
Definition: localfunction.hh:17
Visitor for Power- and CompositeGridFunctions calling the setTime() method on the leafs of the corres...
Definition: function.hh:343
PowerLocalFunction(C0 &&c0, C1 &&c1, Children &&... children)
Initialize all children with different function objects.
Definition: localfunction.hh:57
Definition: localfunctionhelper.hh:38
auto makeLocalFunctionTree(const F &f, const GV &gv) -> Imp::LocalFunctionLeafNodeWrapper< decltype(localFunction(f)) >
turn a given function tree into a local function tree
Definition: localfunction.hh:124
Definition: localfunction.hh:156
PowerLocalFunction()
Deafult Constructor.
Definition: localfunction.hh:43
Definition: function/tags.hh:15
void bind(const Entity &e)
Definition: localfunction.hh:85
Definition: oldinterfaceadapter.hh:16
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
Definition: localfunctionhelper.hh:27
CompositeDifferentiableFunctionLocalViewTag ImplementationTag
Definition: localfunction.hh:75
Definition: function/tags.hh:18
Definition: localfunction.hh:70
void setTime(TT time)
Set the time in all leaf nodes of this function tree.
Definition: localfunction.hh:26
std::integral_constant< bool, impl::IsGridFunction< std::decay_t< T > >::value > IsGridFunction
Definition: typetraits.hh:45