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
nintpoints 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 aspointsto theupdate_*functions of the elements, which use them in both directions,xiandeta, fornint*nintintegration points; the samenintis given to the constructor of the element.- Parameters:
- nintint
Number of integration points, from
2to10.
- Returns:
- pointsnp.ndarray
1-D array of
floatof sizenintwith the points, dimensionless.- weightsnp.ndarray
1-D array of
floatof sizenintwith the weights, dimensionless.
- Raises:
- NotImplementedError
If
nintis not one of2, 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 weightweights[i]*weights[j]at(points[i], points[j]), is exact for the polynomials of degree up to2*nint - 1in each ofxiandeta. The Notes ofbfsccylinder.bfsccylindergive thenintthat integrates each element matrix exactly.