On 30/11/16 19:30, Francis Poulin wrote:
Hello David,
Thanks again!
I modified your code an think I have set it up correctly.
One issue is that you define your petsc_a/m using M.handle. I don't know what that means but I presume I don't change it.
Also, since I only integrate by parts on the mass matrix I impose those Dirichlet BCs on that matrix. If I impose it on both I get an eigenvalue of 1. Not sure why but there is probably a good reason to explain that.
The good news is that it runs, the bad news is that it does not converge to any eigenvalues.
Besides that I like the setup. Seems generic enough that one can apply it to a variety of problems.
If you have any thoughts I'd be curios to hear them.
Francis
# Set up Eigenvalue Problem: QG Basin modes a = beta*phi*psi.dx(0)*dx m = -inner(grad(psi), grad(phi))*dx - F*psi*phi*dx
petsc_a = assemble(a).M.handle petsc_m = assemble(m, bcs=bc).M.handle
# Create solver es = SLEPc.EPS().create(comm=COMM_WORLD) es.ProblemType.GHEP # Generalized eigenvalue problem
You need to write: es.setProblemType(es.ProblemType.GHEP) Lawrence