t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
Macros | Typedefs | Enumerations | Functions | Variables
t8_eclass.h File Reference

We define all possible element classes that occur in hybrid meshes. More...

#include <t8.h>

Go to the source code of this file.

Macros

#define T8_MPI_ECLASS_TYPE
 The MPI datatype used for t8_eclass_t. More...
 
#define T8_ECLASS_MAX_FACES   6
 The maximum number of boundary faces an element class can have.
 
#define T8_ECLASS_MAX_EDGES   12
 The maximum number of boundary edges an element class can have.
 
#define T8_ECLASS_MAX_EDGES_2D   4
 The maximum number of boundary edges a 2D element class can have.
 
#define T8_ECLASS_MAX_CORNERS_2D   4
 The maximum number of cornes a 2-dimensional element class can have.
 
#define T8_ECLASS_MAX_CORNERS   8
 The maximum number of cornes an element class can have.
 
#define T8_ECLASS_MAX_DIM   3
 The maximal possible dimension for an eclass.
 

Typedefs

typedef enum t8_eclass t8_eclass_t
 This enumeration contains all possible element classes.
 

Enumerations

enum  t8_eclass {
  T8_ECLASS_ZERO = 0 ,
  T8_ECLASS_VERTEX = T8_ECLASS_ZERO ,
  T8_ECLASS_LINE ,
  T8_ECLASS_QUAD ,
  T8_ECLASS_TRIANGLE ,
  T8_ECLASS_HEX ,
  T8_ECLASS_TET ,
  T8_ECLASS_PRISM ,
  T8_ECLASS_PYRAMID ,
  T8_ECLASS_COUNT ,
  T8_ECLASS_INVALID
}
 This enumeration contains all possible element classes. More...
 

Functions

int t8_eclass_count_boundary (t8_eclass_t theclass, int min_dim, int *per_eclass)
 Query the element class and count of boundary points. More...
 
int t8_eclass_compare (t8_eclass_t eclass1, t8_eclass_t eclass2)
 Compare two eclasses of the same dimension as necessary for face neighbor orientation. More...
 
int t8_eclass_is_valid (t8_eclass_t eclass)
 Check whether a class is a valid class. More...
 

Variables

const int t8_eclass_to_dimension [T8_ECLASS_COUNT]
 Map each of the element classes to its dimension.
 
const int t8_eclass_num_faces [T8_ECLASS_COUNT]
 The number of codimension-one boundaries of an element class.
 
const int t8_eclass_max_num_faces [T8_ECLASS_MAX_DIM+1]
 For each dimension the maximum possible number of faces of an eclass of that dimension.
 
const int t8_face_vertex_to_tree_vertex [T8_ECLASS_COUNT][T8_ECLASS_MAX_FACES][T8_ECLASS_MAX_CORNERS_2D]
 For each eclass and each face f the entry i gives the vertex number of f's i-th vertex within all vertices of the tree.
 
const int t8_face_edge_to_tree_edge_n [T8_ECLASS_COUNT][T8_ECLASS_MAX_FACES][T8_ECLASS_MAX_EDGES_2D]
 For each eclass and each face f the entry i gives the edge number of f's i-th edge within all edges of the tree.
 
const int t8_face_to_edge_neighbor [T8_ECLASS_COUNT][T8_ECLASS_MAX_FACES][T8_ECLASS_MAX_CORNERS_2D]
 For each eclass, each face f and the face vertex v, we get the edge number of the tree which is incident to vertex v but not part of f.
 
const int t8_edge_vertex_to_tree_vertex_n [T8_ECLASS_COUNT][T8_ECLASS_MAX_EDGES][2]
 For each eclass and each edge e the entry i gives the vertex number of e's i-th vertex within all vertices of the tree.
 
const int t8_edge_to_face_n [T8_ECLASS_COUNT][T8_ECLASS_MAX_EDGES][2]
 For each eclass and each edge e the entry i gives the face number of e's i-th incident face within all faces of the tree.
 
const int t8_eclass_face_orientation [T8_ECLASS_COUNT][T8_ECLASS_MAX_FACES]
 Each face is either 0 or 1 oriented, depending on the order of its vertices. More...
 
const int t8_eclass_num_vertices [T8_ECLASS_COUNT]
 The number of vertices of an element class.
 
const int t8_eclass_num_edges [T8_ECLASS_COUNT]
 The number of edges of an element class.
 
