Compute and check L2 error
Addresses: #88 (closed)
This is needed for MPIparallel computation. In a parallel setting the partitioning is not always deterministic, so it becomes difficult to generate reference output files to compare against. This introduces a check on the L^2
error norm of the computed solution with respect to the known analytical solution. In particular, for a given computation with refinement level l
we check that the following holds:
\x_lx_\text{ref}\_{L^2} < C'·h_l^2 = C·2^{2·l}

x_l
is the computed solution at refinement levell

x_\text{ref}
is the analytic reference solution 
h_l
is the size of the mesh elements at refinement levell
. For the structured refinement we are using, we haveh_l=2^{l}·h_0
. The exact definition of "size of the element" isn't that important, what is important is that it halves with every step of refinement. 
C
is a parameter that needs to be determined experimentally, such that the above holds for all refinement levelsl
we are interested in. It is usually something like theL^2
error norm at refinement level 0. But it can happen that the error at refinement level 0 is "too good": the above inequality only makes a statement about the upper limit for the error, not the lower limit. In such which caseC
needs to be enlarged artificially to the inequality also holds for the other level we are interested in. 
C'
is just\frac{C}{h_0}
, it is just used to write the right hand side of the inequality in a more familiar form that might be found in a textbook
The square in h_l^2
(or equivalently, the 2 in the exponent in 2^{2·l}
) is actually a property of the finite element scheme we are using. (For Q1 ansatz function you usually have this 2, for Q2 you would have 3, etc. This is the reason why poeple bother with higher order ansatz functions: it allows for much coarser meshes while still keeping the error below a certain level.)