Remove everything a linear element can reproduce
Let \(\widehat K\) be a fixed triangle and \(\widehat I\) its affine nodal interpolant. In two dimensions point evaluation is continuous on \(H^2(\widehat K)\), so \(\widehat I:H^2\to H^1\) is bounded. Choose an affine \(p\) to match the means of \(\nabla u\) and of \(u\) on the triangle. Apply the Poincaré inequality first to the two components of \(\nabla(u-p)\), then to \(u-p\). This bounds the whole \(H^2\) norm of \(u-p\) by a constant times the \(L^2\) norm of the second derivatives. Since \((I-\widehat I)p=0\),
This argument is the affine case of polynomial approximation by a seminorm. No constant in it depends on the eventual mesh. Choosing nodal values would require extra care for rougher solutions for which point evaluation is undefined.
Transform derivatives and area separately
Let \(F(\xi)=B\xi+b\) map the reference triangle onto \(K\). Physical gradients are \(B^{-T}\) times reference gradients. Pulling back second derivatives produces two factors of \(B\). The square-root determinant factors from integrating and undoing the map cancel in the resulting estimate:
A shape-regular family has uniformly bounded \(\|B\|\|B^{-1}\|\) and element diameter comparable to \(\|B\|\). Thus the right side is \(Ch_K|u|_{H^2(K)}\). For a triangle with legs \(h\) and \(h^2\) the general bound gives order one for its coefficient, since \(\|B^{-1}\|\simeq h^{-2}\). This shows where the guarantee is lost. Some thin triangles and specially oriented solutions still interpolate accurately.
Use Galerkin orthogonality to turn approximation into a PDE estimate
For homogeneous Dirichlet diffusion with \(0<\kappa_{\min}\le\kappa(x)\le\kappa_{\max}\), set \(a(v,w)=\int\kappa\nabla v\cdot\nabla w\). The conforming Galerkin solution satisfies \(a(u-u_h,v_h)=0\). Write \(e=u-u_h\). Then \(\|e\|_a^2=a(e,u-I_hu)\le\|e\|_a\|u-I_hu\|_a\). Summing squared local bounds gives \(\|e\|_a\le Ch\sqrt{\kappa_{\max}}|u|_{H^2}\). Here \(u\in H^2\), boundary conformity and accurate assembly are substantive assumptions.
For the mean-square error solve the dual problem \(a(v,z)=(v,e)\) with the same boundary conditions. If it satisfies the regularity estimate \(\|z\|_{H^2}\le C_{\rm reg}\|e\|_{L^2}\), then
Divide by \(\|e\|_{L^2}\) to obtain the extra power of \(h\). A reentrant corner or a coefficient interface can obstruct this regularity. Use the actual energy or output norm in the convergence study.
Why can a bad cell evade an affine patch test?
Every nonsingular triangle, including a very thin one, exactly reproduces an affine function. Such a patch tests assembly and transformation consistency. Curved test functions in several orientations are needed to expose geometry-dependent interpolation errors.

Tutorial on local and global accuracy
Compute the interpolation error on a right reference triangle
Work through the solution
For \(u=x^2\) on vertices \((0,0),(h,0),(0,h)\), \(I_Ku=h x\). The squared energy error for unit diffusion is \(\int_0^h(2x-h)^2(h-x)\,dx=h^4/6\). On a family of similar cells the local energy error scales like \(h^2\); the sum of squared errors over \(O(h^{-2})\) cells scales like \(h^2\).
Choose a mesh test for a collapsing angle
Work through the solution
Compare a uniformly refined mesh to one containing triangles with \(B\) singular values \(h,h^2\). Record the largest \(\|B\|\|B^{-1}\|\), solution and energy errors, and compare to the local scaled bounds. Growth of a bound alone does not prove a particular solution diverges. Rotate the test Hessian to probe whether the poor direction couples to curvature.
Brenner and Scott · finite element approximation
Change parameters · Following the error from one reference triangle to an entire mesh
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Open this calculation with adjustable inputs
Download the executed OneSimulation notebook · Python source
The notebook reproduces the reference case and exposes the mesh or geometry parameters. Its saved output below comes from the actual OneSimulation solver.
"""Inspect shape-dependent interpolation error with a OneSimulation dense solve."""
import argparse
import matplotlib.pyplot as plt
import numpy as np
from onesim.numerics.linear.matrices.dense_linear_algebra import solve_dense
def experiment(base=0.5, ratio=0.25):
if base <= 0 or ratio <= 0:
raise ValueError("Base and altitude/base ratio must be positive")
altitude = base * ratio
vertices = np.array([[0., 0.], [base, 0.], [base/2, altitude]])
# The affine interpolation coefficients reproduce the three nodal values.
vandermonde = np.column_stack((np.ones(3), vertices))
coefficients = solve_dense(vandermonde, vertices[:, 0]**2)
expected = np.array([0., base, -base**2/(4*altitude)])
np.testing.assert_allclose(coefficients, expected, atol=2e-14)
gradient_error = np.sqrt(base*altitude/2 * (base**2/6 + base**4/(16*altitude**2)))
print(f"Affine coefficients: {coefficients}")
print(f"L2 norm of gradient error: {gradient_error:.8f}")
barycentric = np.array([(i/30, j/30) for i in range(31) for j in range(31-i)])
points = np.column_stack((base*(barycentric[:, 0]+barycentric[:, 1]/2), altitude*barycentric[:, 1]))
exact = points[:, 0]**2
linear = coefficients[0] + points @ coefficients[1:]
fig = plt.figure(figsize=(10, 4.4), layout="constrained")
ax = fig.add_subplot(121, projection="3d")
ax.plot_trisurf(points[:, 0], points[:, 1], exact, color="#a6c8be", alpha=.8)
for fraction in np.linspace(0, 1, 9):
y = altitude*fraction
x = np.linspace(base*fraction/2, base*(1-fraction/2), 40)
ax.plot(x, np.full_like(x, y), coefficients[0]+coefficients[1]*x+coefficients[2]*y,
color="#ad491d", lw=1)
ax.set(xlabel="x", ylabel="y", zlabel="Scalar field u", title="Exact surface and affine interpolant")
error = fig.add_subplot(122)
ratios = np.geomspace(.02, 1, 100)
error.loglog(ratios, base/(4*ratios), label="Spurious transverse gradient")
error.scatter(ratio, abs(coefficients[2]), color="#ad491d")
error.set(xlabel="Altitude / base", ylabel="Magnitude of transverse gradient")
error.legend()
fig.savefig("complete-numerics-triangle.png", dpi=170)
return coefficients, gradient_error
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--base", type=float, default=.5)
parser.add_argument("--ratio", type=float, default=.25)
args, _ = parser.parse_known_args()
experiment(args.base, args.ratio)
plt.show()
Affine coefficients: [ 0. 0.5 -0.5] L2 norm of gradient error: 0.09547033
