Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
DLR-AMR
GitHub Repository: DLR-AMR/t8code
Path: blob/main/src/t8_element_shape.h
898 views
1
/*
2
This file is part of t8code.
3
t8code is a C library to manage a collection (a forest) of multiple
4
connected adaptive space-trees of general element classes in parallel.
5
6
Copyright (C) 2015 the developers
7
8
t8code is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 2 of the License, or
11
(at your option) any later version.
12
13
t8code is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
17
18
You should have received a copy of the GNU General Public License
19
along with t8code; if not, write to the Free Software Foundation, Inc.,
20
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
*/
22
23
/** \file t8_element_shape.h
24
* TODO: comment
25
*/
26
27
#ifndef T8_ELEMENT_SHAPE_H
28
#define T8_ELEMENT_SHAPE_H
29
30
#include <t8.h>
31
#include <t8_eclass.h>
32
33
/** We want to export the whole implementation to be callable from "C". */
34
T8_EXTERN_C_BEGIN ();
35
36
/** Type definition for the geometric shape of an element.
37
* Currently the possible shapes are the same as the possible element classes.
38
* I.e. T8_ECLASS_VERTEX, T8_ECLASS_TET, etc... */
39
typedef t8_eclass_t t8_element_shape_t;
40
41
/** The MPI datatype used for t8_element_shape_t */
42
#define T8_MPI_ELEMENT_SHAPE_TYPE (T8_ASSERT (sizeof (int) == sizeof (t8_element_shape_t)), sc_MPI_INT)
43
44
/** The maximum number of boundary faces an element class can have. */
45
#define T8_ELEMENT_SHAPE_MAX_FACES 6
46
/** The maximum number of corners a 3-dimensional element class can have. */
47
#define T8_ELEMENT_SHAPE_MAX_CORNERS 8
48
49
/** Maximum possible number of corner nodes of an element in a specific dimension */
50
extern const int t8_element_shape_max_num_corner[T8_ECLASS_MAX_DIM + 1];
51
52
/** The number of codimension-one boundaries of an element class. */
53
int
54
t8_element_shape_num_faces (int element_shape);
55
56
/** For each dimension the maximum possible number of faces of an element_shape of that dimension. */
57
int
58
t8_element_shape_max_num_faces (int element_shape);
59
60
/** The number of vertices of an element class. */
61
int
62
t8_element_shape_num_vertices (int element_shape);
63
64
/** The vtk cell type for the element_shape */
65
int
66
t8_element_shape_vtk_type (int element_shape);
67
68
/** Maps the t8code corner number of the element to the vtk corner number
69
* \param [in] element_shape The shape of the element.
70
* \param [in] index The index of the corner in z-order (t8code numeration).
71
* \return The corresponding vtk index.
72
*/
73
int
74
t8_element_shape_t8_to_vtk_corner_number (int element_shape, int index);
75
76
/** Maps the vtk corner number of the element to the t8code corner number
77
* \param [in] element_shape The shape of the element.
78
* \param [in] index The index of the corner in vtk ordering.
79
* \return The corresponding t8code index.
80
*/
81
int
82
t8_element_shape_t8_corner_number (int element_shape, int index);
83
84
/** For each element_shape, the name of this class as a string */
85
const char*
86
t8_element_shape_to_string (int element_shape);
87
88
/** Compare two element_shapes of the same dimension
89
* as necessary for face neighbor orientation.
90
* The implemented order is Triangle < Square in 2D and
91
* Tet < Hex < Prism < Pyramid in 3D.
92
* \param [in] element_shape1 The first element_shape to compare.
93
* \param [in] element_shape2 The second element_shape to compare.
94
* \return 0 if the element_shapes are equal, 1 if element_shape1 > element_shape2
95
* and -1 if element_shape1 < element_shape2
96
*/
97
int
98
t8_element_shape_compare (t8_element_shape_t element_shape1, t8_element_shape_t element_shape2);
99
100
/** End of code that is callable from "C".*/
101
T8_EXTERN_C_END ();
102
103
#endif /* !T8_ELEMENT_SHAPE_H */
104
105