The Line Domain
The reference domain for a 1D element is the unit interval . Every line element in a mesh is the image of under an affine map , so quadrature rules need only be defined once on and then applied to any element by a change of variables.
The standard choice for quadrature on is Gauss–Legendre quadrature. An -point Gauss–Legendre rule is the unique rule that integrates polynomials of degree up to exactly using only function evaluations — the maximum possible precision for points. The classical rule is defined on and computed by numpy.polynomial.legendre.leggauss; the nodes and weights are then mapped to by a linear change of variables.
The figure below shows the quadrature points on for points, integrating polynomials of degree up to exactly. The marker size is proportional to the weight.
Given a required polynomial degree , the number of points needed is .
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.