3 #ifndef DUNE_GEOMETRY_TYPEINDEX_HH
4 #define DUNE_GEOMETRY_TYPEINDEX_HH
27 inline static std::size_t regular_size(std::size_t dim)
47 return (1 << dim) - ((1 << dim) >> 1);
56 inline static std::size_t
size(std::size_t dim)
59 return regular_size(dim) + 1;
72 return regular_size(gt.
dim());
82 if(index == regular_size(dim)) {
105 inline static std::size_t regular_base(std::size_t dim)
112 return (1 << dim) >> 1;
119 inline static std::size_t base(std::size_t dim)
122 return regular_base(dim) + dim;
132 inline static std::size_t
size(std::size_t maxdim)
134 return base(maxdim+1);
152 #endif // DUNE_GEOMETRY_TYPEINDEX_HH
bool isNone() const
Return true if entity is a singular of any dimension.
Definition: type.hh:317
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 over all dimensions.
Definition: typeindex.hh:145
unsigned int id() const
Return the topology id the type.
Definition: type.hh:327
Compute per-dimension indices for geometry types.
Definition: typeindex.hh:19
unsigned int dim() const
Return dimension of the type.
Definition: type.hh:322
static std::size_t size(std::size_t maxdim)
Compute total number of geometry types up to and including the given dimension.
Definition: typeindex.hh:132
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:81
static std::size_t size(std::size_t dim)
Compute total number of geometry types for the given dimension.
Definition: typeindex.hh:56
void makeNone(unsigned int dim)
Make a singular of given dimension.
Definition: type.hh:208
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:24
Compute indices for geometry types, taking the dimension into account.
Definition: typeindex.hh:96
static std::size_t index(const GeometryType >)
Compute the index for the given geometry type within its dimension.
Definition: typeindex.hh:68