Thanks for the inquiry. The output from the blackbox solver of
"nonsymmetric" refers to your matrix not being symmetric in a
Hermitian sense, which I believe is correct. So, I apologize for the
confusing output. I just changed this in the repository so that the
latest version of the blackbox solver will output "non-Hermitian" for
your matrix.
I don't know why the blackbox solver would give worse results than a
direct method, unless the convergence tolerance isn't being satisfied.
You should try increasing "maxiter" to 600 or 700 and setting "tol"
to 1e-8 when calling pyamg.solve(...). Then make sure that the
relative residual is small after PyAMG solves the system. Also, the
code does support complex data types, so that should not be a problem.
You are correct that if you call the default
smoothed_aggregation_solver(...) on an indefinite matrix, the solver
will quite possibly diverge. However, the solver options loaded by
the blackbox solver should be robust enough to handle an indefinite
matrix. There's no guarantee that the convergence of the blackbox
solver will be fast, though.
One thing that I would recommend trying, is to post modify the solver
that you get out of the black box solver with this code
# Just generate the solver first
x, ml = pyamg.solve(A, b, maxiter=1, return_solver=True)
# Now modify the relaxation method
from pyamg.relaxation.smoothing import change_smoothers
prepost = [('gauss_seidel', {'sweep' : 'symmetric', 'iterations' : 1}),
('gauss_seidel_nr', {'sweep' : 'symmetric', 'iterations' : 2})]
change_smoothers(ml, prepost, prepost)
# Finally solve with existing_solver = ml
x = pyamg.solve(A, b, existing_solver=ml, maxiter=600, tol=1e-8)
As of now, there is not a verb=True option for
smoothed_aggregation_solver.solve(...). Perhaps, we should implement
one though.
Hopefully, this helps. If it doesn't, you could try the
adaptive_sa_solver(...) with appropriate parameters for indefinite
matrices (look to see what parameters blackbox uses in blackbox.py for
non-Hermitian matrices). Additionally, you could look at the
Helmholtz example in the Examples/ComplexSymmetric/ directory, where a
Helmholtz operator with only a real shift is solved (i.e., Q is the
zero matrix in your example).
Keep us posted,
Jacob
> --
> You received this message because you are subscribed to the Google Groups "pyamg-user" group.
> To post to this group, send email to pyamg...@googlegroups.com.
> To unsubscribe from this group, send email to pyamg-user+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pyamg-user?hl=en.
>
>