[petsc-users] SLEPc iterative solver does not converge but ARPACK does

Julian Andrej juan at tf.uni-kiel.de
Mon Jul 6 06:26:34 CDT 2015


Hello,

i'm using PETSc and SLEPc in Python.

I'm trying to calculate eigenvalues for the stokes equations with the
following code

SHIFT = SLEPc.ST().create()
SHIFT.setType(SHIFT.Type.SINVERT)
E = SLEPc.EPS().create()
E.setST(SHIFT)
E.setOperators(K, M)
E.setDimensions(25, PETSc.DECIDE)
E.setWhichEigenpairs(E.Which.SMALLEST_MAGNITUDE)
E.setFromOptions()
E.solve()

This gives me correct eigenvalues and right eigenvectors.

If I want to compute the LEFT eigenvectors i setup a new solver
context with the corresponding transposed matrices (these are
precalculated)

SHIFT = SLEPc.ST().create()
SHIFT.setType(SHIFT.Type.SINVERT)
E = SLEPc.EPS().create()
E.setST(SHIFT)
E.setOperators(KT, MT)
E.setDimensions(25, PETSc.DECIDE)
E.setWhichEigenpairs(E.Which.SMALLEST_MAGNITUDE)
E.setFromOptions()
E.solve()

I don't get any converged eigenvalues.

Interfacing ARPACK through scipy

v, V = sp.linalg.eigs(A=K, k=64, M=M, sigma=1.0)
w, W = sp.linalg.eigs(A=K.T, k=64, M=M.T, sigma=1.0)

i get correct left and right eigenvectors (passing (K*V-M*V*diag(v)) < 1e-10)

I tried alot of configurations to get it working, so i dont have to
convert matrices in my calculations.
Is it possible to get the expected results with the iterative solver?


More information about the petsc-users mailing list