# TET_MESH Routines for a Tet Mesh

TET_MESH is a FORTRAN77 library which constructs, describes, and modifies a mesh of tetrahedrons.

### Linear and Quadratic Meshes

The simplest tet mesh, which we term an order 4 or linear mesh, uses four points to define each tetrahedron. A second type of mesh, known as an order 10 or quadratic mesh, uses ten points.

While an order 4 mesh can naturally be constructed directly from most sets of data points, a mesh of order 10 is not usually constructed directly from the data; at least in the simplest case, one wants the 6 extra nodes to be the midpoints of the sides determined by the 4 vertices.

Thus, an order 10 tet mesh is typically generated in two steps:

• generate an order 4 mesh, in which every tetrahedral vertex comes from a user data point;
• generate an order 10 mesh from the order 4 mesh, in which the new midside points are not user data points, but rather averages of pairs of tetrahedral vertices.

MATLAB has a command delaunay3 that can compute the tet mesh for a set of 3D points.

### Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

### Languages:

TET_MESH is available in a C++ version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version.

### Related Programs:

>

TET_MESH_ORDER4, a data directory which contains a description and examples of a tet mesh using order 4 elements.

TET_MESH_ORDER10, a data directory which contains a description and examples of a tet mesh using order 10 elements.

### Reference:

1. Adrian Bowyer, John Woodwark,
A Programmer's Geometry,
Butterworths, 1983,
ISBN: 0408012420.
2. Paul Bratley, Bennett Fox, Linus Schrage,
A Guide to Simulation,
Second Edition,
Springer, 1987,
ISBN: 0387964673.
3. Qiang Du, Desheng Wang,
The Optimal Centroidal Voronoi Tesselations and the Gersho's Conjecture in the Three-Dimensional Space,
Computers and Mathematics with Applications,
Volume 49, 2005, pages 1355-1373.
4. Herbert Edelsbrunner,
Geometry and Topology for Mesh Generation,
Cambridge, 2001,
ISBN: 0-521-79309-2,
LC: QA377.E36.
5. Barry Joe,
GEOMPACK - a software package for the generation of meshes using geometric algorithms,
Advances in Engineering Software,
Volume 13, Number 5, 1991, pages 325-331.
6. Anwei Liu, Barry Joe,
Quality Local Refinement of Tetrahedral Meshes Based on 8-Subtetrahedron Subdivision,
Mathematics of Computation,
Volume 65, Number 215, July 1996, pages 1183-1200.
7. Albert Nijenhuis, Herbert Wilf,
Combinatorial Algorithms for Computers and Calculators,
Second Edition,
ISBN: 0-12-519260-6,
LC: QA164.N54.
8. Per-Olof Persson, Gilbert Strang,
A Simple Mesh Generator in MATLAB,
SIAM Review,
Volume 46, Number 2, June 2004, pages 329-345.
9. Philip Schneider, David Eberly,
Geometric Tools for Computer Graphics,
Elsevier, 2002,
ISBN: 1558605940.

### List of Routines:

