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::VariadicCompositeNode<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::VariadicCompositeNode<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)
69 :
NodeT(r.nodeStorage())
76 #if HAVE_RVALUE_REFERENCES
79 :
NodeT(r.nodeStorage())
86 #endif // HAVE_RVALUE_REFERENCES
90 virtual void map_index_dynamic(
typename Traits::DOFIndexView di,
typename Traits::ContainerIndex& ci)
const
95 typename Traits::ContainerIndex
mapIndex(
const typename Traits::DOFIndex& di)
const
97 typename Traits::ContainerIndex ci;
102 void mapIndex(
typename Traits::DOFIndexView di,
typename Traits::ContainerIndex& ci)
const
105 const typename Traits::SizeType geometry_type_index = Traits::DOFIndexAccessor::geometryType(di);
106 const typename Traits::SizeType entity_index = Traits::DOFIndexAccessor::entityIndex(di);
107 assert (di.treeIndex().size() == 1);
108 ci.push_back(di.treeIndex().back());
116 if (ci.size() < ci.capacity())
120 DUNE_THROW(Dune::Exception,
"Container blocking incompatible with backend structure");
134 if (ci.size() < ci.capacity())
135 ci.push_back(
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index);
138 DUNE_THROW(Dune::Exception,
"Container blocking incompatible with backend structure");
149 template<
typename ItIn,
typename ItOut>
152 typedef typename Traits::SizeType size_type;
158 for (ItIn in = begin; in != end; ++in, ++out)
160 assert(in->treeIndex().size() == 1);
161 out->push_back(in->treeIndex().back());
162 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
163 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
170 for (ItIn in = begin; in != end; ++in, ++out)
172 assert(in->treeIndex().size() == 1);
173 out->push_back(in->treeIndex().back());
174 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
175 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
185 for (ItIn in = begin; in != end; ++in, ++out)
187 assert(in->treeIndex().size() == 1);
188 out->push_back(in->treeIndex().back());
189 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
190 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
192 out->push_back(
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index);
197 for (ItIn in = begin; in != end; ++in, ++out)
199 assert(in->treeIndex().size() == 1);
200 out->push_back(in->treeIndex().back());
201 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
202 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
210 template<
typename CIOutIterator>
211 typename Traits::SizeType
213 typename Traits::SizeType child_index,
214 CIOutIterator ci_out,
const CIOutIterator ci_end)
const
216 typedef typename Traits::SizeType size_type;
218 const size_type geometry_type_index = Traits::DOFIndexAccessor::GeometryIndex::geometryType(ei);
219 const size_type entity_index = Traits::DOFIndexAccessor::GeometryIndex::entityIndex(ei);
229 for (size_type i = 0; i <
size; ++i, ++ci_out)
231 ci_out->push_back(i);
232 ci_out->push_back(
_gt_dof_offsets[geometry_type_index] + entity_index);
237 for (size_type i = 0; i <
size; ++i, ++ci_out)
239 ci_out->push_back(i);
247 size_type index =
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index;
251 for (size_type i = 0; i <
size; ++i, ++ci_out)
253 ci_out->push_back(i);
254 ci_out->push_back(index);
259 for (size_type i = 0; i <
size; ++i, ++ci_out)
261 ci_out->push_back(i);
262 ci_out->back() +=
localOrdering()._entity_dof_offsets[index];
272 virtual void update() = 0;
294 #endif // DUNE_PDELAB_ORDERING_LEAFORDERING_HH
bool fixedSize(typename Traits::SizeType codim) const
Definition: orderingbase.hh:214
Traits::CodimFlag _codim_fixed_size
Definition: orderingbase.hh:285
std::size_t _max_local_size
Definition: orderingbase.hh:287
static const bool has_dynamic_ordering_children
Definition: leaforderingbase.hh:31
bool _fixed_size
Definition: orderingbase.hh:274
LocalOrdering::Traits Traits
Definition: leaforderingbase.hh:29
void setPartitionSet(const std::bitset< 6 > &partitions)
Sets the set of contained partitions to the passed-in value.
Definition: partitioninfoprovider.hh:58
Definition: orderingbase.hh:22
virtual void map_index_dynamic(typename Traits::DOFIndexView di, typename Traits::ContainerIndex &ci) const
Definition: leaforderingbase.hh:90
Definition: ordering/utility.hh:230
static const bool consume_tree_index
Definition: leaforderingbase.hh:33
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:212
TypeTree::VariadicCompositeNode< LocalOrdering > NodeT
Definition: leaforderingbase.hh:37
Generic infrastructure for orderings for leaf spaces.
Definition: leaforderingbase.hh:21
std::vector< typename Traits::SizeType > _gt_dof_offsets
Definition: leaforderingbase.hh:286
Traits::SizeType size() const
Definition: orderingbase.hh:64
LocalOrdering & localOrdering()
Definition: leaforderingbase.hh:44
Traits::CodimFlag _codim_used
Definition: orderingbase.hh:284
LeafOrderingBase(const typename NodeT::NodeStorage &local_ordering, bool container_blocked, typename BaseT::GFSData *gfs_data)
Definition: leaforderingbase.hh:55
Traits::ContainerIndex mapIndex(const typename Traits::DOFIndex &di) const
Definition: leaforderingbase.hh:95
void mapIndex(typename Traits::DOFIndexView di, typename Traits::ContainerIndex &ci) const
Definition: leaforderingbase.hh:102
std::size_t _block_count
Definition: orderingbase.hh:289
OrderingBase< typename LocalOrdering::Traits::DOFIndex, typename LocalOrdering::Traits::ContainerIndex > BaseT
Definition: leaforderingbase.hh:40
const LocalOrdering & localOrdering() const
Definition: leaforderingbase.hh:49
void map_lfs_indices(const ItIn begin, const ItIn end, ItOut out) const
Definition: leaforderingbase.hh:150
std::size_t _size
Definition: orderingbase.hh:288
const bool _container_blocked
Definition: orderingbase.hh:275
Dune::PDELab::impl::GridFunctionSpaceOrderingData< typename Traits::SizeType > GFSData
Definition: orderingbase.hh:35
void setDelegate(const VirtualOrderingBase< LocalOrdering::Traits::DOFIndex, LocalOrdering::Traits::ContainerIndex > *delegate)
Set the delegate called in mapIndex().
Definition: orderingbase.hh:227