TEST_TRI_INT
Triangle Integration Test Functions
TEST_TRI_INT is a library of FORTRAN90 routines,
using double precision arithmetic,
which defines a number of test functions to be integrated over
a triangle.
It is possible to invoke a particular function by number, or to
try out all available functions,
as demonstrated in the sample calling program.
For convenience, all the integrand functions have been
scaled by a constant, so that the integral of the function
over the specific domain is exactly 1.
The test functions include F(X,Y)=
-
1 on the unit triangle.
-
x on the unit triangle.
-
y on the unit triangle.
-
x2 on the unit triangle.
-
x*y on the unit triangle.
-
y2 on the unit triangle.
-
x3 on the unit triangle.
-
x4 on the unit triangle.
-
x5 on the unit triangle.
-
x^(-0.2) remapped to (1,0), (5,0), (5,1).
-
(x+y)^(-0.2) on the unit triangle.
-
(1-x-y)^(-0.2) remapped to (-1,-3), (3,-2), (-1,2).
-
(x*y)^(-0.2) remapped to (0,0), (-7,0), (0,-3).
-
1/sqrt(x) + 1/sqrt(y) + 1/sqrt(x+y) on the unit triangle.
-
1/sqrt(1-x-y) on the unit triangle.
-
log(x*y) on the unit triangle.
-
1/sqrt(|x-1/4|) + 1/sqrt(|y-1/2|) on the unit triangle.
-
log ( x + y ) on the unit triangle.
-
sin ( x ) cos ( 5 y ) on the unit triangle.
-
sin ( 11 x ) cos ( y ) on the unit triangle.
-
1 / r on the unit triangle,
r = sqrt ( x^2+y^2).
-
log ( r ) / r on the unit triangle,
r = sqrt ( x^2+y^2).
The library includes a routines to define the integrand function,
the triangle over which the integral is to be carried out,
and a title for the problem.
Thus, for each integrand function, four routines are supplied. For
instance, for function #4, we have the routines:
-
P04_FUN evaluates the integrand for problem 4.
-
P04_TITLE returns the title for problem 4.
-
P04_VERTICES returns the integration triangle for problem 4
So once you have the calling sequences for these routines, you
can easily evaluate the function, or integrate it between the
appropriate limits, or compare your estimate of the integral
to the exact value.
Moreover, since the same interface is used for each function,
if you wish to work with problem 16 instead, you simply change
the "04" to "07" in your routine calls.
If you wish to call all of the functions, then you
simply use the generic interface, which again has four
routines, but which requires you to specify the problem
number as an extra input argument:
-
P00_FUN evaluates the integrand for problem PROB.
-
P00_SINGULARITY warns if the integran for problem PROB
has vertex, edge or interior singularities that might cause
problems for some integration schemes.
-
P00_TITLE returns the title for problem PROB.
-
P00_VERTICES returns the integration triangle for problem PROB.
Finally, some demonstration routines are built in for
simple quadrature methods. These routines include
-
P00_WANDZURA05_SUB applies an order-5 accurate Wandzura
rule, plus subdivision of the triangle.
-
P00_MONTE_CARLO uses Monte Carlo sampling.
-
P00_VERTEX_SUB averages values at vertices, and uses
subdivision.
and can be used with any of the sample integrands.
Related Data and Programs:
CUBPACK
is a library of FORTRAN90 routines, using double
precision arithmetic, which estimates the integral of a function
(or vector of functions) over a collection of N-dimensional
hyperrectangles and simplices.
DUNAVANT
is a FORTRAN90 library of routines
for defining Dunavant rules for quadrature
on a triangle.
FEKETE
is a FORTRAN90 library of routines for defining
a Fekete rule for quadrature or interpolation over a triangle.
GM_RULES
is a FORTRAN90 library of routines for defining a Grundmann-Moeller
rule for quadrature over a triangle, tetrahedron, or general
M-dimensional simplex.
INTLIB
is a FORTRAN90 library of routines for numerically estimating integrals
in one dimension.
NCC_TRIANGLE
is a FORTRAN90 library defining Newton-Cotes closed quadrature
rules on a triangle.
NCO_TRIANGLE
is a FORTRAN90 library defining Newton-Cotes open quadrature
rules on a triangle.
NINT_EXACTBESS_TRI
is an executable FORTRAN90 program which investigates the polynomial
exactness of a quadrature rule for the triangle.
NINTLIB
is a FORTRAN90 library of routines for numerically estimating integrals
in multiple dimensions.
QUADPACK is a
FORTRAN90 library of routines for estimating integrals in one dimension.
QUADRULE is a
FORTRAN90 library of routines for defining quadrature rules on a
variety of intervals with different weight functions.
SIMPACK
is a FORTRAN77 library of routines which
approximate the integral of a function or vector of functions
over a multidimensional simplex, or a region which is the
sum of multidimensional simplexes.
STRI_QUAD
is a FORTRAN90 library of routines which can approximate the
integral of a function over the surface of a sphere.
STROUD
is a FORTRAN90 library of routines which includes
some quadrature rules for triangles.
TEST_NINT
is a FORTRAN90 library of functions that can be used to test N-dimensional
quadrature routines.
TEST_TRI_INT is also available in
a C++ version and
a MATLAB version.
TOMS612
is a FORTRAN77 library of routines which can estimate
the integral of a function over a triangle.
TOMS706
is a FORTRAN77 library which estimates the integral of a function
over a triangulated region.
TRIANGULATION
is a FORTRAN90 library of routines for triangulations, which
includes some quadrature rules on triangles.
WANDZURA
is a FORTRAN90 library of routines
for defining Wandzura rules for quadrature
on a triangle.
Reference:
-
Elise deDoncker, Ian Robinson,
An Algorithm for Automatic Integration Over a Triangle
Using Nonlinear Extrapolation,
ACM Transactions on Mathematical Software,
Volume 10, Number 1, March 1984, pages 1-16.
-
Elise deDoncker, Ian Robinson,
Algorithm 612:
Integration over a Triangle Using Nonlinear Extrapolation,
ACM Transactions on Mathematical Software,
Volume 10, Number 1, March 1984, pages 17-22.
-
Stephen Wandzura, Hong Xiao,
Symmetric Quadrature Rules on a Triangle,
Computers and Mathematics with Applications,
Volume 45, pages 1829-1840, 2003.
Source Code:
Examples and Tests:
List of Routines:
-
GET_PROB_NUM returns the number of test integration problems.
-
P00_FUN evaluates the integrand for any problem.
-
P00_MONTE_CARLO applies the Monte Carlo rule to integrate a function.
-
P00_SINGULARITY warns of common singularities for any problem.
-
P00_TITLE returns the title for any problem.
-
P00_VERTEX_SUB approximates an integral in a triangle by subdivision.
-
P00_VERTICES returns the vertices for any problem.
-
P00_WANDZURA05_SUB uses subdivision and a Wandzura rule.
-
P01_FUN evaluates the integrand for problem 1.
-
P01_TITLE returns the title of problem 1.
-
P01_VERTICES returns the vertices for problem 1.
-
P02_FUN evaluates the integrand for problem 2.
-
P02_TITLE returns the title of problem 2.
-
P02_VERTICES returns the vertices for problem 2.
-
P03_FUN evaluates the integrand for problem 3.
-
P03_TITLE returns the title of problem 3.
-
P03_VERTICES returns the vertices for problem 3.
-
P04_FUN evaluates the integrand for problem 4.
-
P04_TITLE returns the title of problem 4.
-
P04_VERTICES returns the vertices for problem 4.
-
P05_FUN evaluates the integrand for problem 5.
-
P05_TITLE returns the title of problem 5.
-
P05_VERTICES returns the vertices for problem 5.
-
P06_FUN evaluates the integrand for problem 6.
-
P06_TITLE returns the title of problem 6.
-
P06_VERTICES returns the vertices for problem 6.
-
P07_FUN evaluates the integrand for problem 7.
-
P07_TITLE returns the title of problem 7.
-
P07_VERTICES returns the vertices for problem 7.
-
P08_FUN evaluates the integrand for problem 8.
-
P08_TITLE returns the title of problem 8.
-
P08_VERTICES returns the vertices for problem 8.
-
P09_FUN evaluates the integrand for problem 9.
-
P09_TITLE returns the title of problem 9.
-
P09_VERTICES returns the vertices for problem 9.
-
P10_FUN evaluates the integrand for problem 10.
-
P10_TITLE returns the title of problem 10.
-
P10_VERTICES returns the vertices for problem 10.
-
P11_FUN evaluates the integrand for problem 11.
-
P11_TITLE returns the title of problem 11.
-
P11_VERTICES returns the vertices for problem 11.
-
P12_FUN evaluates the integrand for problem 12.
-
P12_TITLE returns the title of problem 12.
-
P12_VERTICES returns the vertices for problem 12.
-
P13_FUN evaluates the integrand for problem 13.
-
P13_TITLE returns the title of problem 13.
-
P13_VERTICES returns the vertices for problem 13.
-
P14_FUN evaluates the integrand for problem 14.
-
P14_TITLE returns the title of problem 14.
-
P14_VERTICES returns the vertices for problem 14.
-
P15_FUN evaluates the integrand for problem 15.
-
P15_TITLE returns the title of problem 15.
-
P15_VERTICES returns the vertices for problem 15.
-
P16_FUN evaluates the integrand for problem 16.
-
P16_TITLE returns the title of problem 16.
-
P16_VERTICES returns the vertices for problem 16.
-
P17_FUN evaluates the integrand for problem 17.
-
P17_TITLE returns the title of problem 17.
-
P17_VERTICES returns the vertices for problem 17.
-
P18_FUN evaluates the integrand for problem 18.
-
P18_TITLE returns the title of problem 18.
-
P18_VERTICES returns the vertices for problem 18.
-
P19_FUN evaluates the integrand for problem 19.
-
P19_TITLE returns the title of problem 19.
-
P19_VERTICES returns the vertices for problem 19.
-
P20_FUN evaluates the integrand for problem 20.
-
P20_TITLE returns the title of problem 20.
-
P20_VERTICES returns the vertices for problem 20.
-
P21_FUN evaluates the integrand for problem 21.
-
P21_TITLE returns the title of problem 21.
-
P21_VERTICES returns the vertices for problem 21.
-
P22_FUN evaluates the integrand for problem 22.
-
P22_TITLE returns the title of problem 22.
-
P22_VERTICES returns the vertices for problem 22.
-
R8_UNIFORM_01 returns a unit pseudorandom R8.
-
SUBTRIANGLE_NEXT computes the next subtriangle of a triangle.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
-
TRIANGLE_AREA computes the area of a triangle in 2D.
-
TRIANGLE_SAMPLE returns random points in a triangle.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 10 April 2007.