const int t8_eclass_vtk_type [T8_ECLASS_COUNT]
 The vtk cell type for the eclass.
 
const int t8_eclass_vtk_corner_number [T8_ECLASS_COUNT][T8_ECLASS_MAX_CORNERS]
 Map the t8code corner number to the vtk corner number.
 
const int t8_eclass_face_types [T8_ECLASS_COUNT][T8_ECLASS_MAX_FACES]
 For each of the element classes, list the type of the faces.
 
const int t8_eclass_boundary_count [T8_ECLASS_COUNT][T8_ECLASS_COUNT]
 For each of the element classes, count the boundary points.
 
const char * t8_eclass_to_string [T8_ECLASS_COUNT]
 For each eclass, the name of this class as a string.
 

Detailed Description

We define all possible element classes that occur in hybrid meshes.

Notable examples are triangles, tetrahedra, quadrilaterals and hexahedra. We cover all dimensions between zero and three, so it is in principal possible to build a topological complex out of these element classes.

Macro Definition Documentation

◆ T8_MPI_ECLASS_TYPE

#define T8_MPI_ECLASS_TYPE
Value:
(T8_ASSERT (sizeof (int) == sizeof (t8_eclass_t)),\
sc_MPI_INT)
#define T8_ASSERT(c)
Widely used assertion.
Definition: t8.h:75
enum t8_eclass t8_eclass_t
This enumeration contains all possible element classes.

The MPI datatype used for t8_eclass_t.

Enumeration Type Documentation

◆ t8_eclass

enum t8_eclass

This enumeration contains all possible element classes.

Enumerator
T8_ECLASS_VERTEX 

The vertex is the only zero-dimensional element class.

T8_ECLASS_LINE 

The line is the only one-dimensional element class.

T8_ECLASS_QUAD 

The quadrilateral is one of two element classes in two dimensions.

T8_ECLASS_TRIANGLE 

The element class for a triangle.

T8_ECLASS_HEX 

The hexahedron is one three-dimensional element class.

T8_ECLASS_TET 

The tetrahedron is another three-dimensional element class.

T8_ECLASS_PRISM 

The prism has five sides: two opposing triangles joined by three quadrilaterals.

T8_ECLASS_PYRAMID 

The pyramid has a quadrilateral as base and four triangles as sides.

T8_ECLASS_COUNT 

This is no element class but can be used as the number of element classes.

T8_ECLASS_INVALID 

This is no element class but can be used for the case a class of a third party library is not supported by t8code.

Function Documentation

◆ t8_eclass_compare()

int t8_eclass_compare ( t8_eclass_t  eclass1,
t8_eclass_t  eclass2 
)

Compare two eclasses of the same dimension as necessary for face neighbor orientation.

The implemented order is Triangle < Square in 2D and Tet < Hex < Prism < Pyramid in 3D.

Parameters
[in]eclass1The first eclass to compare.
[in]eclass2The second eclass to compare.
Returns
0 if the eclasses are equal, 1 if eclass1 > eclass2 and -1 if eclass1 < eclass2

◆ t8_eclass_count_boundary()

int t8_eclass_count_boundary ( t8_eclass_t  theclass,
int  min_dim,
int *  per_eclass 
)

Query the element class and count of boundary points.

Parameters
[in]theclassWe query a point of this element class.
[in]min_dimIgnore boundary points of lesser dimension. The ignored points get a count value of 0.
[out]per_eclassArray of length T8_ECLASS_COUNT to be filled with the count of the boundary objects, counted per each of the element classes.
Returns
The count over all boundary points.

◆ t8_eclass_is_valid()

int t8_eclass_is_valid ( t8_eclass_t  eclass)

Check whether a class is a valid class.

Returns non-zero if it is a valid class, returns zero, if the class is equal to T8_ECLASS_INVALID.

Parameters
[in]eclassThe eclass to check.
Returns
Non-zero if eclass is valid, zero otherwise.

Variable Documentation

◆ t8_eclass_face_orientation

const int t8_eclass_face_orientation[T8_ECLASS_COUNT][T8_ECLASS_MAX_FACES]
extern

Each face is either 0 or 1 oriented, depending on the order of its vertices.

We say a face is 0 oriented, if its normal vector points inwards, 1 oriented otherwise. The normal vector is computed as the cross product of v_1 - v_0 and v_2 - v_0. v_i being the i-th vertex. The faces of an eclass of dimension 2 or lower are all 0 oriented.