| 1 |
|
| 2 |
This demo illustrates how to: |
| 3 |
|
| 4 |
* Load a mesh from a file |
| 5 |
* Solve an eigenvalue problem |
| 6 |
* Use a specific linear algebra backend (PETSc) |
| 7 |
* Initialize a finite element function with a coefficient vector |
| 8 |
|
| 9 |
Problem definition |
| 10 |
------------------ |
| 11 |
|
| 12 |
Sometimes one wants to solve an eigenvalue problem such as this one: |
| 13 |
find the eigenvalues :math:`\lambda \in \mathbb{R}` and the |
| 14 |
corresponding eigenvectors :math:`x \in \mathbb{R}^n` such that |
| 15 |
|
| 16 |
.. math:: |
| 17 |
|
| 18 |
A x = \lambda x. |
| 19 |
|
| 20 |
In the finite element world, the matrix :math:`A` often originates |
| 21 |
from some partial differential operator. For instance, :math:`A` can |
| 22 |
be the stiffness matrix corresponding to this bilinear form: |
| 23 |
|
| 24 |
.. math:: |
| 25 |
|
| 26 |
a(u, v) = \int_{\Omega} \nabla u \cdot \nabla v \ {\rm d} x. |
| 27 |
|
| 28 |
Here, we will let the space :math:`V` (of dimension :math:`n`) consist |
| 29 |
of continuous piecewise linear polynomials defined relative to some |
| 30 |
mesh (Lagrange finite elements). For this example, we will consider a |
| 31 |
3-D mesh of tetrahedra generated elsewhere. |
| 32 |
|
| 33 |
With the above input the first eigenfunction will look as follows: |
| 34 |
|
| 35 |
.. image:: ../eigenvalue_x.png |
| 36 |
:scale: 75 |
| 37 |
:align: center |
| 38 |
|
| 39 |
In the following, we show how this eigenvalue problem can be solved. |
| 40 |
|