Series: Finite Element Method

Reference Domains and Quadrature

Computing the element stiffness matrices and load vectors from the previous post requires evaluating integrals over each element TeT_e. 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 T^\hat{T} under a mapping Fe:T^TeF_e : \hat{T} \to T_e. Shape functions and quadrature rules are defined once on T^\hat{T} and then pulled back to the physical element through FeF_e.

The reference domain for each element type is a standard, convenient geometric shape. A line element maps to the interval [0,1][0, 1], a triangle to the right triangle with vertices (0,0)(0,0), (1,0)(1,0), (0,1)(0,1), and so on.

Integrals over T^\hat{T} are evaluated numerically by quadrature: a rule of order pp consists of QQ sample points x^1,,x^QT^\hat{x}_1, \ldots, \hat{x}_Q \in \hat{T} and associated weights w1,,wQw_1, \ldots, w_Q such that

T^f(x^)dx^q=1Qwqf(x^q),\int_{\hat{T}} f(\hat{x})\, \mathrm{d}\hat{x} \approx \sum_{q=1}^{Q} w_q\, f(\hat{x}_q),

with the approximation being exact whenever ff is a polynomial of degree at most pp. 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: