24#ifndef DUMUX_GRIDVIEW_GEOMETRIC_ENTITY_SET_HH
25#define DUMUX_GRIDVIEW_GEOMETRIC_ENTITY_SET_HH
28#include <dune/grid/common/mcmgmapper.hh>
39template <
class Gr
idView,
int codim = 0,
class Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<Gr
idView>>
44 using Entity =
typename GridView::template Codim<codim>::Entity;
53 , entityMap_(std::make_shared<
EntityMap>(gridView.grid(), mapper_))
58 std::shared_ptr<const EntityMap> entityMap)
61 , entityMap_(entityMap)
72 using ctype =
typename GridView::ctype;
77 decltype(
auto)
size()
const
78 {
return gridView_.size(codim); }
84 {
return entities(gridView_, Dune::Codim<codim>()).begin(); }
89 decltype(
auto)
end()
const
90 {
return entities(gridView_, Dune::Codim<codim>()).end(); }
96 {
return mapper_.index(e); }
102 {
return (*entityMap_)[
index]; }
107 std::shared_ptr<const EntityMap> entityMap_;
A map from indices to entities using grid entity seeds.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Definition: common/properties/model.hh:34
A map from indices to entities using grid entity seeds.
Definition: entitymap.hh:39
An interface for a set of geometric entities.
Definition: geometricentityset.hh:41
typename GridView::ctype ctype
the coordinate type
Definition: geometricentityset.hh:72
GridViewGeometricEntitySet(const GridView &gridView, const Mapper &mapper)
Definition: geometricentityset.hh:50
std::size_t index(const Entity &e) const
get an entities index
Definition: geometricentityset.hh:95
typename GridView::template Codim< codim >::Entity Entity
Definition: geometricentityset.hh:44
decltype(auto) size() const
the number of entities in this set
Definition: geometricentityset.hh:77
GridViewGeometricEntitySet(const GridView &gridView)
Definition: geometricentityset.hh:46
Entity entity(std::size_t index) const
get an entity from an index
Definition: geometricentityset.hh:101
decltype(auto) end() const
end iterator to enable range-based for iteration
Definition: geometricentityset.hh:89
GridViewGeometricEntitySet(const GridView &gridView, const Mapper &mapper, std::shared_ptr< const EntityMap > entityMap)
Definition: geometricentityset.hh:56
decltype(auto) begin() const
begin iterator to enable range-based for iteration
Definition: geometricentityset.hh:83
@ dimensionworld
Definition: geometricentityset.hh:67