Dune Core Modules (2.6.0)

Dune::GeometryType Class Reference

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...
 

Public Member Functions

Constructors
constexpr GeometryType ()
 Default constructor, not initializing anything.
 
 GeometryType (BasicType basicType, unsigned int dim)
 Constructor, using the basic type and the dimension. More...
 
constexpr GeometryType (unsigned int topologyId, unsigned int dim, bool none)
 Constructor, using the topologyId (integer), the dimension and a flag for type none. More...
 
constexpr 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. More...
 
void makeLine ()
 Make a line segment. More...
 
void makeTriangle ()
 Make a triangle. More...
 
void makeQuadrilateral ()
 Make a quadrilateral. More...
 
void makeTetrahedron ()
 Make a tetrahedron. More...
 
void makePyramid ()
 Make a pyramid. More...
 
void makePrism ()
 Make a prism. More...
 
void makeHexahedron ()
 Make a hexahedron. More...
 
void makeSimplex (unsigned int dim)
 Make a simplex of given dimension. More...
 
void makeCube (unsigned int dim)
 Make a hypercube of given dimension. More...
 
void makeNone (unsigned int dim)
 Make a singular of given dimension. More...
 
void makeFromVertices (unsigned int dim, unsigned int vertices)
 Construct the correct geometry type given the dimension and the number of vertices. More...
 
Query Methods
constexpr bool isVertex () const
 Return true if entity is a vertex.
 
constexpr bool isLine () const
 Return true if entity is a line segment.
 
constexpr bool isTriangle () const
 Return true if entity is a triangle.
 
constexpr bool isQuadrilateral () const
 Return true if entity is a quadrilateral.
 
constexpr bool isTetrahedron () const
 Return true if entity is a tetrahedron.
 
constexpr bool isPyramid () const
 Return true if entity is a pyramid.
 
constexpr bool isPrism () const
 Return true if entity is a prism.
 
constexpr bool isHexahedron () const
 Return true if entity is a hexahedron.
 
constexpr bool isSimplex () const
 Return true if entity is a simplex of any dimension.
 
constexpr bool isCube () const
 Return true if entity is a cube of any dimension.
 
constexpr bool isNone () const
 Return true if entity is a singular of any dimension.
 
constexpr unsigned int dim () const
 Return dimension of the type.
 
constexpr unsigned int id () const
 Return the topology id of the type.
 
Comparison operators
constexpr bool operator== (const GeometryType &other) const
 Check for equality. This method knows that in dimension 0 and 1 all BasicTypes are equal.
 
constexpr bool operator!= (const GeometryType &other) const
 Check for inequality.
 
constexpr 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.

GeometryType is a C++ "literal type" and can be used in constexpr context if created with a constexpr constructor.

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 topology, representable as topologyId.

none 

Even more general topology, cannot be specified by a topologyId. Two GeometryTypes with 'none' type are equal if and only if they have the same dimension.

Constructor & Destructor Documentation

◆ GeometryType() [1/4]

Dune::GeometryType::GeometryType ( BasicType  basicType,
unsigned int  dim 
)
inline

Constructor, using the basic type and the dimension.

Deprecated:
"The GeometryType constructor taking BasicType is deprecated and will be removed after DUNE 2.6"

◆ GeometryType() [2/4]

constexpr Dune::GeometryType::GeometryType ( unsigned int  topologyId,
unsigned int  dim,
bool  none 
)
inlineconstexpr

Constructor, using the topologyId (integer), the dimension and a flag for type none.

Note
With this constructor, you can easily create an invalid GeometryType, it is mostly here for internal use! the TypologyType, users are encouraged to use the GeometryType(TopologyType t) constructor.

◆ GeometryType() [3/4]

constexpr Dune::GeometryType::GeometryType ( unsigned int  topologyId,
unsigned int  dim 
)
inlineconstexpr

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() [4/4]

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

◆ makeCube()

void Dune::GeometryType::makeCube ( unsigned int  dim)
inline

Make a hypercube of given dimension.

Deprecated:
"makeCube(dim) is deprecated in DUNE 2.6, please use Dune::GeometryTypes::cube(dim) instead"

◆ 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.
Deprecated:
"Use the utility function geometryTypeFromVertexCount(...) instead."

◆ makeHexahedron()

void Dune::GeometryType::makeHexahedron ( )
inline

Make a hexahedron.

Deprecated:
"makeHexahedron() is deprecated in DUNE 2.6, please use Dune::GeometryTypes::hexahedron instead"

◆ makeLine()

void Dune::GeometryType::makeLine ( )
inline

Make a line segment.

Deprecated:
"makeLine() is deprecated in DUNE 2.6, please use Dune::GeometryTypes::line instead"

◆ makeNone()

void Dune::GeometryType::makeNone ( unsigned int  dim)
inline

Make a singular of given dimension.

Deprecated:
"makeNone(dim) is deprecated in DUNE 2.6, please use Dune::GeometryTypes::none(dim) instead"

◆ makePrism()

void Dune::GeometryType::makePrism ( )
inline

Make a prism.

Deprecated:
"makePrism() is deprecated in DUNE 2.6, please use Dune::GeometryTypes::prism instead"

◆ makePyramid()

void Dune::GeometryType::makePyramid ( )
inline

Make a pyramid.

Deprecated:
"makePyramid() is deprecated in DUNE 2.6, please use Dune::GeometryTypes::pyramid instead"

◆ makeQuadrilateral()

void Dune::GeometryType::makeQuadrilateral ( )
inline

Make a quadrilateral.

Deprecated:
"makeQuadrilateral() is deprecated in DUNE 2.6, please use Dune::GeometryTypes::quadrilateral instead"

◆ makeSimplex()

void Dune::GeometryType::makeSimplex ( unsigned int  dim)
inline

Make a simplex of given dimension.

Deprecated:
"makeSimplex(dim) is deprecated in DUNE 2.6, please use Dune::GeometryTypes::simplex(dim) instead"

◆ makeTetrahedron()

void Dune::GeometryType::makeTetrahedron ( )
inline

Make a tetrahedron.

Deprecated:
"makeTetrahedron() is deprecated in DUNE 2.6, please use Dune::GeometryTypes::tetrahedron instead"

◆ makeTriangle()

void Dune::GeometryType::makeTriangle ( )
inline

Make a triangle.

Deprecated:
"makeTriangle() is deprecated in DUNE 2.6, please use Dune::GeometryTypes::triangle instead"

◆ makeVertex()

void Dune::GeometryType::makeVertex ( )
inline

Make a vertex.

Deprecated:
"makeVertex() is deprecated in DUNE 2.6, please use Dune::GeometryTypes::vertex instead"

The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  generated with Hugo v0.80.0 (Dec 6, 23:32, 2022)