demo_waveguide hangs on larger meshes (slepc)

Asked by DN

I have problems runnning the demo_waveguide python example using either the "arnoldi" or the "krylov-schur" SLEPC solvers on larger meshes with first order elements. For small meshes (anything below ~20x10 rectangles) it runs fine. If I increase the mesh resolution above that the solve() call hangs (Ive run it up to an hour with no results). "lapack" still works.

The only lines I changed from the original example were:
mesh = Rectange(0, 0, width, height, 25, 15) # was ", 4, 2)"
V = FunctionSpace(mesh, "Nedelec 1st kind H(curl)", 1) # instead of "... , 3)"
esolver.parameters["solver"] = "krylov-schur" # was "lapack"

Setting lower tolerance values does not help. This happens with a dorsal-built 1.0.0 version on OpenSuse 12.1 as well as with the official built for Mac OS X 10.6.

Did I overlook any additional required configuration? Can someone reproduce this or has any ideas on why this doesn't work?
Thank you very much!

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Marie Rognes (meg-simula) said :
#1

Generalized eigenvalue problems are pretty computationally expensive, especially if you are trying
to compute all the eigenvalues. Try only computing some of them instead. Also, since you have a singular generalized eigenvalue problem, in order for the krylov-schur solver to converge you probably need to use an additional spectral transform. Try the below in conjunction with that demo instead, it gives an answer
in about 0.3 seconds for 25 x 15 with 1st order Nedelecs on my laptop

--

# Set-up eigensolver:
esolver = SLEPcEigenSolver(S, T)

# Set solver type (krylov-schur allows solving for only some
# of the eigenvalues)
esolver.parameters["solver"] = "krylov-schur"

# Set spectral transform (see doc for options, this one tends to
# 'work')
esolver.parameters["spectral_transform"] = "shift-and-invert"

# Set spectral shift value (aka 'target value': some value that is
# hopefully close to the value you are interested in)
esolver.parameters["spectral_shift"] = 30.0

# Set how to sort the eigenvalues, now sorted by proximity to the
# target value (
esolver.parameters["spectrum"] = "target magnitude"

# Compute (at least) two eigenvalues
esolver.solve(2)

# Print the converged eigenvalues
for i in range(esolver.get_number_converged()):
    (lr, lc) = esolver.get_eigenvalue(i)
    print "i = ", i,
    print ": ", (lr, lc)

--

Can you help with this problem?

Provide an answer of your own, or ask DN for more information if necessary.

To post a message you must log in.