DUNE PDELab (git)

localfunctionhelper.hh
1//-*- tab-width: 4; c-basic-offset: 2; indent-tabs-mode: nil -*-
2#ifndef DUNE_PDELAB_FUNCTION_LOCALFUNCTIONHELPER_HH
3#define DUNE_PDELAB_FUNCTION_LOCALFUNCTIONHELPER_HH
4
5#include <dune/pdelab/function/tags.hh>
6#include <dune/typetree/visitor.hh>
7
8namespace Dune {
9namespace PDELab {
10
11namespace Imp
12{
13
14 template<typename Entity>
15 struct PowerCompositeBindVisitor
16 : public TypeTree::TreeVisitor, public TypeTree::DynamicTraversal
17 {
18 PowerCompositeBindVisitor(const Entity & e) : e_(e) {}
19 template<typename LeafNode, typename TreePath>
20 void leaf(LeafNode& node, TreePath treePath) const
21 {
22 node.bind(e_);
23 }
24 const Entity & e_;
25 };
26
27 struct PowerCompositeUnbindVisitor
28 : public TypeTree::TreeVisitor, public TypeTree::DynamicTraversal
29 {
30 template<typename LeafNode, typename TreePath>
31 void leaf(LeafNode& node, TreePath treePath) const
32 {
33 node.unbind();
34 }
35 };
36
37 template<typename F>
38 class LocalFunctionLeafNodeWrapper
39 : public TypeTree::LeafNode
40 , public F
41 {
42 public:
43 typedef DifferentiableFunctionLocalViewTag ImplementationTag;
44 LocalFunctionLeafNodeWrapper(const F& f) :
45 F(f)
46 {}
47 };
48
49} // end namespace Imp
50} // end namespace PDELab
51} // end namespace Dune
52
53#endif // DUNE_PDELAB_FUNCTION_LOCALFUNCTIONHELPER_HH
typename std::decay_t< T >::ImplementationTag ImplementationTag
Returns the implementation tag of the given Node.
Definition: nodeinterface.hh:74
constexpr auto treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:326
Dune namespace.
Definition: alignedallocator.hh:13
void leaf(T &&, TreePath) const
Method for leaf traversal.
Definition: visitor.hh:93
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 23, 23:29, 2024)