Residual adaptation with a uniform-refinement safeguard (source code)

= Residual adaptation with a uniform-refinement safeguard

A reliable residual estimator certifies an error tolerance only when its upper bound is below the tolerance. To ensure eventual termination, residual-based element marking can be combined with occasional global bisection. For one-dimensional piecewise linear reaction-diffusion approximation, $R_h=f+p'u_h'-qu_h$ is bounded in $L^2$ by discrete energy stability, and the weighted estimator is at most $h_{\max}^2\|R_h\|_2$. Thus the safeguard $h_{\max}\to0$ forces the estimator to zero and makes the certified stopping test eventually succeed.