triangulation_quad (original) (raw)
triangulation_quad, a C++ code 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:
triangulation_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 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.
Licensing:
The computer code and data files described and made available on this web page are distributed under the MIT license
Languages:
triangulation_quad is available ina C++ version anda FORTRAN90 version anda MATLAB version.
Related Data and Programs:
STROUD, a C++ code which defines quadrature rules for a variety of multidimensional reqions.
TET_MESH_QUAD, a C++ code 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 C++ code which carries out various operations on order 3 ("linear") or order 6 ("quadratic") triangulations.
TRIANGULATION_NODE_TO_ELEMENT, a C++ code which reads files describing a set of nodes, their triangulation, and the value of one or more quantities at each node, and outputs a file that averages the quantities for each element. This operation in effect creates an "order1" finite element model of the data.
Source Code:
- <triangulation%5Fquad.cpp>, the source code.
- <triangulation%5Fquad.sh>, compiles the code.
Last revised on 06 May 2020.