4#ifndef DUNE_PDELAB_ORDERING_LEAFORDERINGBASE_HH
5#define DUNE_PDELAB_ORDERING_LEAFORDERINGBASE_HH
7#include <dune/typetree/typetree.hh>
20 template<
typename LocalOrdering>
22 :
public TypeTree::CompositeNode<LocalOrdering>
24 typename LocalOrdering::Traits::ContainerIndex>
25 ,
public OrderingBase<typename LocalOrdering::Traits::DOFIndex,
26 typename LocalOrdering::Traits::ContainerIndex>
29 typedef typename LocalOrdering::Traits
Traits;
37 typedef TypeTree::CompositeNode<LocalOrdering>
NodeT;
39 typedef OrderingBase<
typename LocalOrdering::Traits::DOFIndex,
40 typename LocalOrdering::Traits::ContainerIndex>
BaseT;
46 return this->
template child<0>();
51 return this->
template child<0>();
56 :
NodeT(local_ordering)
57 ,
BaseT(*this,container_blocked,gfs_data,this)
66 :
NodeT(r.nodeStorage())
73 LeafOrderingBase(LeafOrderingBase&& r)
74 :
NodeT(r.nodeStorage())
85 virtual void map_index_dynamic(
typename Traits::DOFIndexView di,
typename Traits::ContainerIndex& ci)
const override
90 typename Traits::ContainerIndex
mapIndex(
const typename Traits::DOFIndex& di)
const
92 typename Traits::ContainerIndex ci;
97 void mapIndex(
typename Traits::DOFIndexView di,
typename Traits::ContainerIndex& ci)
const
100 const typename Traits::SizeType geometry_type_index = Traits::DOFIndexAccessor::geometryType(di);
101 const typename Traits::SizeType entity_index = Traits::DOFIndexAccessor::entityIndex(di);
102 assert (di.treeIndex().size() == 1);
103 ci.push_back(di.treeIndex().back());
111 if (ci.size() < ci.capacity())
115 DUNE_THROW(Dune::Exception,
"Container blocking incompatible with backend structure");
129 if (ci.size() < ci.capacity())
130 ci.push_back(
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index);
133 DUNE_THROW(Dune::Exception,
"Container blocking incompatible with backend structure");
144 template<
typename ItIn,
typename ItOut>
147 typedef typename Traits::SizeType size_type;
153 for (ItIn in = begin; in != end; ++in, ++out)
155 assert(in->treeIndex().size() == 1);
156 out->push_back(in->treeIndex().back());
157 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
158 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
165 for (ItIn in = begin; in != end; ++in, ++out)
167 assert(in->treeIndex().size() == 1);
168 out->push_back(in->treeIndex().back());
169 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
170 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
180 for (ItIn in = begin; in != end; ++in, ++out)
182 assert(in->treeIndex().size() == 1);
183 out->push_back(in->treeIndex().back());
184 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
185 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
187 out->push_back(
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index);
192 for (ItIn in = begin; in != end; ++in, ++out)
194 assert(in->treeIndex().size() == 1);
195 out->push_back(in->treeIndex().back());
196 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
197 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
205 template<
typename CIOutIterator>
206 typename Traits::SizeType
208 typename Traits::SizeType child_index,
209 CIOutIterator ci_out,
const CIOutIterator ci_end)
const
211 typedef typename Traits::SizeType size_type;
213 const size_type geometry_type_index = Traits::DOFIndexAccessor::GeometryIndex::geometryType(ei);
214 const size_type entity_index = Traits::DOFIndexAccessor::GeometryIndex::entityIndex(ei);
224 for (size_type i = 0; i <
size; ++i, ++ci_out)
226 ci_out->push_back(i);
227 ci_out->push_back(
_gt_dof_offsets[geometry_type_index] + entity_index);
232 for (size_type i = 0; i <
size; ++i, ++ci_out)
234 ci_out->push_back(i);
242 size_type
index =
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index;
246 for (size_type i = 0; i <
size; ++i, ++ci_out)
248 ci_out->push_back(i);
249 ci_out->push_back(
index);
254 for (size_type i = 0; i <
size; ++i, ++ci_out)
256 ci_out->push_back(i);
std::size_t index
Definition: interpolate.hh:97
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Generic infrastructure for orderings for leaf spaces.
Definition: leaforderingbase.hh:27
OrderingBase< typename LocalOrdering::Traits::DOFIndex, typename LocalOrdering::Traits::ContainerIndex > BaseT
Definition: leaforderingbase.hh:40
LocalOrdering & localOrdering()
Definition: leaforderingbase.hh:44
LeafOrderingBase(const typename NodeT::NodeStorage &local_ordering, bool container_blocked, typename BaseT::GFSData *gfs_data)
Definition: leaforderingbase.hh:55
LocalOrdering::Traits Traits
Definition: leaforderingbase.hh:29
Traits::SizeType extract_entity_indices(const typename Traits::DOFIndex::EntityIndex &ei, typename Traits::SizeType child_index, CIOutIterator ci_out, const CIOutIterator ci_end) const
Definition: leaforderingbase.hh:207
virtual ~LeafOrderingBase() override=default
virtual void map_index_dynamic(typename Traits::DOFIndexView di, typename Traits::ContainerIndex &ci) const override
Definition: leaforderingbase.hh:85
const LocalOrdering & localOrdering() const
Definition: leaforderingbase.hh:49
static const bool has_dynamic_ordering_children
Definition: leaforderingbase.hh:31
void mapIndex(typename Traits::DOFIndexView di, typename Traits::ContainerIndex &ci) const
Definition: leaforderingbase.hh:97
std::vector< typename Traits::SizeType > _gt_dof_offsets
Definition: leaforderingbase.hh:281
Traits::ContainerIndex mapIndex(const typename Traits::DOFIndex &di) const
Definition: leaforderingbase.hh:90
void map_lfs_indices(const ItIn begin, const ItIn end, ItOut out) const
Definition: leaforderingbase.hh:145
static const bool consume_tree_index
Definition: leaforderingbase.hh:33
TypeTree::CompositeNode< LocalOrdering > NodeT
Definition: leaforderingbase.hh:37
bool _fixed_size
Definition: orderingbase.hh:274
const bool _container_blocked
Definition: orderingbase.hh:275
Definition: orderingbase.hh:21
Dune::PDELab::impl::GridFunctionSpaceOrderingData< typename Traits::SizeType > GFSData
Definition: orderingbase.hh:32
Traits::CodimFlag _codim_fixed_size
Definition: orderingbase.hh:285
bool fixedSize() const
Definition: orderingbase.hh:209
Traits::CodimFlag _codim_used
Definition: orderingbase.hh:284
std::size_t _size
Definition: orderingbase.hh:288
void setDelegate(const VirtualOrderingBase< LocalOrdering::Traits::DOFIndex, LocalOrdering::Traits::ContainerIndex > *delegate)
Set the delegate called in mapIndex().
Definition: orderingbase.hh:227
Traits::SizeType size() const
Definition: orderingbase.hh:61
std::size_t _max_local_size
Definition: orderingbase.hh:287
std::size_t _block_count
Definition: orderingbase.hh:289
bool _fixed_size
Definition: orderingbase.hh:274
const bool _container_blocked
Definition: orderingbase.hh:275
Definition: ordering/utility.hh:243