Series: Finite Element MethodReference Domains and Quadrature

The Line Domain

The reference domain for a 1D element is the unit interval T^=[0,1]\hat{T} = [0, 1]. Every line element in a mesh is the image of T^\hat{T} under an affine map FeF_e, so quadrature rules need only be defined once on [0,1][0, 1] and then applied to any element by a change of variables.

The standard choice for quadrature on [0,1][0, 1] is Gauss–Legendre quadrature. An nn-point Gauss–Legendre rule is the unique rule that integrates polynomials of degree up to 2n12n - 1 exactly using only nn function evaluations — the maximum possible precision for nn points. The classical rule is defined on [1,1][-1, 1] and computed by numpy.polynomial.legendre.leggauss; the nodes and weights are then mapped to [0,1][0, 1] by a linear change of variables.

The figure below shows the quadrature points on [0,1][0, 1] for n=1,2,3,4n = 1, 2, 3, 4 points, integrating polynomials of degree up to 1,3,5,71, 3, 5, 7 exactly. The marker size is proportional to the weight.

Gauss–Legendre quadrature points on [0,1] for n = 1, 2, 3, 4

Given a required polynomial degree pp, the number of points needed is n=(p+1)/2n = \lceil (p+1)/2 \rceil.

In the library, this is implemented in refdomains/line.py by the class LineDomain, whose quadrature(order) method returns (points, weights) for the rule that integrates polynomials of degree order exactly.