dune-pdelab 2.7-git
Loading...
Searching...
No Matches
localfunctionhelper.hh
Go to the documentation of this file.
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
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
For backward compatibility – Do not use this!
Definition adaptivity.hh:28