# hp-FEM background¶

The hp-FEM is a modern version of the Finite Element Method (FEM) that is capable of exponential convergence (the approximation error drops exponentially as new degrees of freedom are added during adaptivity) while standard FEM can only attain algebraic (polynomial) convergence rates which are much slower.

In traditional low-order FEM (based on piecewise-linear or piecewise quadratic elements), refining an element is not algorithmically complicated, and so the most difficult part is to find out what elements should be refined. To do this, various techniques ranging from rigorous guaranteed a-posteriori error estimates to heuristic criteria such as residual error indicators or error indicators based on steep gradients are employed. However, these approaches are in general not very well suited for multiphysics coupled problems or higher-order finite element methods

Automatic adaptivity in higher-order finite element methods (hp-FEM) is much different from adaptivity in low-order FEM. Firstly, analytical error estimates capable of guiding adaptive hp-FEM do not exist even for the simplest linear elliptic equations, not speaking about nonlinear multiphysics coupled systems. Secondly, a higher-order element can be refined in many different ways. The number of possible element refinements is implementation dependent. In general it is very low in h-adaptivity and p-adaptivity, and much higher in hp-adaptivity. Moreover, this number grows very fast when anisotropic refinements are enabled.

The number of possible element refinements is implementation dependent. In general it is very low in h-adaptivity and p-adaptivity, and much higher in hp-adaptivity. Moreover, this number grows very fast when anisotropic refinements are enabled.

Many possible refinement candidates for fourth order elements. Copyright 2012 Global Science Press.

## Hermes library¶

Hermes is a free and open-source C++ library that implements higher-order finite elements approximations and adaptive hp-FEM. It supports 8 different adaptivity modes – three isotropic and five anisotropic. Isotropic refinements are h-isotropic (H_ISO), p-isotropic (P_ISO), hp-isotropic (HP_ISO). Anisotropic refinement modes are h-anisotropic (H_ANISO), hp-anisotropic-h (HP_ANISO_H), p-anisotropic (P_ANISO), hp-anisotropic-p (HP_ANISO_P), and hp-anisotropic (HP_ANISO). The eight adaptivity modes are summarized in the following figure.

It must be noted that in case of HP_ANISO_H, only element size is adapted anisotropically whereas polynomial degree is adapted isotropically. The opposite holds true for HP_ANISO_P.

Note that triangular elements do not support anisotropic refinements. Due to the large number of refinement options, classical error estimators that provide a constant error estimate per element, cannot be used to guide automatic hp-adaptivity. For this, one needs to know the shape of the approximation error. Hermes uses a pair of approximations with different orders of accuracy to obtain this information: coarse mesh solution and fine mesh solution. The initial coarse mesh is read from the mesh file, and the initial fine mesh is created through its global refinement both in h and p. The fine mesh solution is the approximation of interest both during the adaptive process and at the end of computation. Global orthogonal projection of the fine mesh solution on the coarse mesh is used to extract the low-order part from the reference solution. The adaptivity algorithm is guided by the difference between the reference solution and its low-order part. Note that this approach to automatic adaptivity is PDE-independent and thus naturally applicable to a large variety of multiphysics coupled problems.

Refinement candidates for every refinement mode for quad type elements. Copyright 2012 Global Science Press.

## Multimesh hp-FEM¶

In multiphysics PDE systems such as Poisson-Nernst-Planck it can happen that one physical field is very smooth where others are not. If all the fields are approximated on the same mesh, then refinements will be present in smooth areas where they are not necessary. This can be very wasteful.

Hermes implements a novel adaptive multimesh hp-FEM that makes it possible to approximate different fields on individual meshes, without breaking the monolithic structure of the coupling mechanism. For practical reasons, the meshes in the system are not allowed to be completely independent – they have a common coarse mesh that we call master mesh. The master mesh is there for algorithmic purposes only and it may not even be used for discretization purposes. Every mesh in the system is obtained from the master mesh via an arbitrary sequence of elementary refinements. Assembling is done on a union mesh, a geometrical union of all meshes in the system (imagine printing all meshes on transparencies and positioning them on top of each other).

The union mesh is not constructed physically in the computer memory – it merely serves as a hint to correctly transform the integration points while integrating over subelements of elements in the existing meshes. As a result, the multimesh discretization of the PDE system is monolithic in the sense that no physics is lost-all integrals in the discrete weak formulations are evaluated exactly up to the error in the numerical quadrature. The exact preservation of the coupling structure of multiphysics coupled problems makes the multimesh hp-FEM very different from various interpolation and projection based methods that suffer from errors made while transferring data between different meshes in the system.

PDF file of the full article Modeling Ionic Polymer-Metal Composites with Space-Time Adaptive Multimesh hp-FEM can be downloaded here