Skip to content

Instantly share code, notes, and snippets.

@wence-
Created January 19, 2015 16:06
Show Gist options
  • Select an option

  • Save wence-/a9a5b2116c9ae2e90a59 to your computer and use it in GitHub Desktop.

Select an option

Save wence-/a9a5b2116c9ae2e90a59 to your computer and use it in GitHub Desktop.
...
from slepc4py import SLEPc
A = assemble(a).M.handle
eps = SLEPc.EPS().create()
# eps.setDimensions(nev=10, ncv=100)
# eps.setWhichEigenpairs(eps.Which.SMALLEST_MAGNITUDE)
eps.setOperators(A)
eps.setFromOptions()
eps.solve()
n = eps.getConverged()
for i in range(n):
val = eps.getEigenvalue(i)
print val
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment