Back to Finite Element (MFEM)
mfem.gridfunction.computeError
Computes the L2 error between a grid function and a constant exact solution.
Syntax
mfem.gridfunction.computeError(gf, exactValue)
Description
Computes the L2 error between a grid function and a constant exact solution. The L2 error is defined as: ``` ||u - u_exact||_L2 = sqrt( ∫_Ω |u(x) - u_exact|² dx ) ``` This is useful for verifying solutions against known manufactured solutions or for convergence studies.
Parameters
| Name | Description |
|---|---|
| gf | - GridFunction (numerical solution) |
| exactValue | - The constant exact solution value |
Returns
number