The animations below show meshes produced by the adaptive loop in HAZmath:
solve→estimate→mark→refine
Examples: Laplace equation · Curl-curl equation · Laplace equation on the L-shaped domain
Linear (P1) finite elements for
\[ -\Delta u = 1 \ \text{ in } \Omega, \qquad u = 0 \ \text{ on } \partial\Omega. \]
The error estimator is the a posteriori estimator by preconditioning (local problems on vertex patches):
Y. Li and L. Zikatanov, A posteriori error estimates of finite element methods by preconditioning, Comput. Math. Appl. 91 (2021), 192–201, doi:10.1016/j.camwa.2020.08.001.
Error \(\mathrm{err} = \|\nabla(u-u_h)\|\) and estimator \(\eta\) on the adaptive meshes (\(N\) = number of degrees of freedom). The ratio \(\eta/\mathrm{err}\) stays between 1.04 and 1.20, and both \(\mathrm{err}\) and \(\eta\) decay like the optimal rate \(\sim N^{-1/3}\).
| stage | 0 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| \(N\) | 117 | 218 | 477 | 904 | 1,917 | 4,280 | 8,762 | 20,478 | 41,865 | 93,612 | 203,774 |
| err | 0.348 | 0.281 | 0.225 | 0.188 | 0.142 | 0.111 | 0.0848 | 0.0656 | 0.0493 | 0.0377 | 0.0289 |
| \(\eta\) | 0.361 | 0.309 | 0.245 | 0.203 | 0.158 | 0.125 | 0.0956 | 0.0749 | 0.0568 | 0.0438 | 0.0345 |
| \(N^{1/3}\eta\) | 1.77 | 1.86 | 1.92 | 1.96 | 1.96 | 2.03 | 1.97 | 2.05 | 1.97 | 1.99 | 2.03 |
| \(\eta/\mathrm{err}\) | 1.04 | 1.10 | 1.09 | 1.08 | 1.11 | 1.13 | 1.13 | 1.14 | 1.15 | 1.16 | 1.20 |
The error is computed from \(\mathrm{err}^2 = (f,u) - (f,u_h)\), with \((f,u) \approx 0.39791\) extrapolated from the values \((f,u_h)\) on the adaptive meshes. The table stops at \(N = 203{,}774\).
Lowest order Nédélec edge elements for
\[ \nabla\times\nabla\times u + u = f \ \text{ in } \Omega, \qquad f = (1,1,1), \qquad u\times n = 0 \ \text{ on } \partial\Omega. \]
The error estimator is the robust residual estimator from:
Y. Li and L. Zikatanov, Nodal auxiliary a posteriori error estimates, Math. Comp. 96 (2027), 47–75, doi:10.1090/mcom/4141.
Error \(\mathrm{err}^2 = \|\nabla\times(u-u_h)\|^2 + \|u-u_h\|^2\) and estimator \(\eta\) on the adaptive meshes (\(N\) = number of degrees of freedom). The ratio \(\eta/\mathrm{err}\) stays between 7.97 and 8.61, and both \(\mathrm{err}\) and \(\eta\) decay like the optimal rate \(\sim N^{-1/3}\).
| stage | 0 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 19 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| \(N\) | 260 | 752 | 1,694 | 4,744 | 10,420 | 24,024 | 53,972 | 112,687 | 264,724 | 588,791 | 831,650 |
| err | 0.537 | 0.431 | 0.327 | 0.255 | 0.188 | 0.151 | 0.116 | 0.0876 | 0.0683 | 0.0511 | 0.0445 |
| \(\eta\) | 4.53 | 3.63 | 2.63 | 2.10 | 1.55 | 1.22 | 0.971 | 0.706 | 0.577 | 0.439 | 0.373 |
| \(N^{1/3}\eta\) | 28.9 | 33.0 | 31.4 | 35.3 | 33.9 | 35.2 | 36.7 | 34.1 | 37.1 | 36.8 | 35.1 |
| \(\eta/\mathrm{err}\) | 8.44 | 8.41 | 8.06 | 8.25 | 8.22 | 8.10 | 8.35 | 8.06 | 8.46 | 8.61 | 8.39 |
The error is computed from \(\mathrm{err}^2 = (f,u) - (f,u_h)\), with \((f,u) \approx 1.9887\) extrapolated from the values \((f,u_h)\) on adaptive and uniformly refined meshes. The table stops at \(N = 831{,}650\).
Linear (P1) finite elements on the L-shaped domain \(\Omega = (-1,1)^2\setminus[0,1]^2\) for
\[ -\Delta u = 0 \ \text{ in } \Omega, \qquad u = r^{2/3}\sin\left(\tfrac{2}{3}\left(\theta-\tfrac{\pi}{2}\right)\right) \ \text{ on } \partial\Omega, \]
whose exact solution is \(u = r^{2/3}\sin\left(\tfrac{2}{3}\left(\theta-\tfrac{\pi}{2}\right)\right)\), singular at the re-entrant corner. The error estimator and the marking are as in the Laplace example above.
Error \(\mathrm{err} = \|\nabla(u-u_h)\|\) and estimator \(\eta\) on the adaptive meshes (\(N\) = number of degrees of freedom). The ratio \(\eta/\mathrm{err}\) stays between 1.22 and 1.44, and both \(\mathrm{err}\) and \(\eta\) decay like the optimal rate \(\sim N^{-1/2}\).
| stage | 0 | 3 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| \(N\) | 21 | 31 | 69 | 171 | 407 | 1,028 | 2,504 | 5,962 | 14,014 | 32,415 | 74,982 |
| err | 0.291 | 0.190 | 0.116 | 0.0726 | 0.0448 | 0.0276 | 0.0174 | 0.0111 | 0.00718 | 0.00469 | 0.00307 |
| \(\eta\) | 0.356 | 0.250 | 0.155 | 0.0996 | 0.0623 | 0.0389 | 0.0247 | 0.0158 | 0.0103 | 0.00673 | 0.00442 |
| \(N^{1/2}\eta\) | 1.63 | 1.39 | 1.29 | 1.30 | 1.26 | 1.25 | 1.24 | 1.22 | 1.22 | 1.21 | 1.21 |
| \(\eta/\mathrm{err}\) | 1.22 | 1.32 | 1.33 | 1.37 | 1.39 | 1.41 | 1.42 | 1.43 | 1.43 | 1.44 | 1.44 |
The error is computed from the exact solution. The boundary data are not zero, and \(u_h\) takes the nodal values of \(u\) on \(\partial\Omega\). The table stops at \(N = 74{,}982\).
Acknowledgement. The example drivers, the computations, and the animations on this page were prepared with the help of Claude Opus 5.5 (Anthropic).