7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LEAFPREBASISMAPPERMIXIN_HH
10#include <dune/common/rangeutilities.hh>
14#include <dune/geometry/referenceelements.hh>
16#include <dune/grid/common/mcmgmapper.hh>
30template<
class Gr
idView,
class LocalCoefficients>
31auto subIndexRange(
const Dune::MultipleCodimMultipleGeomTypeMapper<GridView>& mapper,
const typename GridView::template Codim<0>::Entity& element,
const LocalCoefficients& localCoefficients)
35 return Dune::transformedRangeView(Dune::range(localCoefficients.size()), [&](
auto localIndex) {
36 auto localKey = localCoefficients.localKey(localIndex);
37 return mapper.subIndex(element, localKey.subEntity(), localKey.codim()) + localKey.index();
63 static const int gridDim = GV::dimension;
85 for(
const GeometryType& elementType :
gridView_.indexSet().types(0))
87 auto referenceElement = Dune::referenceElement<double, gridDim>(elementType);
88 for(
auto codim : Dune::range(gridDim+1))
89 for(
auto i : Dune::range(referenceElement.size(codim)))
120 template<
class Node,
class It>
123 for(
const auto& globalIndex :
subIndexRange(
mapper_, node.element(), node.finiteElement().localCoefficients()))
133 Dune::MultipleCodimMultipleGeomTypeMapper<GridView>
mapper_;
Definition polynomial.hh:18
auto subIndexRange(const Dune::MultipleCodimMultipleGeomTypeMapper< GridView > &mapper, const typename GridView::template Codim< 0 >::Entity &element, const LocalCoefficients &localCoefficients)
Definition leafprebasismappermixin.hh:31
A generic MixIn class for PreBasis with flat indices computed from a mapper.
Definition leafprebasismappermixin.hh:62
const GridView & gridView() const
Export the stored GridView.
Definition leafprebasismappermixin.hh:95
size_type dimension() const
Return total number of basis functions.
Definition leafprebasismappermixin.hh:108
std::size_t maxNodeSize_
Definition leafprebasismappermixin.hh:134
Dune::MultipleCodimMultipleGeomTypeMapper< GridView > mapper_
Definition leafprebasismappermixin.hh:133
std::size_t size_type
Type used for index digits.
Definition leafprebasismappermixin.hh:71
void update(const GridView &gv)
Update the stored GridView.
Definition leafprebasismappermixin.hh:101
LeafPreBasisMapperMixin(const GridView &gv, Dune::MCMGLayout layout)
Construct from GridView and local DOF layout.
Definition leafprebasismappermixin.hh:74
GV GridView
Type of the associated GridView.
Definition leafprebasismappermixin.hh:68
size_type maxNodeSize() const
Return maximal number of basis functions per element.
Definition leafprebasismappermixin.hh:114
GridView gridView_
Definition leafprebasismappermixin.hh:132
void initializeIndices()
Initialize the global index information.
Definition leafprebasismappermixin.hh:80
It indices(const Node &node, It it) const
Fill cache with global indices of DOFs associated to the given bound node.
Definition leafprebasismappermixin.hh:121
A generic MixIn class for PreBasis.
Definition leafprebasismixin.hh:36