3#ifndef DUNE_MMESH_RANGEGENERATORS_HH
4#define DUNE_MMESH_RANGEGENERATORS_HH
6#include <dune/common/iteratorrange.hh>
13 template<
typename Entity>
14 inline auto incidentElements(
const Entity& entity)
15#ifndef DOXYGEN_SHOULD_SKIP_THIS
16 -> IteratorRange<
decltype(entity.impl().incidentBegin())>
19 static_assert(Entity::mydimension <= 1,
"Incident element range iterator is only available for vertices and edges!");
20 return IteratorRange<
decltype(entity.impl().incidentBegin())>(entity.impl().incidentBegin(), entity.impl().incidentEnd());
26 template<
typename Vertex>
27 inline auto incidentFacets(
const Vertex& vertex)
28#ifndef DOXYGEN_SHOULD_SKIP_THIS
29 -> IteratorRange<
decltype(vertex.impl().incidentFacetsBegin())>
32 static_assert(Vertex::mydimension == 0,
"Incident facet range iterator is only available for vertices!");
33 return IteratorRange<
decltype(vertex.impl().incidentFacetsBegin())>(vertex.impl().incidentFacetsBegin(),vertex.impl().incidentFacetsEnd());
39 template<
typename Vertex>
40 inline auto incidentVertices(
const Vertex& vertex,
bool includeInfinite =
false)
41#ifndef DOXYGEN_SHOULD_SKIP_THIS
42 -> IteratorRange<
decltype(vertex.impl().incidentVerticesBegin( includeInfinite ))>
45 static_assert(Vertex::mydimension == 0,
"Incident vertices range iterator is only available for vertices!");
46 return IteratorRange<
decltype(vertex.impl().incidentVerticesBegin( includeInfinite ))>(
47 vertex.impl().incidentVerticesBegin( includeInfinite ),
48 vertex.impl().incidentVerticesEnd( includeInfinite )
55 template<
typename Gr
idView,
int codim = 1>
56 inline auto interfaceElements(
const GridView& gv,
bool includeBoundary =
false)
57#ifndef DOXYGEN_SHOULD_SKIP_THIS
58 -> IteratorRange<
decltype(gv.grid().template interfaceBegin<codim>( includeBoundary ))>
61 return IteratorRange<
decltype(gv.grid().template interfaceBegin<codim>( includeBoundary ))>(
62 gv.grid().template interfaceBegin<codim>( includeBoundary ),
63 gv.grid().template interfaceEnd<codim>( includeBoundary )
70 template<
typename Gr
idView>
71 inline auto interfaceVertices(
const GridView& gv,
bool includeBoundary =
false)
72#ifndef DOXYGEN_SHOULD_SKIP_THIS
73 -> IteratorRange<
decltype(gv.grid().interfaceVerticesBegin( includeBoundary ))>
76 return IteratorRange<
decltype(gv.grid().interfaceVerticesBegin( includeBoundary ))>(
77 gv.grid().interfaceVerticesBegin( includeBoundary ),
78 gv.grid().interfaceVerticesEnd( includeBoundary )
85 template<
typename Vertex>
86 inline auto incidentInterfaceVertices(
const Vertex& vertex)
87#ifndef DOXYGEN_SHOULD_SKIP_THIS
88 -> IteratorRange<
decltype(vertex.impl().incidentInterfaceVerticesBegin())>
91 static_assert(Vertex::mydimension == 0,
"Incident interface vertices range iterator is only available for interface vertices!");
92 return IteratorRange<
decltype(vertex.impl().incidentInterfaceVerticesBegin())>(
93 vertex.impl().incidentInterfaceVerticesBegin(),
94 vertex.impl().incidentInterfaceVerticesEnd()
101 template<
typename Entity>
102 inline auto incidentInterfaceElements(
const Entity& entity)
103#ifndef DOXYGEN_SHOULD_SKIP_THIS
104 -> IteratorRange<
decltype(entity.impl().incidentInterfaceElementsBegin())>
107 static_assert(Entity::mydimension <= 1,
"Incident interface vertices range iterator is only available for interface vertices and edges!");
108 return IteratorRange<
decltype(entity.impl().incidentInterfaceElementsBegin())>(
109 entity.impl().incidentInterfaceElementsBegin(),
110 entity.impl().incidentInterfaceElementsEnd()