This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Solving an eigenvalue problem with UFL forms

0 votes

Hi everyone,

I am trying to solve an eigenvalue problem and I need to create my matrices starting from the weak formulation of a system of equations. To do this I wrote the UFL file with three forms: the one relative to real part of the Jacobian matrix, the one relative to the imaginary part and the one relative to the mass matrix.

I have to assemble them in PETScMatrix respecting the homogeneous boundary conditions.

I have tried Assembler but id doesn't seem to work, since the results are not correct. Shall I use SystemAssembler instead? If yes, how?

Thanks for any answer.

asked Jan 8, 2016 by ededonati FEniCS Novice (200 points)

1 Answer

0 votes

SystemAssembler will make a symmetric system which makes eigenvalue computations
easier. Furthermore the part of the matrix corresponding to the BC will be strictly diagonal.
Therefore, you usually get the interesting part of the spectrum using SystemAssembler.

You should of course also be aware that since FEM are variational methods, you
would need to solve the generalised eigenvalueproblem

A x = lambda M x

(where M is the mass matrix) if you want discrete eigenvalues that correspond to the
continuous ones.

answered Jan 8, 2016 by Kent-Andre Mardal FEniCS Expert (14,380 points)

Thank you for your answer.

I understand that SystemAssembler needs a binlinear and also a linear form to initialize the class, for example:

SystemAssembler test = SystemAssembler(a, L) where a and L are forms from my UFL file.
then I do
test.assemble(A) to assemble only the matrix A with the form a.

Is that correct? Do I have to define a "fake" linear form since the eigenvalue system is, by definition, homogeneous and I don't need to assemble any vectors?

I have not really checked the alternatives. I´ve always included the rhs.
(and the bc, which you did not include).

...