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)
69 : NodeT(r.nodeStorage())
77 : NodeT(r.nodeStorage())
86 virtual void map_index_dynamic(
typename Traits::DOFIndexView di,
typename Traits::ContainerIndex& ci)
const
91 typename Traits::ContainerIndex
mapIndex(
const typename Traits::DOFIndex& di)
const
93 typename Traits::ContainerIndex ci;
98 void mapIndex(
typename Traits::DOFIndexView di,
typename Traits::ContainerIndex& ci)
const
101 const typename Traits::SizeType geometry_type_index = Traits::DOFIndexAccessor::geometryType(di);
102 const typename Traits::SizeType entity_index = Traits::DOFIndexAccessor::entityIndex(di);
103 assert (di.treeIndex().size() == 1);
104 ci.push_back(di.treeIndex().back());
112 if (ci.size() < ci.capacity())
116 DUNE_THROW(Dune::Exception,
"Container blocking incompatible with backend structure");
130 if (ci.size() < ci.capacity())
131 ci.push_back(
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index);
134 DUNE_THROW(Dune::Exception,
"Container blocking incompatible with backend structure");
145 template<
typename ItIn,
typename ItOut>
148 typedef typename Traits::SizeType size_type;
154 for (ItIn in = begin; in != end; ++in, ++out)
156 assert(in->treeIndex().size() == 1);
157 out->push_back(in->treeIndex().back());
158 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
159 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
166 for (ItIn in = begin; in != end; ++in, ++out)
168 assert(in->treeIndex().size() == 1);
169 out->push_back(in->treeIndex().back());
170 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
171 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
181 for (ItIn in = begin; in != end; ++in, ++out)
183 assert(in->treeIndex().size() == 1);
184 out->push_back(in->treeIndex().back());
185 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
186 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
188 out->push_back(
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index);
193 for (ItIn in = begin; in != end; ++in, ++out)
195 assert(in->treeIndex().size() == 1);
196 out->push_back(in->treeIndex().back());
197 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
198 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
206 template<
typename CIOutIterator>
207 typename Traits::SizeType
209 typename Traits::SizeType child_index,
210 CIOutIterator ci_out,
const CIOutIterator ci_end)
const
212 typedef typename Traits::SizeType size_type;
214 const size_type geometry_type_index = Traits::DOFIndexAccessor::GeometryIndex::geometryType(ei);
215 const size_type entity_index = Traits::DOFIndexAccessor::GeometryIndex::entityIndex(ei);
225 for (size_type i = 0; i <
size; ++i, ++ci_out)
227 ci_out->push_back(i);
228 ci_out->push_back(
_gt_dof_offsets[geometry_type_index] + entity_index);
233 for (size_type i = 0; i <
size; ++i, ++ci_out)
235 ci_out->push_back(i);
243 size_type index =
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index;
247 for (size_type i = 0; i <
size; ++i, ++ci_out)
249 ci_out->push_back(i);
250 ci_out->push_back(index);
255 for (size_type i = 0; i <
size; ++i, ++ci_out)
257 ci_out->push_back(i);
258 ci_out->back() +=
localOrdering()._entity_dof_offsets[index];
268 virtual void update() = 0;
290 #endif // DUNE_PDELAB_ORDERING_LEAFORDERING_HH
Generic infrastructure for orderings for leaf spaces.
Definition: leaforderingbase.hh:21
TypeTree::CompositeNode< LocalOrdering > NodeT
Definition: leaforderingbase.hh:37
std::size_t _size
Definition: orderingbase.hh:289
bool fixedSize(typename Traits::SizeType codim) const
Definition: orderingbase.hh:215
LocalOrdering & localOrdering()
Definition: leaforderingbase.hh:44
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:208
OrderingBase< typename LocalOrdering::Traits::DOFIndex, typename LocalOrdering::Traits::ContainerIndex > BaseT
Definition: leaforderingbase.hh:40
std::size_t _max_local_size
Definition: orderingbase.hh:288
std::size_t _block_count
Definition: orderingbase.hh:290
LocalOrdering::Traits Traits
Definition: leaforderingbase.hh:29
const bool _container_blocked
Definition: orderingbase.hh:276
Traits::ContainerIndex mapIndex(const typename Traits::DOFIndex &di) const
Definition: leaforderingbase.hh:91
std::vector< typename Traits::SizeType > _gt_dof_offsets
Definition: leaforderingbase.hh:282
void mapIndex(typename Traits::DOFIndexView di, typename Traits::ContainerIndex &ci) const
Definition: leaforderingbase.hh:98
const LocalOrdering & localOrdering() const
Definition: leaforderingbase.hh:49
bool _fixed_size
Definition: orderingbase.hh:275
LeafOrderingBase(const typename NodeT::NodeStorage &local_ordering, bool container_blocked, typename BaseT::GFSData *gfs_data)
Definition: leaforderingbase.hh:55
void setPartitionSet(const std::bitset< 6 > &partitions)
Sets the set of contained partitions to the passed-in value.
Definition: partitioninfoprovider.hh:58
Traits::SizeType size() const
Definition: orderingbase.hh:63
Traits::CodimFlag _codim_used
Definition: orderingbase.hh:285
void map_lfs_indices(const ItIn begin, const ItIn end, ItOut out) const
Definition: leaforderingbase.hh:146
Definition: adaptivity.hh:27
Dune::PDELab::impl::GridFunctionSpaceOrderingData< typename Traits::SizeType > GFSData
Definition: orderingbase.hh:34
virtual void map_index_dynamic(typename Traits::DOFIndexView di, typename Traits::ContainerIndex &ci) const
Definition: leaforderingbase.hh:86
void setDelegate(const VirtualOrderingBase< LocalOrdering::Traits::DOFIndex, LocalOrdering::Traits::ContainerIndex > *delegate)
Set the delegate called in mapIndex().
Definition: orderingbase.hh:228
static const bool has_dynamic_ordering_children
Definition: leaforderingbase.hh:31
static const bool consume_tree_index
Definition: leaforderingbase.hh:33
Definition: ordering/utility.hh:230
Definition: orderingbase.hh:21
Traits::CodimFlag _codim_fixed_size
Definition: orderingbase.hh:286