4 #ifndef DUNE_PDELAB_ORDERING_SUBORDERING_HH
5 #define DUNE_PDELAB_ORDERING_SUBORDERING_HH
10 #include <dune/common/shared_ptr.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>
49 template<
typename BaseOrdering_,
typename TreePath>
51 :
public TypeTree::ProxyNode<const typename TypeTree::extract_child_type<BaseOrdering_,TreePath>::type>
55 typedef typename TypeTree::ProxyNode<const typename TypeTree::extract_child_type<BaseOrdering_,TreePath>::type> NodeT;
63 typedef typename TypeTree::extract_child_type<BaseOrdering,TreePath>::type
TargetOrdering;
66 typedef typename BaseOrdering::Traits
Traits;
72 typedef typename BaseOrdering::CacheTag
CacheTag;
95 explicit SubOrdering(shared_ptr<const BaseOrdering> base_ordering)
96 : NodeT(TypeTree::extract_child_storage(*base_ordering,TreePath()))
97 , _base_ordering(base_ordering)
109 template<
typename ItIn,
typename ItOut>
119 map_lfs_indices_to_root_space(TreePath(),
130 template<
typename TP,
typename ItIn,
typename ItOut>
131 void map_lfs_indices_in_ancestor(TP tp, ItIn& begin, ItIn& end, ItOut out)
const
133 typedef typename TypeTree::extract_child_type<BaseOrdering,TP>::type Ordering;
141 begin.restore_back();
146 TypeTree::extract_child(
baseOrdering(),tp).map_lfs_indices(begin,end,out);
150 template<
typename TP,
typename ItIn,
typename ItOut>
154 map_lfs_indices_to_root_space(TP, ItIn begin, ItIn end, ItOut out)
const
156 map_lfs_indices_in_ancestor(TP(),begin,end,out);
158 map_lfs_indices_to_root_space(
typename TypeTree::TreePathPopBack<TP>::type(),begin,end,out);
162 template<
typename TP,
typename ItIn,
typename ItOut>
166 map_lfs_indices_to_root_space(TP, ItIn begin, ItIn end, ItOut out)
const
168 map_lfs_indices_in_ancestor(TP(),begin,end,out);
174 typename Traits::ContainerIndex
mapIndex(
const typename Traits::DOFIndex& di)
const
176 typename Traits::ContainerIndex ci;
182 void mapIndex(
typename Traits::DOFIndexView di,
typename Traits::ContainerIndex& ci)
const
188 typename Traits::SizeType
size()
const
206 bool contains(
typename Traits::SizeType codim)
const
220 return *_base_ordering;
226 return this->proxiedNode();
231 shared_ptr<const BaseOrdering> _base_ordering;
240 #endif // DUNE_PDELAB_ORDERING_SUBORDERING_HH
Mixin class for providing information about contained grid partitions.
Definition: partitioninfoprovider.hh:22
const TargetOrdering & targetOrdering() const
Returns the TargetOrdering.
Definition: subordering.hh:224
BaseOrdering::Traits Traits
Forwarded Ordering traits from BaseOrdering.
Definition: subordering.hh:66
TypeTree::extract_child_type< BaseOrdering, TreePath >::type TargetOrdering
The target ordering that makes up the root of this SubOrdering view.
Definition: subordering.hh:63
void setPartitionSet(const std::bitset< 6 > &partitions)
Sets the set of contained partitions to the passed-in value.
Definition: partitioninfoprovider.hh:58
bool fixedSize(typename Traits::SizeType codim) const
Returns whether the TargetOrdering is of fixed size for entities of codimension codim.
Definition: subordering.hh:212
A view on a subtree of a multi-component ordering.
Definition: subordering.hh:50
const BaseOrdering & baseOrdering() const
Returns the BaseOrdering.
Definition: subordering.hh:218
BaseOrdering::CacheTag CacheTag
Forwarded tag from BaseOrdering, required by PDELab internals.
Definition: subordering.hh:72
void map_lfs_indices(ItIn begin, const ItIn end, ItOut out) const
Definition: subordering.hh:110
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:182
Traits::ContainerIndex mapIndex(const typename Traits::DOFIndex &di) const
Maps di from the DOFIndex subtree to the ContainerIndex in the BaseOrdering.
Definition: subordering.hh:174
Traits::SizeType size() const
Returns the size of the BaseOrdering.
Definition: subordering.hh:188
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
bool contains(typename Traits::SizeType codim) const
Returns whether the TargetOrdering has DOFs attached to entities of codimension codim.
Definition: subordering.hh:206
BaseOrdering::ContainerAllocationTag ContainerAllocationTag
Forwarded tag from BaseOrdering, required by PDELab internals.
Definition: subordering.hh:69
void update()
Updates this SubOrdering.
Definition: subordering.hh:103
BaseOrdering_ BaseOrdering
The type of the BaseOrdering for which to represent a SubOrdering view.
Definition: subordering.hh:60
Traits::SizeType blockCount() const
Returns the block count of the BaseOrdering.
Definition: subordering.hh:194
static const bool has_dynamic_ordering_children
Forwarded ordering property from TargetOrdering, required by PDELab internals.
Definition: subordering.hh:75
static const bool consume_tree_index
Forwarded ordering property from TargetOrdering, required by PDELab internals.
Definition: subordering.hh:78
Traits::SizeType maxLocalSize() const
Returns the maximum per-entity size of the TargetOrdering.
Definition: subordering.hh:200
SubOrdering(shared_ptr< const BaseOrdering > base_ordering)
Constructs a SubOrdering for base_ordering.
Definition: subordering.hh:95