4#ifndef DUNE_PDELAB_ORDERING_SUBORDERING_HH
5#define DUNE_PDELAB_ORDERING_SUBORDERING_HH
12#include <dune/typetree/treepath.hh>
13#include <dune/typetree/proxynode.hh>
14#include <dune/typetree/childextraction.hh>
47 template<
typename BaseOrdering_,
typename TreePath>
49 :
public TypeTree::ProxyNode<const TypeTree::ChildForTreePath<BaseOrdering_,TreePath>>
52 using NodeT = TypeTree::ProxyNode<const TypeTree::ChildForTreePath<BaseOrdering_,TreePath>>;
63 typedef typename BaseOrdering::Traits
Traits;
69 typedef typename BaseOrdering::CacheTag
CacheTag;
92 explicit SubOrdering(std::shared_ptr<const BaseOrdering> base_ordering)
93 : NodeT(base_ordering->child(TreePath()))
94 , _base_ordering(base_ordering)
104 template<
typename ItIn,
typename ItOut>
110 map_lfs_indices_to_root_space(TreePath(),
121 template<
typename TP,
typename ItIn,
typename ItOut>
122 void map_lfs_indices_in_ancestor(TP tp, ItIn& begin, ItIn& end, ItOut out)
const
124 using Ordering = TypeTree::ChildForTreePath<BaseOrdering,TP>;
130 if (!std::is_same<TreePath,TP>::value && Ordering::consume_tree_index)
132 begin.restore_back();
137 TypeTree::child(
baseOrdering(),tp).map_lfs_indices(begin,end,out);
141 template<
typename TP,
typename ItIn,
typename ItOut>
142 typename std::enable_if<
143 (TypeTree::TreePathSize<TP>::value > 0)
145 map_lfs_indices_to_root_space(TP, ItIn begin, ItIn end, ItOut out)
const
147 map_lfs_indices_in_ancestor(TP(),begin,end,out);
149 map_lfs_indices_to_root_space(
typename TypeTree::TreePathPopBack<TP>::type(),begin,end,out);
153 template<
typename TP,
typename ItIn,
typename ItOut>
154 typename std::enable_if<
155 (TypeTree::TreePathSize<TP>::value == 0)
157 map_lfs_indices_to_root_space(TP, ItIn begin, ItIn end, ItOut out)
const
159 map_lfs_indices_in_ancestor(TP(),begin,end,out);
165 typename Traits::ContainerIndex
mapIndex(
const typename Traits::DOFIndex& di)
const
167 typename Traits::ContainerIndex ci;
173 void mapIndex(
typename Traits::DOFIndexView di,
typename Traits::ContainerIndex& ci)
const
179 typename Traits::SizeType
size()
const
197 bool contains(
typename Traits::SizeType codim)
const
211 return *_base_ordering;
217 return this->proxiedNode();
222 std::shared_ptr<const BaseOrdering> _base_ordering;
For backward compatibility – Do not use this!
Definition adaptivity.hh:28
A view on a subtree of a multi-component ordering.
Definition subordering.hh:50
SubOrdering(std::shared_ptr< const BaseOrdering > base_ordering)
Constructs a SubOrdering for base_ordering.
Definition subordering.hh:92
BaseOrdering_ BaseOrdering
The type of the BaseOrdering for which to represent a SubOrdering view.
Definition subordering.hh:57
void map_lfs_indices(ItIn begin, const ItIn end, ItOut out) const
Definition subordering.hh:105
const BaseOrdering & baseOrdering() const
Returns the BaseOrdering.
Definition subordering.hh:209
bool fixedSize(typename Traits::SizeType codim) const
Returns whether the TargetOrdering is of fixed size for entities of codimension codim.
Definition subordering.hh:203
BaseOrdering::Traits Traits
Forwarded Ordering traits from BaseOrdering.
Definition subordering.hh:63
static const bool consume_tree_index
Forwarded ordering property from TargetOrdering, required by PDELab internals.
Definition subordering.hh:75
bool contains(typename Traits::SizeType codim) const
Returns whether the TargetOrdering has DOFs attached to entities of codimension codim.
Definition subordering.hh:197
BaseOrdering::CacheTag CacheTag
Forwarded tag from BaseOrdering, required by PDELab internals.
Definition subordering.hh:69
Traits::SizeType maxLocalSize() const
Returns the maximum per-entity size of the TargetOrdering.
Definition subordering.hh:191
Traits::ContainerIndex mapIndex(const typename Traits::DOFIndex &di) const
Maps di from the DOFIndex subtree to the ContainerIndex in the BaseOrdering.
Definition subordering.hh:165
BaseOrdering::ContainerAllocationTag ContainerAllocationTag
Forwarded tag from BaseOrdering, required by PDELab internals.
Definition subordering.hh:66
const TargetOrdering & targetOrdering() const
Returns the TargetOrdering.
Definition subordering.hh:215
Traits::SizeType size() const
Returns the size of the BaseOrdering.
Definition subordering.hh:179
TypeTree::ChildForTreePath< BaseOrdering, TreePath > TargetOrdering
The target ordering that makes up the root of this SubOrdering view.
Definition subordering.hh:60
static const bool has_dynamic_ordering_children
Forwarded ordering property from TargetOrdering, required by PDELab internals.
Definition subordering.hh:72
void update()
Updates this SubOrdering.
Definition subordering.hh:100
void mapIndex(typename Traits::DOFIndexView di, typename Traits::ContainerIndex &ci) const
Maps di from the DOFIndex subtree to the ContainerIndex in the BaseOrdering - inplace version.
Definition subordering.hh:173
Traits::SizeType blockCount() const
Returns the block count of the BaseOrdering.
Definition subordering.hh:185