Dune Core Modules (2.5.2)

Unique label for each type of entities that can occur in DUNE grids. More...

#include <dune/geometry/type.hh>

Public Types

enum  BasicType {
  simplex , cube , pyramid , prism ,
  extended , none
}
 Each entity can be tagged by one of these basic types plus its space dimension. More...
 
enum  Binary
 A few binary constants.
 

Public Member Functions

 GeometryType ()
 Default constructor, not initializing anything.
 
 GeometryType (BasicType basicType, unsigned int dim)
 Constructor, using the basic type and the dimension.
 
 GeometryType (unsigned int topologyId, unsigned int dim)
 Constructor, using the topologyId (integer) and the dimension. More...
 
template<class TopologyType , class = Dune::void_t<decltype(TopologyType::dimension), decltype(TopologyType::id)>>
 GeometryType (TopologyType t)
 Constructor from static TopologyType class. More...
 
 GeometryType (unsigned int dim)
 Constructor for vertices and segments.
 
 GeometryType (int dim)
 Constructor for vertices and segments.
 
Setup Methods
void makeVertex ()
 Make a vertex.
 
void makeLine ()
 Make a line segment.
 
void makeTriangle ()
 Make a triangle.
 
void makeQuadrilateral ()
 Make a quadrilateral.
 
void makeTetrahedron ()
 Make a tetrahedron.
 
void makePyramid ()
 Make a pyramid.
 
void makePrism ()
 Make a prism.
 
void makeHexahedron ()
 Make a hexahedron.
 
void makeSimplex (unsigned int dim)
 Make a simplex of given dimension.
 
void makeCube (unsigned int dim)
 Make a hypercube of given dimension.
 
void makeNone (unsigned int dim)
 Make a singular of given dimension.
 
void makeFromVertices (unsigned int dim, unsigned int vertices)
 Construct the correct geometry type given the dimension and the number of vertices. More...
 
Query Methods
bool isVertex () const
 Return true if entity is a vertex.
 
bool isLine () const
 Return true if entity is a line segment.
 
bool isTriangle () const
 Return true if entity is a triangle.
 
bool isQuadrilateral () const
 Return true if entity is a quadrilateral.
 
bool isTetrahedron () const
 Return true if entity is a tetrahedron.
 
bool isPyramid () const
 Return true if entity is a pyramid.
 
bool isPrism () const
 Return true if entity is a prism.
 
bool isHexahedron () const
 Return true if entity is a hexahedron.
 
bool isSimplex () const
 Return true if entity is a simplex of any dimension.
 
bool isCube () const
 Return true if entity is a cube of any dimension.
 
bool isNone () const
 Return true if entity is a singular of any dimension.
 
unsigned int dim () const
 Return dimension of the type.
 
unsigned int id () const
 Return the topology id the type.
 
bool operator== (const GeometryType &other) const
 Check for equality. This method knows that in dimension 0 and 1 all BasicTypes are equal.
 
bool operator!= (const GeometryType &other) const
 Check for inequality.
 
bool operator< (const GeometryType &other) const
 less-than operation for use with maps
 

Detailed Description

Unique label for each type of entities that can occur in DUNE grids.

This class has to be extended if a grid implementation with new entity types is added to DUNE.

Member Enumeration Documentation

◆ BasicType

Each entity can be tagged by one of these basic types plus its space dimension.

Enumerator
simplex 

Simplicial element in any nonnegative dimension.

cube 

Cube element in any nonnegative dimension.

pyramid 

Four sided pyramid in three dimensions.

prism 

Prism element in three dimensions.

extended 

Other, more general geometry, representable as topologyId.

none 

Generic element in any nonnegative dimension.

Constructor & Destructor Documentation

◆ GeometryType() [1/2]

Dune::GeometryType::GeometryType ( unsigned int  topologyId,
unsigned int  dim 
)
inline

Constructor, using the topologyId (integer) and the dimension.

Note
the topologyId is a binary encoded representation of the TypologyType, users are encouraged to use the GeometryType(TopologyType t) constructor.

◆ GeometryType() [2/2]

template<class TopologyType , class = Dune::void_t<decltype(TopologyType::dimension), decltype(TopologyType::id)>>
Dune::GeometryType::GeometryType ( TopologyType  t)
inlineexplicit

Constructor from static TopologyType class.

Constructs the GeometryType object from a static topology representation.

Template Parameters
TopologyTypeA class providing public static unsigned int members TopologyType::dimension and TopologyType::id. You can e.g. use the Point, Prism and Pyramid structs from the Impl namespace.
Parameters
tAny object of type TopologyType. The object t itself is ignored.

Member Function Documentation

◆ makeFromVertices()

void Dune::GeometryType::makeFromVertices ( unsigned int  dim,
unsigned int  vertices 
)
inline

Construct the correct geometry type given the dimension and the number of vertices.

Note
This code only works up to dimension 3. In higher dimensions the number of vertices does not uniquely identify the type of polyhedron.

The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 26, 22:29, 2024)