Reference documentation for deal.II version Git e7c9a24 2019-02-08 08:26:19 +0100
Namespaces | Classes | Enumerations
Numerical algorithms




class  KellyErrorEstimator< dim, spacedim >
class  SolutionTransfer< dim, VectorType, DoFHandlerType >
struct  SolutionTransfer< dim, VectorType, DoFHandlerType >::Pointerstruct


enum  KellyErrorEstimator< dim, spacedim >::Strategy { KellyErrorEstimator< dim, spacedim >::cell_diameter_over_24 = 0, KellyErrorEstimator< dim, spacedim >::face_diameter_over_twice_max_degree, KellyErrorEstimator< dim, spacedim >::cell_diameter }
enum  SolutionTransfer< dim, VectorType, DoFHandlerType >::PreparationState { SolutionTransfer< dim, VectorType, DoFHandlerType >::none, SolutionTransfer< dim, VectorType, DoFHandlerType >::pure_refinement, SolutionTransfer< dim, VectorType, DoFHandlerType >::coarsening_and_refinement }
enum  VectorTools::NormType {
  VectorTools::mean, VectorTools::L1_norm, VectorTools::L2_norm, VectorTools::Lp_norm,
  VectorTools::Linfty_norm, VectorTools::H1_seminorm, VectorTools::Hdiv_seminorm, VectorTools::H1_norm,
  VectorTools::W1p_seminorm, VectorTools::W1p_norm, VectorTools::W1infty_seminorm, VectorTools::W1infty_norm

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.

Some of the classes, like DerivativeApproximation, KellyErrorEstimator and SolutionTransfer, act on solutions already obtained, and compute derived quantities in the first two cases, or help transferring a set of vectors from one mesh to another.

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.

Enumeration Type Documentation

template<int dim, int spacedim = dim>
enum KellyErrorEstimator::Strategy

The enum type given to the class functions to decide on the scaling factors of the face integrals.


Kelly error estimator with the factor \(\frac {h_K}{24}\).


the boundary residual estimator with the factor \(\frac {h_F}{2 //! max(p^+,p^-)}\).


Kelly error estimator with the factor \(h_K\).

Definition at line 266 of file error_estimator.h.

template<int dim, typename VectorType = Vector<double>, typename DoFHandlerType = DoFHandler<dim>>
enum SolutionTransfer::PreparationState

Declaration of PreparationState that denotes the three possible states of the SolutionTransfer: being prepared for 'pure refinement', prepared for 'coarsening and refinement' or not prepared.


The SolutionTransfer is not yet prepared.


The SolutionTransfer is prepared for purely refinement.


The SolutionTransfer is prepared for coarsening and refinement.

Definition at line 490 of file solution_transfer.h.

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)|. \]


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

\[ E_K = \int_K \sum_c (\hat{f}_c - f_c) \, w_c = \int_K \sum_c e_c \, w_c \]

and summed up to get

\[ E = \sum_K E_K = \int_\Omega \sum_c (\hat{f}_c - f_c) \, w_c \]

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

\[ E = \int_\Omega (\hat{f} - f) = \int_\Omega e. \]

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\).


The absolute value of the function is integrated:

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


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

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

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


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

\[ E_K = \sqrt{ \int_K \sum_c e_c^2 \, w_c } \]


\[ E = \sqrt{\sum_K E_K^2} = \sqrt{ \int_\Omega \sum_c e_c^2 \, w_c } \]

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

\[ E = \sqrt{ \int_\Omega e^2 } = \| e \|_{L^2} \]


The absolute value to the \(p\)-th power is integrated and the \(p\)-th root is computed on each cell. The exponent \(p\) is the exponent argument of integrate_difference() and compute_mean_value():

\[ E_K = \left( \int_K \sum_c |e_c|^p \, w_c \right)^{1/p} \]


\[ E = \left( \sum_K E_K^p \right)^{1/p} \]

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

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


The maximum absolute value of the function:

\[ E_K = \sup_K \max_c |e_c| \, w_c \]


\[ E = \max_K E_K = \sup_\Omega \max_c |e_c| \, w_c \]

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

\[ E = \sup_\Omega \|e\|_\infty = \| e \|_{L^\infty}. \]


L2_norm of the gradient:

\[ E_K = \sqrt{ \int_K \sum_c (\nabla e_c)^2 \, w_c } \]


\[ E = \sqrt{\sum_K E_K^2} = \sqrt{ \int_\Omega \sum_c (\nabla e_c)^2 \, w_c } \]

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

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


L2_norm of the divergence of a vector field. The function \(f\) is expected to have \(c \geq \text{dim}\) components and the first dim will be used to compute the divergence:

\[ E_K = \sqrt{ \int_K \left( \sum_c \frac{\partial e_c}{\partial x_c} \, \sqrt{w_c} \right)^2 } \]


\[ E = \sqrt{\sum_K E_K^2} = \sqrt{ \int_\Omega \left( \sum_c \frac{\partial e_c}{\partial x_c} \, \sqrt{w_c} \right)^2 } \]

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

\[ E = \| \nabla \cdot e \|_{L^2}. \]


The square of this norm is the square of the L2_norm plus the square of the H1_seminorm:

\[ E_K = \sqrt{ \int_K \sum_c (e_c^2 + (\nabla e_c)^2) \, w_c } \]


\[ E = \sqrt{\sum_K E_K^2} = \sqrt{ \int_\Omega \sum_c (e_c^2 + (\nabla e_c)^2) \, w_c } \]

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

\[ E = \left( \| e \|_{L^2}^2 + \| \nabla e \|_{L^2}^2 \right)^{1/2}. \]


Lp_norm of the gradient:

\[ E_K = \left( \int_K \sum_c |\nabla e_c|^p \, w_c \right)^{1/p} \]


\[ E = \left( \sum_K E_K^p \right)^{1/p} = \left( \int_\Omega \sum_c |\nabla e_c|^p \, w_c \right)^{1/p} \]

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

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


The same as the H1_norm but using Lp:

\[ E_K = \left( \int_K \sum_c (|e_c|^p + |\nabla e_c|^p) \, w_c \right)^{1/p} \]


\[ E = \left( \sum_K E_K^p \right)^{1/p} = \left( \int_\Omega \sum_c (|e_c|^p + |\nabla e_c|^p) \, w_c \right)^{1/p} \]

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

\[ E = \left( \| e \|_{L^p}^p + \| \nabla e \|_{L^p}^p \right)^{1/p}. \]


Linfty_norm of the gradient:

\[ E_K = \sup_K \max_c |\nabla e_c| \, w_c \]


\[ E = \max_K E_K = \sup_\Omega \max_c |\nabla e_c| \, w_c \]

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

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


The sum of Linfty_norm and W1infty_seminorm:

\[ E_K = \sup_K \max_c |e_c| \, w_c + \sup_K \max_c |\nabla e_c| \, w_c. \]

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\)):

\[ E = \| e \|_{L^\infty} + \| \nabla e \|_{L^\infty}. \]

Definition at line 360 of file vector_tools.h.