← Back to team overview

dolfin team mailing list archive

Parameters for SLEPc eigensolver

 


Hi,

It seems that the SLEPCEigenSolver does not grasp that parameters are being changed. The attached test_eigensolver.py
gives


[.. LARGE AMOUNT OF PETSC ERRORS ...]
Eigenvalue solver (krylovschur) converged in 0 iterations.
Traceback (most recent call last):
 File "test_eigensolver.py", line 32, in <module>
   lamda = esolver.get_eigenvalue(i)
RuntimeError: *** Error: Requested eigenvalue has not been computed


becuase 'krylovschur' is being used instead of 'lapack' as requested.

Or am I using the new parameter system wrong?

--
Marie



from dolfin import *

n = 3
A = Matrix(n, n)
B = Matrix(n, n)
for i in range(n):
    for j in range(n):
        A[(i, j)] = 0.0
        B[(i, j)] = 0.0

A[(0, 0)] = 1.0
A[(1, 1)] = 1.0
A[(2, 2)] = 1.0

B[(1, 1)] = 1.0
B[(2, 2)] = 1.0

A.apply()
B.apply()

esolver = SLEPcEigenSolver()

# Set parameters for eigenslver
esolver.parameters["solver"] = "lapack"
esolver.parameters["spectrum"] = "smallest real"


esolver.solve(down_cast(A), down_cast(B))

for i in range(1):
    lamda = esolver.get_eigenvalue(i)
    print "lamda_%d " % i, lamda

Follow ups