Reference Domains and Quadrature
Computing the element stiffness matrices and load vectors from the previous post requires evaluating integrals over each element . In a general mesh the elements can differ in position, size, and orientation, so it is impractical to design shape functions and integration rules separately for each one. Instead, every element of a given type is treated as the image of a single fixed reference domain under a mapping . Shape functions and quadrature rules are defined once on and then pulled back to the physical element through .
The reference domain for each element type is a standard, convenient geometric shape. A line element maps to the interval , a triangle to the right triangle with vertices , , , and so on.
Integrals over are evaluated numerically by quadrature: a rule of order consists of sample points and associated weights such that
with the approximation being exact whenever is a polynomial of degree at most . Given a required polynomial degree, one selects a rule with enough points to integrate it exactly.
In the library, each reference domain is represented by the ReferenceDomain
class in refdomains/refdomain.py, with a
concrete subclass for each element type. Its quadrature(order) method returns
the pair (points, weights) for the requested degree, where points has shape
(Q, topological_dimension) and weights has shape (Q,).
Each element type has a dedicated post describing its reference domain and quadrature rules: