[petsc-users] SLEPc iterative solver does not converge but ARPACK does
Jose E. Roman
jroman at dsic.upv.es
Mon Jul 6 06:31:36 CDT 2015
You should not use SMALLEST_MAGNITUDE with SINVERT.
If using SINVERT you should set the target value E.setTarget(sigma) and leave the default Which (or set it explicitly to Which.TARGET_MAGNITUDE).
Jose
> El 6/7/2015, a las 13:26, Julian Andrej <juan at tf.uni-kiel.de> escribió:
>
> 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