• I4_UNIFORM returns a scaled pseudorandom I4.
• I4COL_COMPARE compares columns I and J of an I4COL.
• I4COL_SORT_A ascending sorts an I4COL.
• I4COL_SORT2_A ascending sorts the elements of each column of an I4COL.
• I4COL_SORTED_UNIQUE_COUNT counts unique elements in an I4COL.
• I4COL_SWAP swaps columns J1 and J2 of an I4COL.
• I4I4_SORT_A ascending sorts a pair of I4's.
• I4I4I4_SORT_A ascending sorts a triple of I4's.
• I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.
• I4MAT_TRANSPOSE_PRINT_SOME prints some of the transpose of an I4MAT.
• I4VEC_PRINT prints an I4VEC.
• MESH_BASE_ONE ensures that the element definition is one-based.
• R8_UNIFORM_01 returns a unit pseudorandom R8.
• R8MAT_DET_4D computes the determinant of a 4 by 4 R8MAT.
• R8MAT_PRINT prints an R8MAT.
• R8MAT_PRINT_SOME prints some of an R8MAT.
• R8MAT_SOLVE uses Gauss-Jordan elimination to solve an N by N linear system.
• R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.
• R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.
• R8MAT_UNIFORM_01 fills an R8MAT with unit pseudorandom numbers.
• R8VEC_CROSS_3D computes the cross product of two R8VEC's in 3D.
• R8VEC_LENGTH returns the Euclidean length of an R8VEC.
• R8VEC_MEAN returns the mean of an R8VEC.
• R8VEC_PRINT prints an R8VEC.
• R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.
• R8VEC_VARIANCE returns the variance of an R8VEC.
• SORT_HEAP_EXTERNAL externally sorts a list of items into ascending order.
• TET_MESH_NEIGHBOR_TETS determines tetrahedron neighbors.
• TET_MESH_NODE_ORDER: determine the order of nodes in a tet mesh.
• TET_MESH_ORDER4_ADJ_COUNT counts the number of nodal adjacencies.
• TET_MESH_ORDER4_ADJ_SET sets the nodal adjacency matrix.
• TET_MESH_ORDER4_BOUNDARY_FACE_COUNT counts the number of boundary faces.
• TET_MESH_ORDER4_EDGE_COUNT counts the number of edges.
• TET_MESH_ORDER4_EXAMPLE_SET sets an example linear tet mesh.
• TET_MESH_ORDER4_EXAMPLE_SIZE sizes an example linear tet mesh.
• TET_MESH_ORDER4_REFINE_COMPUTE computes a refined order4 tet mesh.
• TET_MESH_ORDER4_REFINE_SIZE sizes a refined order 4 tet mesh.
• TET_MESH_ORDER4_TO_ORDER10_COMPUTE: quadratic tet mesh from a linear one.
• TET_MESH_ORDER4_TO_ORDER10_SIZE sizes a quadratic tet mesh from a linear one.
• TET_MESH_ORDER10_ADJ_COUNT counts the number of nodal adjacencies.
• TET_MESH_ORDER10_ADJ_SET sets the nodal adjacency matrix.
• TET_MESH_ORDER10_EXAMPLE_SET sets an example quadratic tet mesh.
• TET_MESH_ORDER10_EXAMPLE_SIZE sizes an example quadratic tet mesh.
• TET_MESH_ORDER10_TO_ORDER4_COMPUTE linearizes a quadratic tet mesh.
• TET_MESH_ORDER10_TO_ORDER4_SIZE sizes a linear tet mesh from a quadratic one.
• TET_MESH_QUAD approximates an integral over a tet mesh.
• TET_MESH_QUALITY1 returns the quality of each tet in a mesh.
• TET_MESH_QUALITY2 returns the quality of each tet in a mesh.
• TET_MESH_QUALITY3 returns the quality of each tet in a mesh.
• TET_MESH_QUALITY4 returns the quality of each tet in a mesh.
• TET_MESH_QUALITY5 returns the quality of each tet in a mesh.
• TET_MESH_SEARCH_DELAUNAY searches a Delaunay tet mesh for a point.
• TET_MESH_SEARCH_NAIVE naively searches a tet mesh.
• TETRAHEDRON_BARYCENTRIC: barycentric coordinates of a point.
• TETRAHEDRON_CIRCUMSPHERE_3D computes the circumsphere of a tetrahedron in 3D.
• TETRAHEDRON_EDGE_LENGTH_3D returns edge lengths of a tetrahedron in 3D.
• TETRAHEDRON_INSPHERE_3D finds the insphere of a tetrahedron in 3D.
• TETRAHEDRON_ORDER4_PHYSICAL_TO_REFERENCE: physical to reference points.
• TETRAHEDRON_ORDER4_REFERENCE_TO_PHYSICAL: T4 reference to physical points.
• TETRAHEDRON_QUALITY1_3D: "quality" of a tetrahedron in 3D.
• TETRAHEDRON_QUALITY2_3D: "quality" of a tetrahedron in 3D.
• TETRAHEDRON_QUALITY3_3D computes the mean ratio of a tetrahedron.
• TETRAHEDRON_QUALITY4_3D computes the minimum solid angle of a tetrahedron.
• TETRAHEDRON_REFERENCE_SAMPLE samples points in the reference tetrahedron.
• TETRAHEDRON_SAMPLE returns random points in a tetrahedron.
• TETRAHEDRON_VOLUME computes the volume of a tetrahedron in 3D.
• TIMESTAMP prints the current YMDHMS date as a time stamp.

You can go up one level to the FORTRAN77 source codes.

Last revised on 07 October 2014