Detailed Description

This module groups a diverse set of classes that generally implement some sort of numerical algorithm on top all the basic triangulation, DoFHandler, and finite element classes in the library. They are generally unconnected to each other.

The namespaces MatrixCreator, MatrixTools, and VectorTools provide an assortment of services, such as creating a Laplace matrix, projecting or interpolating a function onto the present finite element space, etc. The difference to the functions in the DoFTools and FETools functions is that they work on vectors (i.e. members of a finite element function space on a given triangulation) or help in the creation of it. On the other hand, the DoFTools functions only act on a given DoFHandler object without reference to a data vector, and the FETools objects generally work with finite element classes but again without any associated data vectors.

Denote which norm/integral is to be computed by the integrate_difference() function on each cell and compute_global_error() for the whole domain. Let \(f:\Omega \rightarrow \mathbb{R}^c\) be a finite element function with \(c\) components where component \(c\) is denoted by \(f_c\) and \(\hat{f}\) be the reference function (the fe_function and exact_solution arguments to integrate_difference()). Let \(e_c = \hat{f}_c - f_c\) be the difference or error between the two. Further, let \(w:\Omega \rightarrow \mathbb{R}^c\) be the weight function of integrate_difference(), which is assumed to be equal to one if not supplied. Finally, let \(p\) be the exponent argument (for \(L_p\)-norms).

In the following,we denote by \(E_K\) the local error computed by integrate_difference() on cell \(K\), whereas \(E\) is the global error computed by compute_global_error(). Note that integrals are approximated by quadrature in the usual way:

\[ \int_A f(x) dx \approx \sum_q f(x_q) \omega_q. \]

Similarly for suprema over a cell \(T\):

\[ \sup_{x\in T} |f(x)| dx \approx \max_q |f(x_q)|. \]

Enumerator

mean

The function or difference of functions is integrated on each cell \(K\):

Note: This differs from what is typically known as the mean of a function by a factor of \(\frac{1}{|\Omega|}\). To compute the mean you can also use compute_mean_value(). Finally, pay attention to the sign: if \(\hat{f}=0\), this will compute the negative of the mean of \(f\).

L1_norm

The absolute value of the function is integrated:

\[ E_K = \int_K \sum_c |e_c| \, w_c \]

and

\[ E = \sum_K E_K = \int_\Omega \sum_c |e_c| w_c, \]

or, for \(w \equiv 1\):

\[ E = \| e \|_{L^1}. \]

L2_norm

The square of the function is integrated and the square root of the result is computed on each cell:

The global norm is not implemented in compute_global_error(), because it is impossible to compute the sum of the global norms from the values \(E_K\). As a work-around, you can compute the global Linfty_norm and W1infty_seminorm separately and then add them to get (with \(w \equiv 1\)):