dune-geometry  2.4
Public Types | Public Member Functions | List of all members
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...
 
enum  Binary { b0001 = 1, b0011 = 3, b0101 = 5, b0111 = 7 }
 A few binary constants. More...
 

Public Member Functions

 GeometryType ()
 Default constructor, not initializing anything. More...
 
 GeometryType (BasicType basicType, unsigned int dim)
 Constructor, using the basic type and the dimension. More...
 
 GeometryType (unsigned int topologyId, unsigned int dim)
 Constructor, using the topologyId (integer) and the dimension. More...
 
template<class TopologyType >
 GeometryType (TopologyType t)
 Constructor from static TopologyType class. More...
 
 GeometryType (unsigned int dim)
 Constructor for vertices and segments. More...
 
 GeometryType (int dim)
 Constructor for vertices and segments. More...
 
bool operator== (const GeometryType &other) const
 Check for equality. This method knows that in dimension 0 and 1 all BasicTypes are equal. More...
 
bool operator!= (const GeometryType &other) const
 Check for inequality. More...
 
bool operator< (const GeometryType &other) const
 less-than operation for use with maps More...
 
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
bool isVertex () const
 Return true if entity is a vertex. More...
 
bool isLine () const
 Return true if entity is a line segment. More...
 
bool isTriangle () const
 Return true if entity is a triangle. More...
 
bool isQuadrilateral () const
 Return true if entity is a quadrilateral. More...
 
bool isTetrahedron () const
 Return true if entity is a tetrahedron. More...
 
bool isPyramid () const
 Return true if entity is a pyramid. More...
 
bool isPrism () const
 Return true if entity is a prism. More...
 
bool isHexahedron () const
 Return true if entity is a hexahedron. More...
 
bool isSimplex () const
 Return true if entity is a simplex of any dimension. More...
 
bool isCube () const
 Return true if entity is a cube of any dimension. More...
 
bool isNone () const
 Return true if entity is a singular of any dimension. More...
 
unsigned int dim () const
 Return dimension of the type. More...
 
unsigned int id () const
 Return the topology id the type. More...
 

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.

Constructor & Destructor Documentation

Dune::GeometryType::GeometryType ( )
inline

Default constructor, not initializing anything.

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

Constructor, using the basic type and the dimension.

References cube, makeCube(), makePrism(), makePyramid(), makeSimplex(), none, prism, pyramid, and simplex.

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.
template<class TopologyType >
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 topologytypes.hh.
Parameters
tAny object of type TopologyType. The object t itself is ignored.
Dune::GeometryType::GeometryType ( unsigned int  dim)
inlineexplicit

Constructor for vertices and segments.

Dune::GeometryType::GeometryType ( int  dim)
inlineexplicit

Constructor for vertices and segments.

Member Function Documentation

unsigned int Dune::GeometryType::dim ( ) const
inline
unsigned int Dune::GeometryType::id ( ) const
inline
bool Dune::GeometryType::isCube ( ) const
inline

Return true if entity is a cube of any dimension.

Referenced by Dune::operator<<().

bool Dune::GeometryType::isHexahedron ( ) const
inline

Return true if entity is a hexahedron.

References b0111.

bool Dune::GeometryType::isLine ( ) const
inline

Return true if entity is a line segment.

bool Dune::GeometryType::isNone ( ) const
inline

Return true if entity is a singular of any dimension.

Referenced by Dune::LocalGeometryTypeIndex::index(), and Dune::operator<<().

bool Dune::GeometryType::isPrism ( ) const
inline

Return true if entity is a prism.

References b0101.

Referenced by Dune::operator<<().

bool Dune::GeometryType::isPyramid ( ) const
inline

Return true if entity is a pyramid.

References b0011.

Referenced by Dune::operator<<().

bool Dune::GeometryType::isQuadrilateral ( ) const
inline

Return true if entity is a quadrilateral.

References b0011.

bool Dune::GeometryType::isSimplex ( ) const
inline

Return true if entity is a simplex of any dimension.

Referenced by Dune::operator<<().

bool Dune::GeometryType::isTetrahedron ( ) const
inline

Return true if entity is a tetrahedron.

References b0001.

bool Dune::GeometryType::isTriangle ( ) const
inline

Return true if entity is a triangle.

References b0001.

bool Dune::GeometryType::isVertex ( ) const
inline

Return true if entity is a vertex.

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

Make a hypercube of given dimension.

References dim().

Referenced by GeometryType(), makeFromVertices(), makeHexahedron(), and makeQuadrilateral().

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.

References makeCube(), makeLine(), makePrism(), makePyramid(), makeSimplex(), and makeVertex().

void Dune::GeometryType::makeHexahedron ( )
inline

Make a hexahedron.

References makeCube().

void Dune::GeometryType::makeLine ( )
inline

Make a line segment.

Referenced by makeFromVertices().

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

Make a singular of given dimension.

References dim().

Referenced by Dune::LocalGeometryTypeIndex::type().

void Dune::GeometryType::makePrism ( )
inline

Make a prism.

References b0101.

Referenced by GeometryType(), and makeFromVertices().

void Dune::GeometryType::makePyramid ( )
inline

Make a pyramid.

References b0011.

Referenced by GeometryType(), and makeFromVertices().

void Dune::GeometryType::makeQuadrilateral ( )
inline

Make a quadrilateral.

References makeCube().

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

Make a simplex of given dimension.

References dim().

Referenced by GeometryType(), makeFromVertices(), makeTetrahedron(), and makeTriangle().

void Dune::GeometryType::makeTetrahedron ( )
inline

Make a tetrahedron.

References makeSimplex().

void Dune::GeometryType::makeTriangle ( )
inline

Make a triangle.

References makeSimplex().

void Dune::GeometryType::makeVertex ( )
inline

Make a vertex.

Referenced by makeFromVertices().

bool Dune::GeometryType::operator!= ( const GeometryType other) const
inline

Check for inequality.

bool Dune::GeometryType::operator< ( const GeometryType other) const
inline

less-than operation for use with maps

bool Dune::GeometryType::operator== ( const GeometryType other) const
inline

Check for equality. This method knows that in dimension 0 and 1 all BasicTypes are equal.


The documentation for this class was generated from the following file: