1 #ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH 2 #define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH 4 #include <dune/typetree/leafnode.hh> 5 #include <dune/typetree/powernode.hh> 6 #include <dune/typetree/compositenode.hh> 7 #include <dune/typetree/traversal.hh> 8 #include <dune/typetree/visitor.hh> 17 template<
typename size_type>
18 struct ClearSizeVisitor
19 :
public TypeTree::TreeVisitor
20 ,
public TypeTree::DynamicTraversal
23 template<
typename Node,
typename TreePath>
24 void pre(Node& node, TreePath treePath)
30 template<
typename Node,
typename TreePath>
31 void leaf(Node& node, TreePath treePath)
36 ClearSizeVisitor(size_type offset)
45 template<
typename Entity,
typename size_type>
47 :
public TypeTree::TreeVisitor
48 ,
public TypeTree::DynamicTraversal
51 template<
typename Node,
typename TreePath>
52 void pre(Node& node, TreePath treePath)
57 template<
typename Node,
typename TreePath>
58 void post(Node& node, TreePath treePath)
60 node.setSize(
offset_ - node.offset());
63 template<
typename Node,
typename TreePath>
64 void leaf(Node& node, TreePath treePath)
71 BindVisitor(
const Entity& entity, size_type offset = 0)
82 template<
typename size_type>
83 struct InitializeTreeVisitor :
84 public TypeTree::TreeVisitor,
85 public TypeTree::DynamicTraversal
87 template<
typename Node,
typename TreePath>
88 void pre(Node& node, TreePath treePath)
94 template<
typename Node,
typename TreePath>
95 void leaf(Node& node, TreePath treePath)
101 InitializeTreeVisitor(size_type treeIndexOffset = 0) :
111 template<
typename TP>
116 friend struct ClearSizeVisitor;
118 template<
typename,
typename>
119 friend struct BindVisitor;
122 friend struct InitializeTreeVisitor;
188 template<
typename SIZE_T_DUMMY,
typename TP>
191 public TypeTree::LeafNode
208 template<
typename SIZE_T_DUMMY,
typename TP,
typename T, std::
size_t n>
211 public TypeTree::PowerNode<T,n>
215 using Node = TypeTree::PowerNode<T,n>;
231 template<
typename SIZE_T_DUMMY,
typename TP,
typename... T>
234 public TypeTree::CompositeNode<T...>
238 using Node = TypeTree::CompositeNode<T...>;
251 template<
typename... Children>
260 template<
typename Tree>
263 TypeTree::applyToTree(tree,ClearSizeVisitor<std::size_t>(offset));
266 template<
typename Tree,
typename Entity>
267 void bindTree(Tree& tree,
const Entity& entity, std::size_t offset = 0)
269 BindVisitor<Entity,std::size_t> visitor(entity,offset);
270 TypeTree::applyToTree(tree,visitor);
273 template<
typename Tree>
276 InitializeTreeVisitor<std::size_t> visitor(treeIndexOffset);
277 TypeTree::applyToTree(tree,visitor);
285 #endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
const size_type offset_
Definition: nodes.hh:40
const Entity & entity_
Definition: nodes.hh:76
CompositeBasisNode(const shared_ptr< Children > &... children, const TP &tp)
Definition: nodes.hh:252
std::size_t size_type
Definition: nodes.hh:127
void setSize(const size_type size)
Definition: nodes.hh:168
void setTreeIndex(size_type treeIndex)
Definition: nodes.hh:173
void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
Definition: nodes.hh:274
void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
Definition: nodes.hh:267
Definition: polynomial.hh:7
void setOffset(const size_type offset)
Definition: nodes.hh:163
CompositeBasisNode(const TP &tp, const typename Node::NodeStorage &children)
Definition: nodes.hh:246
BasisNodeMixin(const TreePath &treePath)
Definition: nodes.hh:129
size_type size() const
Definition: nodes.hh:141
size_type localIndex(size_type i) const
Definition: nodes.hh:136
CompositeBasisNode(const TP &tp)
Definition: nodes.hh:242
size_type treeIndex_
Definition: nodes.hh:105
PowerBasisNode(const TP &tp, const typename Node::NodeStorage &children)
Definition: nodes.hh:223
TP TreePath
Definition: nodes.hh:126
size_type offset() const
Definition: nodes.hh:156
const TreePath & treePath() const
Definition: nodes.hh:146
LeafBasisNode(TreePath treePath=TreePath())
Definition: nodes.hh:201
void clearSize(Tree &tree, std::size_t offset)
Definition: nodes.hh:261
PowerBasisNode(const TP &tp)
Definition: nodes.hh:219
size_type treeIndex() const
Definition: nodes.hh:151