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())
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);
267 virtual void update() = 0;
289 #endif // DUNE_PDELAB_ORDERING_LEAFORDERINGBASE_HH