Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
pefarrell committed Jun 26, 2024
1 parent 52d04fe commit 07e0990
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/src/SLEPcEPS/poisson.py.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Solving the Laplace eigenvalue problem using SLEPc EPS
=======================================================

In this tutorial, we explore using `SLEPc EPS` to solve the Laplace eigenvalue problem in different formulations.
We begin considering the Poisson eigenvalue problem in primal form, i.e.
In this tutorial, we explore using `SLEPc EPS` to solve the Laplace eigenvalue problem in primal and mixed formulations.
We begin by considering the Poisson eigenvalue problem in primal form, i.e.

.. math::
Expand All @@ -27,9 +27,9 @@ Such a discretisation can easily be constructed using NGSolve as follows: ::
m = BilinearForm(-1*u*v*dx, symmetric=True)
m.Assemble()

We then proceed to solve the eigenvalue problem using `SLEPc EPS` which is wrapped by ngsPETSc's :code:`EigenSolver` class.
In particular, we will use SLEPc implementation of a locally optimal block preconditioned conjugate gradient.
Notice that we have assembled the mass matrix so that it is symmetric negative definite, this is because ngsPETSc :code:`Eigensolver` requires all eigenvalue problems to be written as a polynomial eigenvalue problem, i.e.
We then proceed to solve the eigenvalue problem using `SLEPc EPS` which is wrapped by ngsPETSc's :code:`EigenSolver` class.
In particular, we will use the SLEPc implementation of locally optimal block preconditioned conjugate gradient.
Notice that we have assembled the mass matrix so that it is symmetric negative definite; this is because ngsPETSc :code:`Eigensolver` requires all eigenvalue problems to be written as a polynomial eigenvalue problem, i.e.

.. math::
A\vec{U} - \lambda M\vec{U} = 0
Expand Down Expand Up @@ -70,10 +70,10 @@ We can discretise this problem using NGSolve as follows: ::
m = BilinearForm(1*u*v*dx)
m.Assemble()

We can then solve the eigenvalue problem using ngsPETSc's `EigenSolver` class.
We can again solve the eigenvalue problem using ngsPETSc's `EigenSolver` class.
The mass matrix now has a large kernel, hence is no longer symmetric positive definite, therefore we can not use LOBPCG as a solver.
Instead, we will use a Krylov-Schur solver with a shift-and-invert spectral transformation to target the smallest eigenvalues.
Notice that because we are using a shift-and-invert spectral transformation we only need to invert the stiffness matrix which has a trivial kernel since we are using an inf-sup discretisation.
Notice that because we are using a shift-and-invert spectral transformation we only need to invert the stiffness matrix which has a trivial kernel since we are using an inf-sup stable discretisation.
If we tried to use a simple shift transformation to target the largest eigenvalues we would have run into the error of trying to invert a singular matrix.::
solver = EigenSolver((m, a), W, 10,
Expand Down

0 comments on commit 07e0990

Please sign in to comment.