Go to the documentation of this file.
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);
83 Traits::DOFIndexAccessor::GeometryIndex::geometryType(
index),
84 Traits::DOFIndexAccessor::GeometryIndex::entityIndex(
index)
93 else if (
_gt_used[geometry_type_index])
104 DUNE_THROW(NotImplemented,
"not implemented");
109 assert(child_index == 0);
133 static constexpr
auto GT_UNUSED = ~std::size_t(0);
135 typedef FiniteElementInterfaceSwitch<
136 typename FEM::Traits::FiniteElement
140 void update_a_priori_fixed_size()
145 template<
typename CodimMask>
146 void collect_used_codims(CodimMask& codims)
const
148 for (
typename ES::dim_type codim = 0; codim <= ES::dimension; ++codim)
149 if (
_fem->hasDOFs(codim))
153 template<
typename It>
154 void update_fixed_size(It it,
const It end)
161 const size_type
dim = Traits::GridView::dimension;
163 _gt_used.assign(GlobalGeometryTypeIndex::size(
dim),
false);
165 for (; it != end; ++it)
177 void pre_collect_used_geometry_types_from_cell()
180 const size_type
dim = Traits::GridView::dimension;
183 _gt_used.assign(GlobalGeometryTypeIndex::size(
dim),
false);
191 void collect_used_geometry_types_from_cell(
const typename Traits::GridView::template Codim<0>::Entity& cell)
195 const typename FESwitch::Coefficients& coeffs =
200 auto ref_el = ReferenceElements<typename Traits::GridView::ctype,Traits::GridView::dimension>::general(cell.type());
202 for (std::size_t i = 0; i < coeffs.size(); ++i)
204 const LocalKey& key = coeffs.localKey(i);
205 GeometryType gt = ref_el.type(key.subEntity(),key.codim());
212 template<
typename It>
213 void allocate_entity_offset_vector(It it,
const It end)
216 for (; it != end; ++it)
229 void extract_per_entity_sizes_from_cell(
const typename Traits::GridView::template Codim<0>::Entity& cell)
236 const typename FESwitch::Coefficients& coeffs =
241 auto ref_el = ReferenceElements<typename Traits::GridView::ctype,Traits::GridView::dimension>::general(cell.type());
243 for (std::size_t i = 0; i < coeffs.size(); ++i)
245 const LocalKey& key = coeffs.localKey(i);
246 GeometryType gt = ref_el.type(key.subEntity(),key.codim());
249 const size_type entity_index =
_es.indexSet().subIndex(cell,key.subEntity(),key.codim());
270 void finalize_non_fixed_size_update()
276 if (
size == GT_UNUSED)
307 std::shared_ptr<const FEM>
_fem;
336 #endif // DUNE_PDELAB_ORDERING_DIRECTLEAFLOCALORDERING_HH
std::size_t index
Definition: interpolate.hh:97
Gridview ordering for leaf spaces.
Definition: leafgridviewordering.hh:18
Definition: directleaflocalordering.hh:25
ES EntitySet
Definition: ordering/utility.hh:214
bool _fixed_size_possible
Definition: directleaflocalordering.hh:312
Traits::CodimFlag _codim_used
Definition: directleaflocalordering.hh:316
std::bitset< max_dim > CodimFlag
Definition: ordering/utility.hh:194
void map_lfs_indices(const ItIn begin, const ItIn end, ItOut out) const
Definition: directleaflocalordering.hh:57
std::vector< typename Traits::SizeType > _gt_dof_sizes
Definition: directleaflocalordering.hh:321
std::vector< typename Traits::SizeType > _local_gt_dof_sizes
Definition: directleaflocalordering.hh:323
GFSData * _gfs_data
Definition: directleaflocalordering.hh:327
bool _fixed_size
Definition: directleaflocalordering.hh:311
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:107
std::size_t SizeType
Definition: ordering/utility.hh:162
Definition: ordering/utility.hh:208
Generic infrastructure for orderings for leaf spaces.
Definition: leaforderingbase.hh:21
Traits::SizeType _max_local_size
Definition: directleaflocalordering.hh:313
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
DI::View::TreeIndex TreeIndexView
Definition: ordering/utility.hh:199
Traits::SizeType size(const typename Traits::DOFIndex::EntityIndex &index) const
Definition: directleaflocalordering.hh:80
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:102
std::shared_ptr< const FEM > _fem
Definition: directleaflocalordering.hh:307
const bool _container_blocked
Definition: directleaflocalordering.hh:314
LocalOrderingTraits< ES, DI, CI > Traits
Definition: directleaflocalordering.hh:40
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
DI::size_type SizeType
Definition: ordering/utility.hh:201
std::vector< typename Traits::SizeType > _entity_dof_offsets
Definition: directleaflocalordering.hh:322
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
std::vector< bool > _gt_used
Definition: directleaflocalordering.hh:318
CI ContainerIndex
Definition: ordering/utility.hh:160
Traits::SizeType size(const typename Traits::SizeType geometry_type_index, const typename Traits::SizeType entity_index) const
Definition: directleaflocalordering.hh:88
std::vector< typename Traits::SizeType > _gt_entity_offsets
Definition: directleaflocalordering.hh:320
const FEM & finiteElementMap() const
Definition: directleaflocalordering.hh:126
static const int dim
Definition: adaptivity.hh:84
const Traits::EntitySet & entitySet() const
Definition: directleaflocalordering.hh:121
Traits::CodimFlag _codim_fixed_size
Definition: directleaflocalordering.hh:317
FESwitch::Store _fe_store
Definition: directleaflocalordering.hh:308
ES _es
Definition: directleaflocalordering.hh:310
DirectLeafLocalOrdering(const std::shared_ptr< const FEM > &fem, const ES &es)
Definition: directleaflocalordering.hh:113
const std::string s
Definition: function.hh:843