3 #ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH 4 #define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH 7 #include <dune/common/concept.hh> 11 #include <dune/typetree/traversal.hh> 12 #include <dune/typetree/visitor.hh> 47 :
public TypeTree::TreeVisitor
48 ,
public TypeTree::DynamicTraversal
50 Visitor(std::vector<std::size_t>& indices) :
55 template<
typename Node,
typename TreePath>
56 void leaf(Node& node, TreePath treePath)
58 if (
indices_.size() < node.treeIndex()+1)
83 template<
class Node,
class Range,
84 typename std::enable_if<
85 models<Concept::HasIndexAccess, Range, decltype(std::declval<Node>().treeIndex())>() and not Tree::isLeaf,
int>::type = 0>
89 return y[
indices_[node.treeIndex()]];
92 template<
class Node,
class Range,
93 typename std::enable_if< not models<Concept::HasIndexAccess, Range, decltype(std::declval<Node>().treeIndex())>() or Tree::isLeaf,
int>::type = 0>
95 -> decltype(
std::forward<Range>(y))
97 return std::forward<Range>(y);
114 template<
class Basis,
class TreePath>
118 auto&& localView = basis.localView();
119 localView.bind(*basis.gridView().template begin<0>());
120 auto&& tree = TypeTree::child(localView.tree(),treePath);
130 #endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH Definition: defaultnodetorangemap.hh:46
Definition: polynomial.hh:7
std::vector< std::size_t > & indices_
Definition: defaultnodetorangemap.hh:64
auto operator()(const Node &node, Range &&y) const -> decltype(std::forward< Range >(y))
Definition: defaultnodetorangemap.hh:94
Visitor(std::vector< std::size_t > &indices)
Definition: defaultnodetorangemap.hh:50
std::size_t counter_
Definition: defaultnodetorangemap.hh:65
A simple node to range map using lexicographic ordering.
Definition: defaultnodetorangemap.hh:38
DefaultNodeToRangeMap< Tree > makeDefaultNodeToRangeMap(const Tree &tree)
Definition: defaultnodetorangemap.hh:107
std::size_t counter_
Definition: defaultnodetorangemap.hh:101
DefaultNodeToRangeMap(const Tree &tree)
Construct DefaultNodeToRangeMap.
Definition: defaultnodetorangemap.hh:78
std::vector< std::size_t > indices_
Definition: defaultnodetorangemap.hh:100
void leaf(Node &node, TreePath treePath)
Definition: defaultnodetorangemap.hh:56
auto operator()(const Node &node, Range &&y) const -> decltype(y[0])
Definition: defaultnodetorangemap.hh:86