# pyramid_rule

pyramid_rule, a Python code which generates a quadrature rule over the interior of the unit pyramid in 3D.

The quadrature rules generated by pyramid_rule() are all examples of conical product rules, and involve a kind of direct product of the form:

Legendre rule in X * Legendre rule in Y * Jacobi rule in Z
where the Jacobi rule includes a factor of (1-Z)^2.

The integration region is:

```       - ( 1 - Z ) <= X <= 1 - Z
- ( 1 - Z ) <= Y <= 1 - Z
0 <= Z <= 1.
```
When Z is zero, the integration region is a square lying in the (X,Y) plane, centered at (0,0,0) with "radius" 1. As Z increases to 1, the radius of the square diminishes, and when Z reaches 1, the square has contracted to the single point (0,0,1).

### Usage:

pyramid_rule ( legendre_order, jacobi_order, 'filename' )
where
• legendre_order is the order of the 1D Legendre quadrature rule to be used. The X and Y dimensions will use a product of this rule.
• jacobi_order is the order of the 1D Jacobi quadrature rule to be used. The Z dimension will use this rule which will include a factor of (1-X)^2 which accounts for the narrowing of the pyramid.
• 'filename' is the common prefix for the files containing the region, weight and abscissa information of the quadrature rule;

### Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

### Languages:

pyramid_rule is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave versionand a Python version.

### Related Data and Programs:

alpert_rule, a Python code which sets up an Alpert quadrature rule for functions which are regular, log(x) singular, or 1/sqrt(x) singular.

annulus_rule, a Python code which computes a quadrature rule for estimating integrals of a function over the interior of a circular annulus in 2d.

circle_rule, a Python code which computes a quadrature rule over the circumference of the unit circle in 2d.

cube_felippa_rule, a Python code which returns the points and weights of a Felippa quadrature rule over the interior of a cube in 3d.

disk_rule, a Python code which computes quadrature rules over the interior of a disk in 2d.

geometry, a Python code which performs geometric calculations in 2, 3 and n dimensional space.

hexagon_stroud_rule, a Python code which computes one of four Stroud quadrature rules over the interior of the unit hexagon.

jacobi_rule, a Python code which computes a Gauss-Jacobi quadrature rule.

legendre_rule, a Python code which computes a Gauss-Legendre quadrature rule.

pyramid_exactness, a Python code which investigates the polynomial exactness of a quadrature rule over the interior of the unit pyramid in 3d.

pyramid_felippa_rule, a Python code which returns a Felippa quadrature rule for approximating integrals over the interior of a pyramid in 3d.

pyramid_grid, a Python code which computes a grid of points over the interior of the unit pyramid in 3d;

pyramid_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit pyramid in 3d.

pyramid_jaskowiec_rule, a Python code which returns quadrature rules, with exactness up to total degree 20, over the interior of a pyramid in 3D, by Jan Jaskowiec, Natarajan Sukumar.

pyramid_monte_carlo, a Python code which applies a Monte Carlo method to estimate integrals of a function over the interior of the unit pyramid in 3d;

pyramid_witherden_rule, a Python code which returns a Witherden quadrature rule, with exactness up to total degree 10, over the interior of a pyramid in 3D.

quadrature_rules_pyramid, a dataset directory which contains quadrature rules over the interior of the unit pyramid in 3d.

square_felippa_rule, a Python code which returns the points and weights of a Felippa quadrature rule over the interior of a square in 2d.

stroud, a Python code which defines quadrature rules for a variety of unusual areas, surfaces and volumes in 2d, 3d and n-dimensions.

tetrahedron_felippa_rule, a Python code which returns a Felippa quadrature rule for approximating integrals over the interior of a tetrahedron in 3d.

triangle_fekete_rule, a Python code which defines Fekete rules for quadrature or interpolation over the interior of a triangle in 2d.

triangle_felippa_rule, a Python code which returns a Felippa quadrature rule for approximating integrals over the interior of a triangle in 2d.

wedge_felippa_rule, a Python code which returns quadrature rules for approximating integrals over the interior of the unit wedge in 3d.

### Reference:

1. Carlos Felippa,
A compendium of FEM integration formulas for symbolic work,
Engineering Computation,
Volume 21, Number 8, 2004, pages 867-890.
2. Arthur Stroud,
Approximate Calculation of Multiple Integrals,
Prentice Hall, 1971,
ISBN: 0130438936,
LC: QA311.S85.

### Source Code:

Last revised on 15 May 2023.