On 8/25/21 9:37 PM, Anton Ermakov wrote:
>
> >>> You can do that, but I believe that it's also possible to work with the
> original system where one of the two matrices is only semidefinite.
>
> I have redone it with the original system, but it seems that PETSc is
> complaining about missing diagonal entry.
>
> /[0]PETSC ERROR: Object is in wrong state/
>
> /[0]PETSC ERROR: Matrix is missing diagonal entry 3/
>
> I presume this happens due to a zero block in one (or both) of the
> original matrices. Hmmm, should I then just explicitly see all zero
> diagonal values to 0.0.
I don't know whether the error complains about the value missing in the
sparsity pattern, or it being zero.
In any case, you might have to read up in the documentation of SLEPC
about two issues:
* You can solve Ax = lambda M x or M x = mu A x, where mu=1/lambda. The
problem is well posed if one of the two matrices is not singular, but I
bet that SLEPc has a convention where it either wants the matrix on the
left, or the one on the right to be the non-singular one.
* There is probably a preconditioner involved somewhere. If that
preconditioner happens to be something like Jacobi, then it will need to
divide by a diagonal entry. You will need to make sure that the matrix
that the preconditioner is applied to has nonzero diagonals -- or,
alternatively, choose a different preconditioner.