Compute L^2 and H^1 normsΒΆ

The file getfem/getfem_assembling.h defines the functions to compute L^2 and H^1 norms of a solution. The following functions compute the different norms:

getfem::asm_L2_norm(mim, mf, U);
getfem::asm_H1_semi_norm(mim, mf, U);
getfem::asm_H1_norm(mim, mf, U);

where mim is a getfem::mesh_im used for the integration, mf is a getfem::mesh_fem and describes the finite element method on which the solution is defined, U is the vector of values of the solution on each degree of freedom of mf. The size of U should be mf.nb_dof().

In order to compare two solutions, it is often simpler and faster to use the following function than to interpolate one mesh_fem on another:

getfem::asm_L2_dist(mim, mf1, U1, mf2, U2);
getfem::asm_H1_dist(mim, mf1, U1, mf2, U2);

These functions return the L^2 and H^1 norms of u_1-u_2.

Previous topic

Interpolation of a finite element method on non-matching meshes

Next topic

Compute derivatives

Download

Download GetFEM++

Main documentations

Other resources