SQUARE_EXACTNESS is a FORTRAN77 library which investigates the polynomial exactness of quadrature rules for f(x,y) over the interior of a square (rectangle/quadrilateral) in 2D.
We assume that the integral to be approximated is of a Legendre type, over a rectangular region:
I(f) = integral ( c <= y <= d ) integral ( a <= x <= b ) f(x,y) dx dyand that such integrals are to be approximated by:
Q(f) = sum ( 1 <= i <= N ) w(i) * f(x(i),y(i))
To determine the exactness of a given quadrature rule, we simply compare the exact integral I(f) to the estimated integral Q(f) for a sequence of monomials of increasing total degree D. This sequence begins with:
D = 0: 1 D = 1: x y D = 2: x^2 xy x^2 D = 3: x^3 x^2y xy^2 y^3and the exactness of a quadrature rule is defined as the largest value of D such that I(f) and Q(f) are equal for all monomials up to and including those of total degree D.
Note that if the 2D quadrature rule is formed as a product of two 1D rules, then knowledge of the 1D exactness of the individual factors gives sufficient information to determine the exactness of the product rule, which will simply be the minimum of the exactnesses of the two factor rules.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
SQUARE_EXACTNESS is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version.
CUBE_EXACTNESS, a FORTRAN77 library which investigates the polynomial exactness of quadrature rules over the interior of a cube in 3D.
EXACTNESS, a FORTRAN77 library which investigates the exactness of quadrature rules that estimate the integral of a function with a density, such as 1, exp(-x) or exp(-x^2), over an interval such as [-1,+1], [0,+oo) or (-oo,+oo).
HYPERCUBE_EXACTNESS, a FORTRAN77 program which measures the monomial exactness of an M-dimensional quadrature rule over the interior of the unit hypercube in M dimensions.
PYRAMID_EXACTNESS, a FORTRAN77 program which investigates the monomial exactness of a quadrature rule over the interior of a pyramid in 3D.
SPHERE_EXACTNESS, a FORTRAN77 program which tests the polynomial exactness of a quadrature rule over the surface of the unit sphere in 3D.
SQUARE_FELIPPA_RULE, a FORTRAN77 library which returns the points and weights of a Felippa quadrature rule over the interior of a square in 2D.
SQUARE_GRID, a FORTRAN77 library which computes a grid of points over the interior of a square in 2D.
SQUARE_EXACTNESS, a FORTRAN77library which investigates the polynomial exactness of quadrature rules for f(x,y) over the interior of a rectangle in 2D.
TETRAHEDRON_EXACTNESS, a FORTRAN77 program which investigates the polynomial exactness of a quadrature rule over the interior of a tetrahedron in 3D.
TRIANGLE_EXACTNESS, a FORTRAN77 program which investigates the polynomial exactness of a quadrature rule over the interior of a triangle in 2D.
WEDGE_EXACTNESS, a FORTRAN77 program which investigates the monomial exactness of a quadrature rule over the interior of the unit wedge in 3D.
You can go up one level to the FORTRAN77 source codes.