The Triangle Domain
The reference domain for a triangular element is the right triangle with vertices , , and . It has area , and every triangular element in a mesh is the image of under an affine map .
Unlike the interval, where Gauss–Legendre quadrature provides an optimal family of rules for any order, the triangle has no single canonical quadrature construction. Instead one uses tabulated symmetric rules whose points and weights respect the three-fold symmetry of the equilateral triangle. Rules for orders 1 through 5 are taken from Dunavant (1985) and other standard sources; the number of quadrature points for each order is 1, 3, 4, 6, and 7.
The figure below shows the point locations for each order. Marker size is proportional to the absolute weight, and colour indicates sign — blue for positive, red for negative.
The order-3 rule is notable: it uses 4 points but one weight is negative. Quadrature rules with negative weights are mathematically valid — the signed sum still converges to the integral — but they can amplify rounding errors, so they are used only where no equally efficient all-positive rule exists. The weights of all rules sum to , the area of the reference triangle.
In the library, these rules are provided by TriangleDomain; its quadrature(order) method returns (points, weights) for the lowest-order rule that integrates polynomials of the requested degree exactly, up to a maximum of order 5.