4 #ifndef DUNE_PDELAB_ORDERING_DIRECTLEAFLOCALORDERING_HH
5 #define DUNE_PDELAB_ORDERING_DIRECTLEAFLOCALORDERING_HH
7 #include <dune/typetree/leafnode.hh>
9 #include <dune/geometry/referenceelements.hh>
10 #include <dune/localfunctions/common/interfaceswitch.hh>
11 #include <dune/localfunctions/common/localkey.hh>
24 template<
typename OrderingTag,
typename FEM,
typename ES,
typename DI,
typename CI>
26 :
public TypeTree::LeafNode
35 template<
typename size_type>
36 friend struct ::Dune::PDELab::impl::update_ordering_data;
44 typedef impl::GridFunctionSpaceOrderingData<typename Traits::SizeType> GFSData;
53 DUNE_THROW(NotImplemented,
"not implemented");
56 template<
typename ItIn,
typename ItOut>
62 template<
typename CIOutIterator,
typename DIOutIterator = DummyDOFIndexIterator>
66 CIOutIterator ci_out,
const CIOutIterator ci_end,
67 DIOutIterator di_out = DIOutIterator())
const
73 di_out->treeIndex().push_back(i);
91 const typename Traits::DOFIndex::EntityIndex &
index)
const {
92 if (suffix.size() == 0) {
102 Traits::DOFIndexAccessor::GeometryIndex::geometryType(
index),
103 Traits::DOFIndexAccessor::GeometryIndex::entityIndex(
index)
112 else if (
_gt_used[geometry_type_index])
123 DUNE_THROW(NotImplemented,
"not implemented");
128 assert(child_index == 0);
152 static constexpr
auto GT_UNUSED = ~std::size_t(0);
154 typedef FiniteElementInterfaceSwitch<
155 typename FEM::Traits::FiniteElement
159 void update_a_priori_fixed_size()
164 template<
typename CodimMask>
165 void collect_used_codims(CodimMask& codims)
const
167 for (
typename ES::dim_type codim = 0; codim <= ES::dimension; ++codim)
168 if (
_fem->hasDOFs(codim))
172 template<
typename It>
173 void update_fixed_size(It it,
const It end)
180 const size_type
dim = Traits::GridView::dimension;
182 _gt_used.assign(GlobalGeometryTypeIndex::size(
dim),
false);
184 for (; it != end; ++it)
196 void pre_collect_used_geometry_types_from_cell()
199 const size_type
dim = Traits::GridView::dimension;
202 _gt_used.assign(GlobalGeometryTypeIndex::size(
dim),
false);
210 void collect_used_geometry_types_from_cell(
const typename Traits::GridView::template Codim<0>::Entity& cell)
214 const typename FESwitch::Coefficients& coeffs =
219 auto ref_el = ReferenceElements<typename Traits::GridView::ctype,Traits::GridView::dimension>::general(cell.type());
221 for (std::size_t i = 0; i < coeffs.size(); ++i)
223 const LocalKey& key = coeffs.localKey(i);
224 GeometryType gt = ref_el.type(key.subEntity(),key.codim());
231 template<
typename It>
232 void allocate_entity_offset_vector(It it,
const It end)
235 for (; it != end; ++it)
248 void extract_per_entity_sizes_from_cell(
const typename Traits::GridView::template Codim<0>::Entity& cell)
255 const typename FESwitch::Coefficients& coeffs =
260 auto ref_el = ReferenceElements<typename Traits::GridView::ctype,Traits::GridView::dimension>::general(cell.type());
262 for (std::size_t i = 0; i < coeffs.size(); ++i)
264 const LocalKey& key = coeffs.localKey(i);
265 GeometryType gt = ref_el.type(key.subEntity(),key.codim());
268 const size_type entity_index =
_es.indexSet().subIndex(cell,key.subEntity(),key.codim());
289 void finalize_non_fixed_size_update()
295 if (
size == GT_UNUSED)
326 std::shared_ptr<const FEM>
_fem;
static const int dim
Definition: adaptivity.hh:84
const std::string s
Definition: function.hh:843
std::size_t index
Definition: interpolate.hh:97
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Definition: directleaflocalordering.hh:27
FESwitch::Store _fe_store
Definition: directleaflocalordering.hh:327
Traits::SizeType offset(const typename Traits::SizeType geometry_type_index, const typename Traits::SizeType entity_index, const typename Traits::SizeType child_index) const
Definition: directleaflocalordering.hh:126
DirectLeafLocalOrdering(const std::shared_ptr< const FEM > &fem, const ES &es)
Definition: directleaflocalordering.hh:132
Traits::CodimFlag _codim_used
Definition: directleaflocalordering.hh:335
void map_local_index(const typename Traits::SizeType geometry_type_index, const typename Traits::SizeType entity_index, typename Traits::TreeIndexView mi, typename Traits::ContainerIndex &ci) const
Definition: directleaflocalordering.hh:48
const Traits::EntitySet & entitySet() const
Definition: directleaflocalordering.hh:140
std::vector< bool > _gt_used
Definition: directleaflocalordering.hh:337
bool _fixed_size
Definition: directleaflocalordering.hh:330
ES _es
Definition: directleaflocalordering.hh:329
std::vector< typename Traits::SizeType > _gt_dof_sizes
Definition: directleaflocalordering.hh:340
std::vector< typename Traits::SizeType > _entity_dof_offsets
Definition: directleaflocalordering.hh:341
void map_lfs_indices(const ItIn begin, const ItIn end, ItOut out) const
Definition: directleaflocalordering.hh:57
Traits::CodimFlag _codim_fixed_size
Definition: directleaflocalordering.hh:336
std::vector< typename Traits::SizeType > _gt_entity_offsets
Definition: directleaflocalordering.hh:339
Traits::SizeType size(const typename Traits::SizeType geometry_type_index, const typename Traits::SizeType entity_index, const typename Traits::SizeType child_index) const
Definition: directleaflocalordering.hh:121
std::shared_ptr< const FEM > _fem
Definition: directleaflocalordering.hh:326
bool _fixed_size_possible
Definition: directleaflocalordering.hh:331
GFSData * _gfs_data
Definition: directleaflocalordering.hh:346
const bool _container_blocked
Definition: directleaflocalordering.hh:333
Traits::SizeType size(const typename Traits::DOFIndex::EntityIndex &index) const
Definition: directleaflocalordering.hh:99
Traits::SizeType _max_local_size
Definition: directleaflocalordering.hh:332
LocalOrderingTraits< ES, DI, CI > Traits
Definition: directleaflocalordering.hh:40
Traits::SizeType extract_entity_indices(const typename Traits::DOFIndex::EntityIndex &ei, typename Traits::SizeType child_index, CIOutIterator ci_out, const CIOutIterator ci_end, DIOutIterator di_out=DIOutIterator()) const
Definition: directleaflocalordering.hh:64
Traits::SizeType size(const typename Traits::SizeType geometry_type_index, const typename Traits::SizeType entity_index) const
Definition: directleaflocalordering.hh:107
Traits::SizeType size(const typename Traits::ContainerIndex &suffix, const typename Traits::DOFIndex::EntityIndex &index) const
Returns the size for a given suffix.
Definition: directleaflocalordering.hh:90
std::vector< typename Traits::SizeType > _local_gt_dof_sizes
Definition: directleaflocalordering.hh:342
const FEM & finiteElementMap() const
Definition: directleaflocalordering.hh:145
Gridview ordering for leaf spaces.
Definition: leafgridviewordering.hh:20
Generic infrastructure for orderings for leaf spaces.
Definition: leaforderingbase.hh:27
std::size_t SizeType
Definition: ordering/utility.hh:178
CI ContainerIndex
Definition: ordering/utility.hh:176
std::bitset< max_dim > CodimFlag
Definition: ordering/utility.hh:211
DI::size_type SizeType
Definition: ordering/utility.hh:218
DI::View::TreeIndex TreeIndexView
Definition: ordering/utility.hh:216
Definition: ordering/utility.hh:224
ES EntitySet
Definition: ordering/utility.hh:226