Gauss-Legendre quadrature (bfsccylinder.quadrature)#

Gauss-Legendre quadrature (bfsccylinder.quadrature)

The function get_points_weights() gives the points and weights of the one-dimensional Gauss-Legendre quadrature on the interval [-1, 1], used as natural coordinates xi and eta by the functions of the modules bfsccylinder.bfsccylinder and bfsccylinder.bfsccylinder_sanders.

bfsccylinder.quadrature.get_points_weights(nint)#

Points and weights of the Gauss-Legendre quadrature

Gives the nint points and weights of the one-dimensional Gauss-Legendre quadrature on the interval [-1, 1], from tabulated values, with the points in increasing order. The points are the natural coordinates given as points to the update_* functions of the elements, which use them in both directions, xi and eta, for nint*nint integration points; the same nint is given to the constructor of the element.

Parameters:
nintint

Number of integration points, from 2 to 10.

Returns:
pointsnp.ndarray

1-D array of float of size nint with the points, dimensionless.

weightsnp.ndarray

1-D array of float of size nint with the weights, dimensionless.

Raises:
NotImplementedError

If nint is not one of 2, 3, ..., 10.

Notes

The points \(x_i\) are the roots of the Legendre polynomial \(P_{nint}\) of degree nint, and the weights are

\[w_i = \frac{2}{(1 - x_i^2) \left[ P'_{nint}(x_i) \right]^2}\]

such that

\[\int_{-1}^{1} f(x) dx \approx \sum_{i=1}^{nint} w_i f(x_i)\]

is exact for the polynomials \(f\) of degree up to 2*nint - 1; the weights sum to 2, the length of the interval. The product rule used by the elements, with the weight weights[i]*weights[j] at (points[i], points[j]), is exact for the polynomials of degree up to 2*nint - 1 in each of xi and eta. The Notes of bfsccylinder.bfsccylinder give the nint that integrates each element matrix exactly.