TET_MESH_BOUNDARY
Triangular Surface Formed by Tet Mesh Boundary
TET_MESH_BOUNDARY
is a C++ program which
reads information defining
a tetrahedral mesh of points in 3D, and determines the triangular
faces that form the boundary of the mesh; it writes out files containing
the nodes and elements defining this "TRI_SURFACE".
The tet mesh is defined by a node file containing
the coordinates of nodes, and an element file containing
sets of 4 or 10 node indices. (The present version of the program
will only handle the 4 node case.)
Each tetrahedron has 4 triangular faces. Most of these faces
will be shared by a neighbor tetrahedron, but those faces that
are not shared by a neighbor constitute the boundary of the mesh.
The program identifies the triangular faces that form the boundary,
and writes two files, a "boundary_node" file that lists the coordinates
of the nodes, and a "boundary_element" file that lists the indices of
the nodes used to form the faces. This pair of files defines a
triangulated 3D surface, or "TRI_SURFACE".
Usage:
tet_mesh_boundary prefix
where prefix is the common file prefix:

prefix_nodes.txt, the node coordinates;

prefix_elements.txt, the element definitions;

prefix_boundary_node_mask.txt, is 0 for each interior node,
1 for each boundary node;

prefix_boundary_nodes.txt, the boundary node coordinates;

prefix_boundary_elements.txt, the boundary element definitions;
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_BOUNDARY is available in
a C++ version and
a FORTRAN90 version and
a MATLAB version.
Related Programs:
TET_MESH,
a C++ library which
is useful for work with tet meshes.
TET_MESH_DISPLAY,
a MATLAB program which
can read in the
node and tetra files defining a tet mesh and display a wireframe
image.
TET_MESH_DISPLAY_OPENGL,
a C++ program which
reads a tet mesh and displays the
nodes and edges using OpenGL.
TET_MESH_ORDER4,
a directory which
contains a description and
examples of a tet mesh using order 4 elements.
TET_MESH_ORDER10,
a directory which
contains a description and
examples of a tet mesh using order 10 elements.
TET_MESH_TET_NEIGHBORS,
a data directory which
contains a description
and examples of the format for storing information about neighboring
tetrahedrons in a tetrahedral mesh.
TRI_SURFACE,
a data directory which
contains examples of TRI_SURFACE files,
a 3D surface described by a collection of triangles.
TRI_SURFACE_DISPLAY,
a MATLAB program which
displays the 3D graphics information
in a TRI_SURFACE file;
TRI_SURFACE_DISPLAY_OPENGL,
a C++ program which
displays the 3D graphics information
in a TRI_SURFACE file
using OpenGL.
Reference:

Herbert Edelsbrunner,
Geometry and Topology for Mesh Generation,
Cambridge, 2001,
ISBN: 0521793092,
LC: QA377.E36.

Barry Joe,
GEOMPACK  a software package for the generation of meshes
using geometric algorithms,
Advances in Engineering Software,
Volume 13, 1991, pages 325331.

PerOlof Persson, Gilbert Strang,
A Simple Mesh Generator in MATLAB,
SIAM Review,
Volume 46, Number 2, June 2004, pages 329345.
Source code
Examples and Tests
CUBE is a tetrahedral mesh of a cube.
P04 is a tetrahedral mesh of a sphere.
List of Routines

MAIN is the main program for TET_MESH_BOUNDARY.

CH_CAP capitalizes a single character.

CH_EQI is true if two characters are equal, disregarding case.

CH_TO_DIGIT returns the integer value of a base 10 digit.

FILE_COLUMN_COUNT counts the columns in the first line of a file.

FILE_ROW_COUNT counts the number of row records in a file.

I4_MAX returns the maximum of two I4's.

I4_MIN returns the minimum of two I4's.

I4COL_COMPARE compares columns I and J of an I4COL.

I4COL_SORT_A ascending sorts the columns of an I4COL.

I4COL_SWAP swaps two columns of an I4COL.

I4I4I4_SORT_A ascending sorts a triple of I4's.

I4MAT_DATA_READ reads data from an I4MAT file.

I4MAT_HEADER_READ reads the header from an I4MAT file.

I4MAT_TRANSPOSE_PRINT_SOME prints some of an I4MAT, transposed.

I4MAT_WRITE writes an I4MAT file with no header.

I4VEC_CUM computes the cumulutive sum of the entries of an I4VEC.

I4VEC_SUM sums the entries of an I4VEC.

MESH_BASE_ZERO ensures that the element definition is zerobased.

R8MAT_DATA_READ reads the data from an R8MAT file.

R8MAT_HEADER_READ reads the header from an R8MAT file.

R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.

R8MAT_WRITE writes an R8MAT file with no header.

S_LEN_TRIM returns the length of a string to the last nonblank.

S_TO_I4 reads an I4 from a string.

S_TO_I4VEC reads an I4VEC from a string.

S_TO_R8 reads an R8 from a string.

S_TO_R8VEC reads an R8VEC from a string.

S_WORD_COUNT counts the number of "words" in a string.

SORT_HEAP_EXTERNAL externally sorts a list of items into ascending order.

TET_MESH_BOUNDARY_COUNT counts boundary faces and nodes in a tet mesh.

TET_MESH_BOUNDARY_SET sets the boundary faces in a tet mesh.

TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to
the C++ source codes.
Last revised on 22 December 2010.