Convergence of Finite Element Method

This example is to show the rate of convergence of linear finite element approximation of the Poisson equation on a unit square:

$$- \Delta u = f \; \hbox{in } (0,1)^2, \quad u=g_D \hbox{ on }\Gamma_D,
\quad \nabla u\cdot n=g_N \hbox{ on }\Gamma_N.$$

The data is chosen such that the exact solution $u = \cos(\pi x)\cos(\pi y) - 1$ and $\nabla u\cdot n = 0$ on $\partial \Omega$. Two type of mesh refinements: regular refinement and bisection, and the following two boundary conditions are tested:

  1. Non-empty Dirichlet boundary condition. $\Gamma _D = \{(x,y): x=0, y\in [0,1]\}, \; \Gamma _N = \partial \Omega \backslash \Gamma _D$.
  2. Pure Neumann boundary condition. $\Gamma _N = \partial \Omega$.

Conclusion

Contents

Non-empty Dirichlet boundary condition. Regular refinement.

The optimal rate of convergence of the H1-norm (1st order) and L2-norm (2nd order) is observed. The 2nd order convergent rate between two discrete functions |DuI-Duh| is known as superconvergence.

[N,errL2,errH1,erruIuh] = squarePoisson1;
c = {'Dof','||u-u_h||','||Du-Du_h||','||DuI-Du_h||'};
makeHtmlTable([N errL2 errH1 erruIuh],[],[],c,[],[8 8 8 8]);
Dof||u-u_h||||Du-Du_h||||DuI-Du_h||
80.197927941.50351860.43962712
320.0659128660.83738290.13223755
1280.0179084130.431607280.034847816
5120.00457636520.217511130.0088349807
20480.00115049070.108972230.0022166851
81920.00028802620.0545133050.00055467254
327687.2031833e-050.0272600540.00013869956
1310721.8009539e-050.0136304523.4676855e-05

-------------------------------------------------------------------------

Pure Neumann boundary condition. Regular refinement.

The H1-norm (1st order) is still optimal. But the L2-norm is less optimal (around 1.6). |DuI-Duh| is almost 2nd order. All norms of error are bigger than the first case with non-empty Dirichlet boundary condition.

[N,errL2,errH1,erruIuh] = squarePoisson2;
c = {'Dof','||u-u_h||','||Du-Du_h||','||DuI-Du_h||'};
makeHtmlTable([N errL2 errH1 erruIuh],[],[],c,[],[8 8 8 8]);
Dof||u-u_h||||Du-Du_h||||DuI-Du_h||
80.272708951.42140780.72068057
320.0712928010.813694530.24349312
1280.02352040.426938050.072718733
5120.0080054210.216738280.020371672
20480.00260370260.10904260.0084785408
81920.000811035540.0545194950.0021885057
327680.000244101730.0272605010.00056333267
1310727.1569437e-050.0136304670.00014473916

-------------------------------------------------------------------------

Pure Neumann boundary condition. Bisection.

The H1-norm (1st order) is still optimal and the L2-norm is also optimal. Due to the pattern of the mesh, |DuI-Duh| is only 1st order. No superconvergence. H1- and L2-norms of the error are comparable with the first case with non-empty Dirichlet boundary condition.

[N,errL2,errH1,erruIuh] = squarePoisson3;
c = {'Dof','||u-u_h||','||Du-Du_h||','||DuI-Du_h||'};
makeHtmlTable([N errL2 errH1 erruIuh],[],[],c,[],[8 8 8 8]);
Dof||u-u_h||||Du-Du_h||||DuI-Du_h||
80.121632310.888578010.014388933
320.0710719730.798965810.29112579
1280.0182956880.408255790.14540376
5120.0046074230.205243290.072696839
20480.00115309550.102961680.036909815
81920.000288566520.0514234230.018244916
327687.2160042e-050.0257045010.0090959304
1310721.8041163e-050.0128513480.0045446404

-------------------------------------------------------------------------

Non-empty Dirichlet boundary condition. Bisection.

The H1-norm (1st order) is still optimal and the L2-norm is also optimal. Due to the pattern of the mesh, |DuI-Duh| is only 1st order. No superconvergence. The same conclusion as that for pure Neumann boundary condition. But in the first two meshes, the error in H1 and L2 norm decreases slowly and |DuI-Du_h| is even increase.

[N,errL2,errH1,erruIuh] = squarePoisson4;
c = {'Dof','||u-u_h||','||Du-Du_h||','||DuI-Du_h||'};
makeHtmlTable([N errL2 errH1 erruIuh],[],[],c,[],[8 8 8 8]);
Dof||u-u_h||||Du-Du_h||||DuI-Du_h||
80.118861040.88864671.5700925e-16
320.053386920.827664970.18669992
1280.0140038850.415190080.12385507
5120.00353490940.206962810.067625649
20480.000883059910.103189940.035112728
81920.00022027380.0515051660.017869086
327685.4975595e-050.0257280310.0090112814
1310721.3729927e-050.0128576170.0045246461