# TRIANGULATION_QUAD Integral Estimate Over a Triangulated Region

TRIANGULATION_QUAD is a FORTRAN90 program which reads information defining a triangulation, and estimates the integral of a function whose values are given at the nodes.

Note that this program only expects to recieve values of the function f(x,y) at the nodes of the triangulation, 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) 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, 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:

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 triangulation.
• prefix_values.txt, the value (which may be a scalar or vector) of some function at each node.
• quad is the (scalar or vector) result of the integration estimate, which is computed and printed out by the program.

### Languages:

TRIANGULATION_QUAD is available in a C++ version and a FORTRAN90 version and a MATLAB version.

### Related Data and Programs:

STROUD, a FORTRAN90 library which defines quadrature rules for a variety of multidimensional reqions.

TET_MESH_QUAD, a FORTRAN90 program which estimates the integral of a function over a region defined by a tetrahedral mesh.

TOMS706, a FORTRAN77 library which estimates the integral of a function over a triangulated region.

TRIANGULATION, a FORTRAN90 library which carries out various operations on order 3 ("linear") or order 6 ("quadratic") triangulations.

TRIANGULATION_ORDER3, a data directory which contains a description and examples of order 3 triangulations.

TRIANGULATION_ORDER6, a data directory which contains a description and examples of order 6 triangulations.

### Examples and Tests:

EXAMPLE is a set of nodes in the unit square, which have been arranged into an order 3 triangulation.

• example_nodes.txt, the node file.
• example_elements.txt, the element file.
• example_values.txt, the values file, containing 4 values at each node. (These values are actually the values of 1, x, y, and x*y, which have exact integrals of 1, 1/2, 1/2, and 1/4.) Only the first three integrals will be estimated exactly.
• example_output.txt, the output file from the command

### List of Routines:

• MAIN is the main program for TRIANGULATION_QUAD.
• CH_CAP capitalizes a single character.
• CH_EQI is a case insensitive comparison of two characters for equality.
• CH_TO_DIGIT returns the integer value of a base 10 digit.
• FILE_COLUMN_COUNT counts the number of columns in the first line of a file.
• FILE_ROW_COUNT counts the number of row records in a file.
• GET_UNIT returns a free FORTRAN unit number.
• I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.
• I4MAT_TRANSPOSE_PRINT_SOME prints some of the transpose of an I4MAT.
• MESH_BASE_ONE ensures that the element definition is one-based.
• R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.
• R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT transposed.
• R8VEC_PRINT prints an R8VEC.
• 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 FORTRAN90 source codes.

Last revised on 14 October 2009.