4 #ifndef DUNE_PDELAB_ORDERING_SUBORDERING_HH 5 #define DUNE_PDELAB_ORDERING_SUBORDERING_HH 11 #include <dune/common/array.hh> 13 #include <dune/typetree/treepath.hh> 14 #include <dune/typetree/proxynode.hh> 15 #include <dune/typetree/childextraction.hh> 48 template<
typename BaseOrdering_,
typename TreePath>
50 :
public TypeTree::ProxyNode<const TypeTree::ChildForTreePath<BaseOrdering_,TreePath>>
53 using NodeT = TypeTree::ProxyNode<const TypeTree::ChildForTreePath<BaseOrdering_,TreePath>>;
64 typedef typename BaseOrdering::Traits
Traits;
70 typedef typename BaseOrdering::CacheTag
CacheTag;
93 explicit SubOrdering(std::shared_ptr<const BaseOrdering> base_ordering)
94 : NodeT(base_ordering->child(TreePath()))
95 , _base_ordering(base_ordering)
105 template<
typename ItIn,
typename ItOut>
111 map_lfs_indices_to_root_space(TreePath(),
122 template<
typename TP,
typename ItIn,
typename ItOut>
123 void map_lfs_indices_in_ancestor(TP tp, ItIn& begin, ItIn& end, ItOut out)
const 125 using Ordering = TypeTree::ChildForTreePath<BaseOrdering,TP>;
133 begin.restore_back();
138 TypeTree::child(
baseOrdering(),tp).map_lfs_indices(begin,end,out);
142 template<
typename TP,
typename ItIn,
typename ItOut>
143 typename std::enable_if<
146 map_lfs_indices_to_root_space(TP, ItIn begin, ItIn end, ItOut out)
const 148 map_lfs_indices_in_ancestor(TP(),begin,end,out);
150 map_lfs_indices_to_root_space(
typename TypeTree::TreePathPopBack<TP>::type(),begin,end,out);
154 template<
typename TP,
typename ItIn,
typename ItOut>
155 typename std::enable_if<
158 map_lfs_indices_to_root_space(TP, ItIn begin, ItIn end, ItOut out)
const 160 map_lfs_indices_in_ancestor(TP(),begin,end,out);
166 typename Traits::ContainerIndex
mapIndex(
const typename Traits::DOFIndex& di)
const 168 typename Traits::ContainerIndex ci;
174 void mapIndex(
typename Traits::DOFIndexView di,
typename Traits::ContainerIndex& ci)
const 180 typename Traits::SizeType
size()
const 198 bool contains(
typename Traits::SizeType codim)
const 212 return *_base_ordering;
218 return this->proxiedNode();
223 std::shared_ptr<const BaseOrdering> _base_ordering;
232 #endif // DUNE_PDELAB_ORDERING_SUBORDERING_HH BaseOrdering::ContainerAllocationTag ContainerAllocationTag
Forwarded tag from BaseOrdering, required by PDELab internals.
Definition: subordering.hh:67
BaseOrdering::CacheTag CacheTag
Forwarded tag from BaseOrdering, required by PDELab internals.
Definition: subordering.hh:70
const TargetOrdering & targetOrdering() const
Returns the TargetOrdering.
Definition: subordering.hh:216
BaseOrdering_ BaseOrdering
The type of the BaseOrdering for which to represent a SubOrdering view.
Definition: subordering.hh:58
BaseOrdering::Traits Traits
Forwarded Ordering traits from BaseOrdering.
Definition: subordering.hh:64
Traits::ContainerIndex mapIndex(const typename Traits::DOFIndex &di) const
Maps di from the DOFIndex subtree to the ContainerIndex in the BaseOrdering.
Definition: subordering.hh:166
Traits::SizeType blockCount() const
Returns the block count of the BaseOrdering.
Definition: subordering.hh:186
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:174
SubOrdering(std::shared_ptr< const BaseOrdering > base_ordering)
Constructs a SubOrdering for base_ordering.
Definition: subordering.hh:93
TypeTree::ChildForTreePath< BaseOrdering, typename find_ordering_treepath_for_sub_gfs< typename GFS::Ordering, GFS, TreePath >::type > TargetOrdering
The target ordering that makes up the root of this SubOrdering view.
Definition: subordering.hh:61
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
Traits::SizeType size() const
Returns the size of the BaseOrdering.
Definition: subordering.hh:180
A view on a subtree of a multi-component ordering.
Definition: subordering.hh:49
static const bool consume_tree_index
Forwarded ordering property from TargetOrdering, required by PDELab internals.
Definition: subordering.hh:76
const BaseOrdering & baseOrdering() const
Returns the BaseOrdering.
Definition: subordering.hh:210
bool fixedSize(typename Traits::SizeType codim) const
Returns whether the TargetOrdering is of fixed size for entities of codimension codim.
Definition: subordering.hh:204
void map_lfs_indices(ItIn begin, const ItIn end, ItOut out) const
Definition: subordering.hh:106
static const bool has_dynamic_ordering_children
Forwarded ordering property from TargetOrdering, required by PDELab internals.
Definition: subordering.hh:73
void update()
Updates this SubOrdering.
Definition: subordering.hh:101
Traits::SizeType maxLocalSize() const
Returns the maximum per-entity size of the TargetOrdering.
Definition: subordering.hh:192
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
bool contains(typename Traits::SizeType codim) const
Returns whether the TargetOrdering has DOFs attached to entities of codimension codim.
Definition: subordering.hh:198