TET_MESH_QUAD
Integral Estimate Over a Region Defined by a Tetrahedral Mesh
TET_MESH_QUAD
is a C++ program which
reads information defining a tetrahedral mesh, and estimates the integral of
a function whose values are given at the nodes.
Note that this program only expects to receive values of the function f(x,y,z)
at the nodes of the tet mesh, that is, as a simple list of values. No formula
for f is expected or used. A much better estimate for the integral might
be possible if a formula for f(x,y,z) were available, in which case a higher
order quadrature scheme could be employed.
This program should be able to compute exactly the integrals of 1, x, y, z, and any
linear combination of these. It will only be able to approximate the integrals
of other functions, and the accuracy of the approximation will depend in part
on the size of the triangles in the triangulation.
Usage:
tet_mesh_quad prefix
where 'prefix' is the common prefix for the node, element, and value files

prefix_nodes.txt, the node coordinates;

prefix_elements.txt, the elements of the tet mesh.

prefix_values.txt, the value (which may be a scalar or vector)
of some function at each node.

volume is the volume of the region covered by the tet mesh, which
is computed and printed out by the program.

quad is the (scalar or vector) result of the integration estimate, which
is computed and printed out by the program.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
TRIANGULATION_QUAD is available in
a C++ version and
a FORTRAN90 version and
a MATLAB version.
Related Data and Programs:
TET_MESH,
a C++ library which
carries out various operations on tetrahedral meshes.
TRIANGULATION_QUAD,
a C++ program which
estimates the integral of a function over a triangulated region.
Source Code:
Examples and Tests:
CUBE_4x4x4 is a set of nodes in the [0,4]x[0,4]x[0,4] cube, which have
been arranged into an order 4 tet mesh.
List of Routines:

MAIN is the main program for TET_MESH_QUAD.

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.

I4MAT_DATA_READ reads data from an I4MAT file.

I4MAT_HEADER_READ reads the header from an I4MAT file.

I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.

I4MAT_TRANSPOSE_PRINT_SOME prints some of an I4MAT, transposed.

MESH_BASE_ZERO ensures that the element definition is zerobased.

R8_ABS returns the absolute value of an R8.

R8_HUGE returns a "huge" R8.

R8_MAX returns the maximum of two R8's.

R8_MIN returns the minimum of two R8's.

R8MAT_DATA_READ reads the data from an R8MAT file.

R8MAT_HEADER_READ reads the header from an R8MAT file.

R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.

R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.

R8VEC_PRINT prints an R8VEC.

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.

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