H2Lib  3.0
tet3d.h
Go to the documentation of this file.
1 
2 /* ------------------------------------------------------------
3  * This is the file "tet3d.h" of the H2Lib package.
4  * All rights reserved, Steffen Boerm 2015
5  * ------------------------------------------------------------ */
6 
10 #ifndef TET3D_H
11 #define TET3D_H
12 
18 typedef struct _tet3d tet3d;
19 
21 typedef tet3d *ptet3d;
22 
24 typedef const tet3d *pctet3d;
25 
27 typedef struct _tet3dref tet3dref;
28 
31 
33 typedef const tet3dref *pctet3dref;
34 
36 typedef struct _tet3dbuilder tet3dbuilder;
37 
40 
41 #include "settings.h"
42 
43 /* ------------------------------------------------------------
44  Tetrahedral mesh,
45  described by vertices, edges, faces and tetrahedra
46  ------------------------------------------------------------ */
47 
56 struct _tet3d {
59 
62 
65 
68 
70  real (*x)[3];
71 
73  uint (*e)[2];
74 
81  uint (*f)[3];
82 
84  uint (*t)[4];
85 
87  uint *xb;
88 
90  uint *eb;
91 
93  uint *fb;
94 };
95 
96 /* ------------------------------------------------------------
97  Constructors and destructors
98  ------------------------------------------------------------ */
99 
112 
116 HEADER_PREFIX void
117 del_tet3d(ptet3d gr);
118 
125 
131 
138 
139 /* ------------------------------------------------------------
140  File I/O
141  ------------------------------------------------------------ */
142 
147 HEADER_PREFIX void
148 write_tet3d(pctet3d gr, const char *name);
149 
155 read_tet3d(const char *name);
156 
157 /* ------------------------------------------------------------
158  Get geometrical information
159  ------------------------------------------------------------ */
160 
180 HEADER_PREFIX void
182  uint v[]);
183 
195 HEADER_PREFIX void
196 getvertices_tet3d(pctet3d gr, uint tn, uint v[]);
197 
214 HEADER_PREFIX void
215 getedges_tet3d(pctet3d gr, uint tn, uint e[]);
216 
226 HEADER_PREFIX void
228 
229 /* ------------------------------------------------------------
230  Check structure for inconsistencies
231  ------------------------------------------------------------ */
232 
240 
244 HEADER_PREFIX void
245 check_tet3d(pctet3d gr);
246 
256 HEADER_PREFIX void
258  preal hmin, preal hmax,
259  preal volmin, preal volmax,
260  preal relvolmin, preal relvolmax);
261 
262 /* ------------------------------------------------------------
263  * Regular refinement by Bey's algorithm
264  * ------------------------------------------------------------ */
265 
274 struct _tet3dref {
279 
284 
289 
292 };
293 
303 refine_tet3d(pctet3d gr, ptet3dref *grr);
304 
308 HEADER_PREFIX void
310 
311 /* ------------------------------------------------------------
312  * Tool for constructing meshes
313  * ------------------------------------------------------------ */
314 
321 
325 HEADER_PREFIX void
327 
338 
346 HEADER_PREFIX void
348  uint v0, uint v1, uint v2, uint v3);
349 
360 
363 #endif
ptaskgroup nf
Global variable for general nearfield tasks.
ptet3d new_axis_tet3d()
Create a mesh for a tetrahedron with three edges aligned with the coordinate axes.
Representation of the refinement relationship between two meshes.
Definition: tet3d.h:274
uint(* t)[4]
Faces of a tetrahedron.
Definition: tet3d.h:84
void statistics_tet3d(pctet3d gr, preal hmin, preal hmax, preal volmin, preal volmax, preal relvolmin, preal relvolmax)
Compute various statistices of a mesh.
tet3dref * ptet3dref
Pointer to tet3dref object.
Definition: tet3d.h:30
struct _tet3dbuilder tet3dbuilder
Tool for constructing tet3d meshes.
Definition: tet3d.h:36
uint * ft
Father type for a face: 2 means face, 3 means tetrahedron.
Definition: tet3d.h:288
uint(* e)[2]
Start and end points of edges.
Definition: tet3d.h:73
uint faces
Number of faces.
Definition: tet3d.h:64
void write_tet3d(pctet3d gr, const char *name)
Write a tetrahedral mesh to a file.
ptet3d buildmesh_tet3dbuilder(ptet3dbuilder tb)
Create a tet3d mesh from the geometrical and topological information stored in a tet3dbuilder object...
uint * xt
Father type for a vertex: 0 means vertex, 1 means edges.
Definition: tet3d.h:278
void del_tet3dbuilder(ptet3dbuilder tb)
Delete a tet3dbuilder object.
uint(* f)[3]
Edges on a triangular face.
Definition: tet3d.h:81
uint * et
Father type for an edge: 1 means edge, 2 means face, 3 means tetrahedron.
Definition: tet3d.h:283
void check_tet3d(pctet3d gr)
Perform various consistency checks.
void getedges_tet3d(pctet3d gr, uint tn, uint e[])
Find the edges of a tetrahedron.
unsigned uint
Unsigned integer type.
Definition: settings.h:70
real(* x)[3]
Coordinates of vertices.
Definition: tet3d.h:70
void getvertices_face_tet3d(pctet3d t3, uint nf, uint v[])
Find the vertices of a face.
void getvertices_tet3d(pctet3d gr, uint tn, uint v[])
Find the vertices of a tetrahedron.
ptet3d new_unitcube_tet3d()
Create a mesh containing six tetrahedra representing the unit cube .
real(* getx_tet3dbuilder(ptet3dbuilder tb))[3]
Obtain array of vertex coordinates in tet3dbuilder object.
uint * ef
Father index of an edge.
Definition: tet3d.h:281
Representation of a three-dimensional tetrahedral mesh.
Definition: tet3d.h:56
uint vertices
Number of vertices.
Definition: tet3d.h:58
void getvertices_byface_tet3d(pctet3d gr, uint tn, uint fl, uint v[])
Find the vertices of a tetrahedron corresponding to a given face.
ptet3d read_tet3d(const char *name)
Read a tetrahedral mesh from a file.
tet3d * ptet3d
Pointer to tet3d object.
Definition: tet3d.h:21
uint edges
Number of edges.
Definition: tet3d.h:61
uint * tf
Father index of a tetrahedron.
Definition: tet3d.h:291
uint * eb
Boundary flags for edges.
Definition: tet3d.h:90
void del_tet3d(ptet3d gr)
Delete a tet3d object.
uint * xb
Boundary flags for vertices.
Definition: tet3d.h:87
ptet3d new_regular_tet3d()
Create a mesh for a regular tetrahedron.
const tet3dref * pctet3dref
Pointer to constant tet3dref object.
Definition: tet3d.h:33
void addtetrahedron_tet3dbuilder(ptet3dbuilder tb, uint v0, uint v1, uint v2, uint v3)
Add a tetrahedron to a tet3dbuilder object.
#define HEADER_PREFIX
Prefix for function declarations.
Definition: settings.h:43
uint * ff
Father index of a face.
Definition: tet3d.h:286
double real
real floating point type.
Definition: settings.h:97
uint fixnormals_tet3d(ptet3d gr)
Ensure that the edges of boundary faces are in counter-clockwise order as seen from outside of the me...
uint tetrahedra
Number of tetrahedra.
Definition: tet3d.h:67
uint * xf
Father index of a vertex.
Definition: tet3d.h:276
real * preal
Pointer to real array.
Definition: settings.h:145
ptet3d refine_tet3d(pctet3d gr, ptet3dref *grr)
Regular refinement of a tetrahedral mesh.
ptet3dbuilder new_tet3dbuilder(uint vertices)
Create a new tet3dbuilder object.
void del_tet3dref(ptet3dref grr)
Delete a tet3dref object.
ptet3d new_tet3d(uint vertices, uint edges, uint faces, uint tetrahedra)
Create a partially initialized tet3d mesh.
uint * fb
Boundary flags for faces.
Definition: tet3d.h:93
tet3dbuilder * ptet3dbuilder
Pointer to tet3dbuilder object.
Definition: tet3d.h:39
const tet3d * pctet3d
Pointer to constant tet3d object.
Definition: tet3d.h:24