H2Lib
3.0
|
Three-dimensional tetrahedral meshes. More...
Data Structures | |
struct | _tet3d |
Representation of a three-dimensional tetrahedral mesh. More... | |
struct | _tet3dref |
Representation of the refinement relationship between two meshes. More... | |
Typedefs | |
typedef struct _tet3d | tet3d |
Three-dimensional tetrahedral mesh. | |
typedef tet3d * | ptet3d |
Pointer to tet3d object. | |
typedef const tet3d * | pctet3d |
Pointer to constant tet3d object. | |
typedef struct _tet3dref | tet3dref |
Refinement data for tetrahedral meshes. | |
typedef tet3dref * | ptet3dref |
Pointer to tet3dref object. | |
typedef const tet3dref * | pctet3dref |
Pointer to constant tet3dref object. | |
typedef struct _tet3dbuilder | tet3dbuilder |
Tool for constructing tet3d meshes. | |
typedef tet3dbuilder * | ptet3dbuilder |
Pointer to tet3dbuilder object. | |
Functions | |
ptet3d | new_tet3d (uint vertices, uint edges, uint faces, uint tetrahedra) |
Create a partially initialized tet3d mesh. More... | |
void | del_tet3d (ptet3d gr) |
Delete a tet3d object. More... | |
ptet3d | new_axis_tet3d () |
Create a mesh for a tetrahedron with three edges aligned with the coordinate axes. More... | |
ptet3d | new_regular_tet3d () |
Create a mesh for a regular tetrahedron. More... | |
ptet3d | new_unitcube_tet3d () |
Create a mesh containing six tetrahedra representing the unit cube . More... | |
void | write_tet3d (pctet3d gr, const char *name) |
Write a tetrahedral mesh to a file. More... | |
ptet3d | read_tet3d (const char *name) |
Read a tetrahedral mesh from a file. More... | |
void | getvertices_byface_tet3d (pctet3d gr, uint tn, uint fl, uint v[]) |
Find the vertices of a tetrahedron corresponding to a given face. More... | |
void | getvertices_tet3d (pctet3d gr, uint tn, uint v[]) |
Find the vertices of a tetrahedron. More... | |
void | getedges_tet3d (pctet3d gr, uint tn, uint e[]) |
Find the edges of a tetrahedron. More... | |
void | getvertices_face_tet3d (pctet3d t3, uint nf, uint v[]) |
Find the vertices of a face. More... | |
uint | fixnormals_tet3d (ptet3d gr) |
Ensure that the edges of boundary faces are in counter-clockwise order as seen from outside of the mesh. More... | |
void | check_tet3d (pctet3d gr) |
Perform various consistency checks. More... | |
void | statistics_tet3d (pctet3d gr, preal hmin, preal hmax, preal volmin, preal volmax, preal relvolmin, preal relvolmax) |
Compute various statistices of a mesh. More... | |
ptet3d | refine_tet3d (pctet3d gr, ptet3dref *grr) |
Regular refinement of a tetrahedral mesh. More... | |
void | del_tet3dref (ptet3dref grr) |
Delete a tet3dref object. More... | |
ptet3dbuilder | new_tet3dbuilder (uint vertices) |
Create a new tet3dbuilder object. More... | |
void | del_tet3dbuilder (ptet3dbuilder tb) |
Delete a tet3dbuilder object. More... | |
real(* | getx_tet3dbuilder (ptet3dbuilder tb))[3] |
Obtain array of vertex coordinates in tet3dbuilder object. More... | |
void | addtetrahedron_tet3dbuilder (ptet3dbuilder tb, uint v0, uint v1, uint v2, uint v3) |
Add a tetrahedron to a tet3dbuilder object. More... | |
ptet3d | buildmesh_tet3dbuilder (ptet3dbuilder tb) |
Create a tet3d mesh from the geometrical and topological information stored in a tet3dbuilder object. More... | |
Three-dimensional tetrahedral meshes.
void addtetrahedron_tet3dbuilder | ( | ptet3dbuilder | tb, |
uint | v0, | ||
uint | v1, | ||
uint | v2, | ||
uint | v3 | ||
) |
Add a tetrahedron to a tet3dbuilder object.
tb | Target tet3dbuilder object. |
v0 | Index of first vertex. |
v1 | Index of second vertex. |
v2 | Index of third vertex. |
v3 | Index of fourth vertex. |
ptet3d buildmesh_tet3dbuilder | ( | ptet3dbuilder | tb | ) |
Create a tet3d mesh from the geometrical and topological information stored in a tet3dbuilder object.
Once the mesh has been created, the corresponding tet3dbuilder object can be deleted.
tb | Source tet3dbuilder object. |
void check_tet3d | ( | pctet3d | gr | ) |
Perform various consistency checks.
gr | Mesh |
void del_tet3dbuilder | ( | ptet3dbuilder | tb | ) |
Delete a tet3dbuilder object.
tb | Object to be deleted. |
Ensure that the edges of boundary faces are in counter-clockwise order as seen from outside of the mesh.
gr | Mesh, offending boundary faces will be reordered |
Find the edges of a tetrahedron.
Due to the hierarchical representation of geometric objects, we cannot access the edges of a tetrahedron directly. This function finds the edges and returns them in a specific order:
e[0]
is the intersection of the faces 1 and 2.e[1]
is the intersection of the faces 2 and 3.e[2]
is the intersection of the faces 3 and 1.e[3]
is the intersection of the faces 0 and 1.e[4]
is the intersection of the faces 0 and 2.e[5]
is the intersection of the faces 0 and 3.gr | Mesh |
tn | Number of the tetrahedron |
e | Will be filled with the edge numbers |
Find the vertices of a tetrahedron corresponding to a given face.
Due to the hierarchical representation of geometric objects, we cannot access the vertices of a tetrahedron directly. This function finds the vertices and returns them in a specific order: v[0]
is the vertex opposite the local face fl
of the tetrahedron, and v[1]
, v[2]
and v[3]
are the vertices on this face such that v[i+1]
is opposite the i
-th edge gr->f[gr->t[tn][fl]][i]
. This feature is important if the order of the edges is relevant, e.g., if we want to compute outward normal vectors for a boundary face.
gr | Mesh |
tn | Number of the tetrahedron |
fl | Local index of the face, can only be 0, 1, 2, or 3. |
v | Will be filled with the vertex numbers |
Find the vertices of a face.
Due to the hierarchical representation of geometric objects, we cannot access the vertices of a face directly. This function finds the vertices and returns them.
t3 | Mesh. |
nf | Global number of the face. |
v | will be filled with the vertex numbers. |
Find the vertices of a tetrahedron.
Due to the hierarchical representation of geometric objects, we cannot access the vertices of a tetrahedron directly. This function finds the vertices and returns them in a specific order: v[i]
is the vertex opposite the i
-th face.
gr | Mesh |
tn | Number of the tetrahedron |
v | Will be filled with the vertex numbers |
real(* getx_tet3dbuilder | ( | ptet3dbuilder | tb | ) | )[3] |
Obtain array of vertex coordinates in tet3dbuilder object.
Since tet3dbuilder is an opaque class, this function is provided for setting the coordinates of the vertices.
tb | tet3dbuilder object. |
tb->vertices
entries of type real [3]
representing the vertex coordinates. ptet3d new_axis_tet3d | ( | ) |
Create a mesh for a tetrahedron with three edges aligned with the coordinate axes.
ptet3d new_regular_tet3d | ( | ) |
Create a mesh for a regular tetrahedron.
ptet3dbuilder new_tet3dbuilder | ( | uint | vertices | ) |
Create a new tet3dbuilder object.
vertices | Number of vertices of the new mesh. |
ptet3d new_unitcube_tet3d | ( | ) |
Create a mesh containing six tetrahedra representing the unit cube .
ptet3d read_tet3d | ( | const char * | name | ) |
Read a tetrahedral mesh from a file.
name | Filename |
Regular refinement of a tetrahedral mesh.
The mesh is globally refined using Bey's algorithm.
gr | Coarse mesh |
grr | If not null, the target pointer will be set to a new tet3dref object describing the refinement relationship |
void statistics_tet3d | ( | pctet3d | gr, |
preal | hmin, | ||
preal | hmax, | ||
preal | volmin, | ||
preal | volmax, | ||
preal | relvolmin, | ||
preal | relvolmax | ||
) |
Compute various statistices of a mesh.
gr | Mesh |
hmin | Will be overwritten by the minimal edge length |
hmax | Will be overwritten by the maximal edge length |
volmin | Will be overwritten by the minimal volume of a tetrahedron |
volmax | Will be overwritten by the maximal volume of a tetrahedron |
relvolmin | Will be overwritten by the minimal relative volume of a tetrahedron (relative with respect to the local mesh parameter) |
relvolmax | Will be overwritten by the maximal relative volume of a tetrahedron (relative with respect to the local mesh parameter) |
void write_tet3d | ( | pctet3d | gr, |
const char * | name | ||
) |
Write a tetrahedral mesh to a file.
gr | Source mesh |
name | Filename |