Go to the documentation of this file.
3 #ifndef DUNE_GEOMETRY_TYPEINDEX_HH
4 #define DUNE_GEOMETRY_TYPEINDEX_HH
27 inline static constexpr std::size_t regular_size(std::size_t dim)
47 return (1 << dim) - ((1 << dim) >> 1);
56 inline static constexpr std::size_t
size(std::size_t dim)
59 return regular_size(dim) + 1;
70 return gt.
isNone() ? regular_size(gt.
dim()) : (gt.
id() >> 1);
75 return (
index == regular_size(dim)) ?
93 inline static constexpr std::size_t regular_offset(std::size_t dim)
100 return (1 << dim) >> 1;
108 inline static constexpr std::size_t
offset(std::size_t dim)
111 return regular_offset(dim) + dim;
120 inline static constexpr std::size_t
size(std::size_t maxdim)
140 #endif // DUNE_GEOMETRY_TYPEINDEX_HH
constexpr GeometryType none(unsigned int dim)
Returns a GeometryType representing a singular of dimension dim.
Definition: type.hh:784
constexpr unsigned int dim() const
Return dimension of the type.
Definition: type.hh:644
static constexpr std::size_t index(const GeometryType >)
Compute the index for the given geometry type within its dimension.
Definition: typeindex.hh:68
A unique label for each type of element that can occur in a grid.
static constexpr GeometryType type(std::size_t dim, std::size_t index)
compute the geometry type for the given local index and dimension
Definition: typeindex.hh:74
static constexpr std::size_t index(const GeometryType >)
Compute the index for the given geometry type over all dimensions.
Definition: typeindex.hh:133
Compute indices for geometry types, taking the dimension into account.
Definition: typeindex.hh:84
static constexpr std::size_t size(std::size_t maxdim)
Compute total number of geometry types up to and including the given dimension.
Definition: typeindex.hh:120
constexpr bool isNone() const
Return true if entity is a singular of any dimension.
Definition: type.hh:639
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:278
static constexpr std::size_t offset(std::size_t dim)
Compute the starting index for a given dimension including irregular geometry types.
Definition: typeindex.hh:108
Compute per-dimension indices for geometry types.
Definition: typeindex.hh:19
static constexpr std::size_t size(std::size_t dim)
Compute total number of geometry types for the given dimension.
Definition: typeindex.hh:56
Definition: affinegeometry.hh:18
constexpr unsigned int id() const
Return the topology id of the type.
Definition: type.hh:649