Motivation
A uniform one-dimensional grid makes the first finite-element matrix easy to recognize. Real models often have changing material properties, locally refined meshes, and two-dimensional domains. Copying the uniform tridiagonal stencil into such a problem silently changes the equation. The reliable approach is to return to the weak form, compute each element's contributions, and assemble them according to connectivity.
This section extends the earlier piecewise-linear construction. It separates three errors that a computer calculation can contain: error from restricting the function space, error from approximating integrals, and error from solving the resulting system. Refinement addresses the first only if the solution is regular enough; it can also make the algebraic system harder to solve.
Definitions
Definition 3.2.1
(Diffusion weak problem and conforming approximation)
Let be a bounded polygonal domain and satisfy almost everywhere. For , find such that
A conforming finite-element space is a finite-dimensional subspace of . Its Galerkin solution satisfies the same equation for every test function .
For a triangulation, continuous piecewise-affine functions form such a space when boundary nodal values are zero. Each triangle has three barycentric coordinates: affine functions equal to one at vertex and zero at the other two. Their sum is one. The global hat at a vertex equals its local barycentric coordinate on each adjacent triangle and vanishes away from those triangles. Shared nodal values make the piecewise-affine function continuous across edges.
Main results
Theorem 3.2.2
(Energy projection and coefficient bounds)
Under the stated coefficient bounds, the weak solution and conforming Galerkin solution exist uniquely. With ,
Proof
(Lax–Milgram, orthogonality and a Pythagorean identity)
The coefficient bounds give continuity and coercivity of on using the Poincaré inequality; the load is continuous by Cauchy–Schwarz. Lax–Milgram gives the unique weak solution, and the same coercivity makes the finite-dimensional stiffness matrix positive definite. Subtracting continuous and discrete equations yields for every . For any , expand in the inner product. The cross term vanishes, so the square of the left norm is the sum of two nonnegative squares. Choosing proves the minimum. The final inequalities follow directly from the bounds on inside the integral.
Theorem 3.2.3
(A first-order energy estimate)
Let the triangulations be shape regular, with maximum element diameter , and suppose . With exact integration and continuous piecewise-affine elements,
where is independent of but depends on the shape-regularity bound and domain.
Proof
(Best approximation by the nodal interpolant)
The standard nodal interpolation estimate on shape-regular triangles states . Applying best approximation with and the upper coefficient bound gives . The lower coefficient bound converts this to the displayed gradient estimate. Shape regularity and regularity are hypotheses of the interpolation estimate, not consequences of merely having a mesh. For nonsmooth solutions the displayed rate need not hold.
Proof X-ray
A chain of three inequalities, each with its own hypothesis
The estimate is a chain. First, best approximation in the energy norm lets us replace the unknown by any comparison function; the key move is to choose , a function we never compute but whose error we can bound. This step uses Galerkin orthogonality, symmetry of , which makes the cross term vanish exactly, and exact assembly: quadrature would change or the load and require an extra consistency estimate. Second, the interpolation estimate supplies the factor ; it is the only place where shape regularity and regularity enter, and Galerkin orthogonality by itself gives no rate. Third, the coefficient bounds enter twice, as when is bounded above and as when it is converted back to a gradient norm; this is the origin of the contrast factor .
Worked examples
Worked example 3.2.4
(Nonuniform elements with different materials)
Take nodes with zero endpoint values, on the first element and on the second, and . The single interior stiffness entry is ; the load is . Hence the interior value is . The two element slopes are and . The weighted slopes, and , differ because distributed forcing changes flux across each element; equality of the piecewise constant discrete fluxes at the node is not imposed pointwise by this Galerkin equation. Instead their jump, , equals the nodal load.
Worked example 3.2.5
(One reference triangle)
On the triangle with vertices , the barycentric functions are , , . Their gradients are , , , and the area is . For , the local stiffness and constant-load vectors are
The rows sum to zero because the local basis functions sum to one. This local matrix is singular; global Dirichlet constraints, not a fictitious local inverse, remove the constant mode.
Worked example 3.2.6
(Assembly with an interior vertex)
Split the unit square into four triangles by joining the center to each corner. All boundary vertices have zero values; the center is the only unknown. On each triangle the center hat has height one and vanishes on its opposite boundary edge. Its gradient has magnitude , and each triangle has area . Thus each contributes to the center diagonal, giving for . With , each local center load is area divided by three, , so and the center coefficient is . This is a discrete value; no assertion is made that it equals the exact solution at the center.
Methods and reasoning
Local integrals and global connectivity
For an interval element of length , the local linear basis derivatives are and . Even when varies within the element, exact integration gives
The average coefficient, not necessarily its value at a node, controls this entry. For constant , the local load is . If or is integrated approximately, record the quadrature rule; insufficient quadrature can alter positivity or accuracy.
On a triangle with vertices and area , are affine and their gradients are constant. For example, with cyclic indices and a consistently signed doubled area , . Using absolute area for integration, . The signed denominator must follow the vertex orientation; the physical area in the integral is positive. Degenerate triangles have zero area and do not define an affine element.
A connectivity table maps each local vertex to a global degree of freedom. For every triangle, add its nine stiffness entries and three load entries into the associated global positions. A shared vertex receives contributions from every incident element. For a prescribed boundary value , partition into interior and boundary blocks: . With homogeneous values , this reduces to the interior block. Simply discarding a nonzero boundary column without moving its contribution changes the problem.
Concept lensAlgebraic
The stiffness matrix as a weighted product of discrete gradients
For piecewise-affine functions the gradient is constant on each triangle. Let map a nodal vector to the stacked element gradients, two entries per triangle, and let be block diagonal with blocks . Then , so
Symmetry and positive semidefiniteness are immediate, and gives the zero row sums. On a connected mesh only for constant , so imposing zero boundary values removes the null space.
Geometry, regularity, and approximation
Shape regularity rules out triangles becoming arbitrarily flat as the mesh is refined; it does not require every element to have the same size. A local refinement can therefore concentrate degrees of freedom near a feature while retaining meaningful interpolation constants. The maximum diameter controls the simple global estimate above. A sharper local estimate uses element diameters and local derivatives; it can explain why refinement near a singularity helps, but its proof and mesh design require additional work.
The assumption may fail at reentrant corners, at material interfaces, or for rough data. The energy formulation can still have a unique solution, while the first-order estimate no longer follows. Likewise, pointwise errors do not follow directly from an energy bound in two dimensions. Comparing solutions on successive meshes is useful evidence, but agreement alone cannot prove a claimed rate or exclude a shared modeling error.
Conditioning and a practical workflow
For a uniform one-dimensional mesh with equal subintervals, the Dirichlet stiffness matrix is . Its eigenvalues are , , giving a condition number of order . The discrete space improves as decreases, but an unpreconditioned solve becomes more sensitive and may need more iterations. This scaling is a specific uniform-mesh result, not an exact formula for every nonuniform or two-dimensional mesh.
A practical calculation proceeds by stating the PDE and boundary conditions; checking mesh orientation and connectivity; assembling element matrices and loads; imposing boundary values; solving the reduced system; and checking residuals and units. Test a manufactured solution by computing its forcing and boundary data analytically, then measure error on several meshes. Use a quadrature rule accurate enough for the integrands, and separate algebraic error from mesh error. If uses an approximate coefficient vector, the triangle inequality gives . A tiny residual cannot by itself certify the first term.
A check on element geometry
The reference triangle is not the only triangle that can be integrated explicitly. If an affine map carries the reference triangle to a physical triangle, its area scales by , and the gradient transforms by . Both factors are required: using the physical area with an untransformed reference gradient gives the wrong stiffness matrix. As a check, a uniform scaling of a two-dimensional triangle by a factor multiplies area by and each gradient by , leaving the local stiffness unchanged for constant ; a constant load vector instead scales by . The argument assumes is invertible and does not extend to a collapsed element.
Shape regularity is the hypothesis that keeps the interpolation constant under control when triangles are not merely rescaled but flattened.
Counterexample mode
Flat triangles break the interpolation estimate
Claim: on every triangle of diameter , with independent of the shape of . Take with vertices , , , , and . The interpolant takes the values , so and the -component of is . Since ,
because and the only nonzero second derivative is . The ratio is at least , which is unbounded as . This family is not shape regular: its inscribed radius is about , so diameter over inradius grows like . The estimate holds with a uniform constant only under a shape-regularity bound.
Common misconceptions
Common mistake
(Inverting a local element matrix)
A local element stiffness matrix has the constant vector in its null space, because the local basis functions sum to one; the reference matrix above is singular. The assembled Dirichlet matrix is positive definite only after boundary values are imposed globally. A local matrix should be added into the global system, not inverted.
Common mistake
(Refining to repair a modeling error)
A finer mesh reduces the approximation error of the problem that was assembled. If geometry, loads, boundary conditions or quadrature are wrong, refinement converges to the solution of the wrong problem and does not automatically improve the result.
Common mistake
(Expecting optimality in every norm)
The discrete solution is optimal in the energy norm for the exact conforming symmetric problem. It is not generally the best approximation pointwise or in ; for in one dimension, equals the nodal interpolant, which lies below on every element, so adding a small positive multiple of an interior hat function lowers the error.
Quick check
Quick check
(Why do local stiffness rows sum to zero?)
Consider the sum of the local basis functions.
Solution · Answer
The local basis functions sum to the constant one, whose gradient vanishes, so . This identity is a useful assembly check, but it does not replace enforcing global boundary conditions.
Exercises
Quick check
(On with nodes , , and zero endpoint values, compute the interior Galerkin coefficient.)
Solution · Answer
The stiffness is and the load is , so .
Quick check
(On the reference triangle in the example, calculate and explain the result.)
Solution · Answer
Every row of sums to zero, hence the product is the zero vector. The nodal vector represents the constant function, whose gradient and element energy vanish.
Quick check
(For the four-triangle square mesh, change the constant load to . Compute the interior coefficient.)
Solution · Answer
The stiffness is still . The load is six times , namely , so the interior value is .
Quick check
(Explain why an energy convergence estimate cannot be concluded solely from a small linear-system residual. Identify two independent error sources.)
Solution · Answer
The residual tests the solved discrete equations. Even an exact discrete solve may differ from the weak solution because cannot represent it; approximate quadrature adds a consistency error. An incomplete linear solve adds a third, algebraic error. Each needs its own estimate or check.
Further study
Higher-order elements, mixed formulations, rigorous a posteriori estimators, adaptive convergence, anisotropic meshes and efficient preconditioning remain open topics. The estimates here assume exact integration and do not establish an error rate for every geometry or coefficient.