Symmetric Interior Penalty for the Poisson Equation

What's new

Prerequisites

Problem statement

We consider the 2D Poisson problem: $$ \Delta u = f(x,y) $$

where $f(x,y) \neq 0$ is an arbitrary function of $x$ and/or $y$. Within this exercise, we are going to investigate the Symmetric Interior Penalty discretization method (SIP) for the Laplace operator

$$a_{\text{sip}}(u,v) = \int_{\Omega} \underbrace{\nabla u \cdot \nabla v}_{\text{Volume\ term}}dV - \oint_{\Gamma \setminus \Gamma_{N }} \underbrace{ M(\nabla u) \cdot n_{\Gamma}J(v) }_{\text{consistency term}} + \underbrace{ M(\nabla v) \cdot \vec{n}_{\Gamma} J(u) }_{\text{symmetry term}} dA + \oint_{\Gamma \setminus \Gamma_{N}} \underbrace{ \eta J(u)J(v) }_{\text{penalty term}} dA$$

Where $M$ shall denote the Mean and $J$ the Jump operator. The use of these fluxes including a penalty term stabilizes the DG-discretization for the Laplace operator.

Solution within the BoSSS framework

First, we initialize the new worksheet; Note:

  1. This tutorial can be found in the source code repository as as sip.ipynb. One can directly load this into Jupyter to interactively work with the following code examples.
  2. In the following line, the reference to BoSSSpad.dll is required. You must either set #r "BoSSSpad.dll" to something which is appropirate for your computer (e.g. C:\Program Files (x86)\FDY\BoSSS\bin\Release\net5.0\BoSSSpad.dll if you installed the binary distribution), or, if you are working with the source code, you must compile BoSSSpad and put it side-by-side to this worksheet file (from the original location in the repository, you can use the scripts getbossspad.sh, resp. getbossspad.bat).

We need the following packages:

BoSSScmdSilent BoSSSexeSilent

Implementation of the SIP fluxes

We are going to implement the SIP-form $$ a{\text{sip}}(u,v) = \int{\Omega} \underbrace{\nabla u \cdot \nabla v}_{\text{volume\ term}}dV

Evaluation of the Poisson operator in 1D

We consider the following problem: $$ \Delta u = 2,\quad -1<x<1,\quad u(-1)=u(1)=0. $$ The solution is $u_{ex}(x) = 1 - x^2$. Since this is quadratic, we can represent it exactly in a DG space of order 2. As usual, we have to set up a grid, a basis and a right-hand-side.:

We now want to calculate the residual after inserting the exact solution as well as a wrong solution. The implementation of the exact solution:

The implementation of a spurious, i.e. a wrong solution; we take the exact solution and add random values in each cell:

Evaluating the Laplace operator using the different solutions:

The matrix of the Poisson Operator

If we do not know the exact solution, we have to solve a linear system. Therefore, we not only need to evaluate the operator, but we need its matrix. The Mapping controls which degree-of-freedom of the DG approximation is mapped to which row, resp. column of the matrix.

We see that the matrix has 27 rows and columns.

Matrix rank and determinant of the matrix

Matrix_SipLaplace: Use the functions rank and det to analyze the matrix (warning: this can get costly for larger matrices!). Interpret the results:

So the matrix of the SIP discretization has a unique solution.

Advanced topics

The penalty parameter of the SIP and stability in 2D

We define a two-dimensional grid:

We are going to choose the PenaltySafety for the SipLaplace from the following list

and compute the condition number as well as the determinate. We consider the example $$ -\Delta u = \pi^2 (a_x^2 + a_y^2)/4 \cos(a_x \pi x/2) \cos(a_y \pi y/2) \text{ with } (x,y) \in (-1,1)^2 $$ and $u = 0$ on the boundary. The exact solution is $u_{Ex}(x,y) = \cos(a_x \pi x/2) \cos(a_x \pi y/2)$, where $a_x$ and $a_y$ must be odd numbers to comply with homogeneous bounary condition.

We check our discretization once more in 2D; the residual should be low, but not exactly (resp. up to $10^{-12}$) since the solution is not polynomial and cannot be fulfilled exactly.

We also check that the matrix is symmetric:

Matrix properties for different penalty factors

Now, we assemble the matrix of the SIP for different PenaltySafety-factors. We also try to solve the linear system using an iterative method.

As Matlab is called multiple times during this command, it can take some minutes until it is done.

Plotting

Plot the number of conjugate gradient iterations versus the PenaltySafety.

Convergence study, indefinite vs. definite.

We are going to solve the SIP-system for different grid resolutions, comparing an insufficient penalty to a penalty which is large enough.

Convergence Plot and Conclusions

The convergence plot should unveil that there is something wrong if the penalty factor is set too low. Unfortunately, it does not, so this is some kind of anti-example; It is in this tutorial anyway to illustrate the difficulties of numerical testing. Interested readers migth check out the source code and try to modify the test BoSSS.Application.SipPoisson.Tests.TestProgram.TestOperatorConvergence3D(2) so that it fails.

The reason why the indefinite matrix still gives a solution convergence is very likely that the solver which is used in BoSSS is also (sometimes) capable of solving singular or close-to-singular systems, i.e. systems without a unique solution. In those cases, it selects a solution with a minimal solution norm. Since BoSSS uses an orthonormal basis the $L^2$ norm of the DG-Field is identical to the $l_2$ norm of the coordinate vector (Parseval's identity). Therefore, the solver by chance adds additional stability which is not part of the (instable) discretization.

While the solution of the indefinite system may look right at the first glance, we see that we do not obtain grid convergence for Error_indef.

The error of the positive definite system, Error_posdef, where the penalty is chosen sufficiently large converges with the expected rate.

Finally, we are going to compute the convergence rate of the SIP discretization.

We compute the slope of the log-log plot:

Visualization of minimal Eigenvectors

An alternative way of identifying problems with the discretization is the investigation of minimal Eigenvalues (in absolute value) and the respective Eigenvectors/Eigensolutions.

This very often unveils stability issues on rather coarse meshes.

For both matrixes (indefinite and positive definite) one can determine the respective Eigenvectors (for the minimal Eigenvalue). Since Eigenvectors represent solution to the matrix for a RHS that is a multiple of the Eigenvector itself, it makes sense to interpret the Eigenvecor as a DG field.

In many cases, the visualization of Eigenvalues unveils spurious solutions, resp. instabilities which are hidden in the operator discretization. Compare the Visualization of both Eigenvectors, e.g. in Tecplot or Visit:

Further reading