2
NAME: Error analysis (@PAKAGE@-@VERSION@)
3
\cindex{error analysis}
6
Since the solution $u$ is regular, the following error estimates
9
\Vert u - u_h \Vert_{0,2,\Omega} \approx {\cal O}(h^{k+1})
12
\Vert u - u_h \Vert_{0,\infty,\Omega} \approx O(h^{k+1})
14
providing the approximate solution $u_h$ uses
15
$P_k$ continuous finite element method, $k \geq 1$.
16
Here, $\Vert.\Vert_{0,2,\Omega}$ and $\Vert.\Vert_{0,\infty,\Omega}$
17
denotes as usual the $L^2(\Omega)$ and $L^\infty(\Omega)$ norms.
19
By denoting $\pi_h$ the Lagrange interpolation operator,
20
the triangular inequality leads to:
22
\Vert u - u_h \Vert_{0,2,\Omega}
24
\Vert u - \pi_h u \Vert_{0,2,\Omega}
26
\Vert u_h - \pi_h u \Vert_{0,2,\Omega}
28
Since $\Vert u - \pi_h u \Vert_{0,2,\Omega} \approx O(h^{k+1})$,
29
we have just to check the $\Vert u_h - \pi_h u \Vert_{0,2,\Omega}$
35
//<dirichlet-nh-error:
36
#include "rheolef/rheolef.h"
39
Float u (const point& x) { return sin(x[0]+x[1]+x[2]); }
41
int main(int argc, char**argv)
45
space Vh = u_h.get_space();
46
field pi_h_u = interpolate(Vh, u);
47
field eh = pi_h_u - u_h;
48
form m(Vh, Vh, "mass");
49
cout << "error_inf " << eh.max_abs() << endl;
50
cout << "error_l2 " << sqrt(m(eh,eh)) << endl;
53
//>dirichlet-nh-error:
54
/*P:dirichlet-nh-error
56
Remarks on step~(b) the use of the \code{get\_space} member
58
Thus, the previous implementation does not depend upon
59
the degree of the polynomial approximation.
61
After compilation, run the code by using the command:
63
dirichlet-nh square-h=0.1.geo P1 | dirichlet-nh-error
66
The two errors in $L^\infty$ and $L^2$ are printed
67
for a $h=0.1$ quasi-uniform mesh.
69
Let $nelt$ denotes the number of elements in the mesh.
70
Since the mesh is quasi-uniform, we have
71
$h \approx nelt^{\frac{1}{N}}$. Here $N=2$ for our
73
The figure~\ref{fig-dirichlet-nh-err} plots in logarithmic scale the
74
error versus $nelt^{\frac{1}{2}}$
75
for both $P_1$ (on the left) and $P_2$ (on the right)
78
% latex2html does not support tabular in figures yet...
82
\hbox to -4cm {\hss} \input{demo2-P1-uniform.tex}
84
\hbox to -4cm {\hss} \input{demo2-P2-uniform.tex}
87
\caption{Error analysis in $L^2$ and $L^\infty$ norms.}
88
\label{fig-dirichlet-nh-err}