3 #ifndef DUNE_GEOMETRY_TYPEINDEX_HH
4 #define DUNE_GEOMETRY_TYPEINDEX_HH
14 #include <dune/common/std/constexpr.hh>
29 DUNE_CONSTEXPR
inline static std::size_t regular_size(std::size_t dim)
49 return (1 << dim) - ((1 << dim) >> 1);
58 DUNE_CONSTEXPR
inline static std::size_t
size(std::size_t dim)
61 return regular_size(dim) + 1;
74 return regular_size(gt.
dim());
84 if(index == regular_size(dim)) {
107 DUNE_CONSTEXPR
inline static std::size_t regular_base(std::size_t dim)
114 return (1 << dim) >> 1;
121 DUNE_CONSTEXPR
inline static std::size_t base(std::size_t dim)
124 return regular_base(dim) + dim;
134 DUNE_CONSTEXPR
inline static std::size_t
size(std::size_t maxdim)
136 return base(maxdim+1);
154 #endif // DUNE_GEOMETRY_TYPEINDEX_HH
void makeNone(unsigned int dim)
Make a singular of given dimension.
Definition: type.hh:207
unsigned int id() const
Return the topology id the type.
Definition: type.hh:326
Definition: affinegeometry.hh:18
static DUNE_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:134
static GeometryType type(std::size_t dim, std::size_t index)
compute the geometry type for the given local index and dimension
Definition: typeindex.hh:83
bool isNone() const
Return true if entity is a singular of any dimension.
Definition: type.hh:316
static std::size_t index(const GeometryType >)
Compute the index for the given geometry type over all dimensions.
Definition: typeindex.hh:147
Compute indices for geometry types, taking the dimension into account.
Definition: typeindex.hh:98
A unique label for each type of element that can occur in a grid.
static std::size_t index(const GeometryType >)
Compute the index for the given geometry type within its dimension.
Definition: typeindex.hh:70
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:24
unsigned int dim() const
Return dimension of the type.
Definition: type.hh:321
Compute per-dimension indices for geometry types.
Definition: typeindex.hh:21
static DUNE_CONSTEXPR std::size_t size(std::size_t dim)
Compute total number of geometry types for the given dimension.
Definition: typeindex.hh:58