-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default ruge_stuben solver diverges for a Poisson problem, due to problematic interpolation #95
Comments
Actually ml_sa = AMG.smoothed_aggregation(A)
AMG._solve(ml_sa, b, verbose=true, maxiter=20) gives:
Both AMG.jl and PyAMG generate the same coarse grid hierachy (below), but their interpolation weights are quite different.
|
It is actually the smoother's fault. Swapping out the built-in smoother by using MatrixMarket
import AlgebraicMultigrid as AMG
import IterativeSolvers: gauss_seidel!
A = MatrixMarket.mmread("poisson3Db.mtx")
b = MatrixMarket.mmread("poisson3Db_b.mtx") |> vec
ml = AMG.ruge_stuben(
A,
presmoother = (A, x, b) -> gauss_seidel!(x, A, b),
postsmoother = (A, x, b) -> gauss_seidel!(x, A, b)
)
AMG._solve(ml, b, verbose=true, maxiter=20) # now converges
|
Since I am currently working a bit myself on AMG stuff I take a deeper look into this. The problem seems to be that your matrix is non-symmetric (see https://www.cise.ufl.edu/research/sparse/matrices/FEMLAB/poisson3Db.html ), but the internal Gauss-Seidel uses the assumption that the provided CSC matrix is symmetric (i and j are swapped, see https://github.com/JuliaLinearAlgebra/AlgebraicMultigrid.jl/blob/master/src/smoother.jl#L33-L36 and the docs for CSC https://docs.julialang.org/en/v1/stdlib/SparseArrays/#SparseArrays.nzrange). |
To reproduce
Download this FEMLAB/poisson3Db file and run:
The residual diverges:
For a good coarse grid transfer, the column sum of restriction operator
R
(or equivalently the row sum of prolongationP
) should be approximately equal to 1. However, the resulting operator contains sum as large as 6.Compare with PyAMG default
PyAMG with default settings is able to converge:
The interpolation operators also looks good:
By default, both PyAMG and AMG.jl use
theta=0.25
for strength of connection, and symmetric Gauss-Seidel as smoother, so their behaviors should have been similar. Maybe some subtle problems in the interpolation code. Haven't fully figured it out yet.The text was updated successfully, but these errors were encountered: