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())
74 :
NodeT(r.nodeStorage())
83 virtual void map_index_dynamic(
typename Traits::DOFIndexView di,
typename Traits::ContainerIndex& ci)
const override
88 typename Traits::ContainerIndex
mapIndex(
const typename Traits::DOFIndex& di)
const
90 typename Traits::ContainerIndex ci;
95 void mapIndex(
typename Traits::DOFIndexView di,
typename Traits::ContainerIndex& ci)
const
98 const typename Traits::SizeType geometry_type_index = Traits::DOFIndexAccessor::geometryType(di);
99 const typename Traits::SizeType entity_index = Traits::DOFIndexAccessor::entityIndex(di);
100 assert (di.treeIndex().size() == 1);
101 ci.push_back(di.treeIndex().back());
109 if (ci.size() < ci.capacity())
113 DUNE_THROW(Dune::Exception,
"Container blocking incompatible with backend structure");
127 if (ci.size() < ci.capacity())
128 ci.push_back(
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index);
131 DUNE_THROW(Dune::Exception,
"Container blocking incompatible with backend structure");
142 template<
typename ItIn,
typename ItOut>
145 typedef typename Traits::SizeType size_type;
151 for (ItIn in = begin; in != end; ++in, ++out)
153 assert(in->treeIndex().size() == 1);
154 out->push_back(in->treeIndex().back());
155 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
156 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
163 for (ItIn in = begin; in != end; ++in, ++out)
165 assert(in->treeIndex().size() == 1);
166 out->push_back(in->treeIndex().back());
167 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
168 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
178 for (ItIn in = begin; in != end; ++in, ++out)
180 assert(in->treeIndex().size() == 1);
181 out->push_back(in->treeIndex().back());
182 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
183 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
185 out->push_back(
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index);
190 for (ItIn in = begin; in != end; ++in, ++out)
192 assert(in->treeIndex().size() == 1);
193 out->push_back(in->treeIndex().back());
194 const size_type geometry_type_index = Traits::DOFIndexAccessor::geometryType(*in);
195 const size_type entity_index = Traits::DOFIndexAccessor::entityIndex(*in);
203 template<
typename CIOutIterator>
204 typename Traits::SizeType
206 typename Traits::SizeType child_index,
207 CIOutIterator ci_out,
const CIOutIterator ci_end)
const
209 typedef typename Traits::SizeType size_type;
211 const size_type geometry_type_index = Traits::DOFIndexAccessor::GeometryIndex::geometryType(ei);
212 const size_type entity_index = Traits::DOFIndexAccessor::GeometryIndex::entityIndex(ei);
222 for (size_type i = 0; i <
size; ++i, ++ci_out)
224 ci_out->push_back(i);
225 ci_out->push_back(
_gt_dof_offsets[geometry_type_index] + entity_index);
230 for (size_type i = 0; i <
size; ++i, ++ci_out)
232 ci_out->push_back(i);
240 size_type
index =
localOrdering()._gt_entity_offsets[geometry_type_index] + entity_index;
244 for (size_type i = 0; i <
size; ++i, ++ci_out)
246 ci_out->push_back(i);
247 ci_out->push_back(
index);
252 for (size_type i = 0; i <
size; ++i, ++ci_out)
254 ci_out->push_back(i);
265 virtual void update() = 0;
287 #endif // DUNE_PDELAB_ORDERING_LEAFORDERINGBASE_HH