Example from documentation works fine for n=300 but often stagnated to other values.
Poisson matrix has same general properties for different n, so iterative solver should converge for all n.
from pysparse import spmatrix, precon, itsolvers
n = 300
L = poisson2d_sym_blk(n)
b = numpy.ones(n*n)
x = numpy.empty(n*n)
S = L.to_sss()
Kssor = precon.ssor(S)
info, iter, relres = itsolvers.pcg(S, b, x, 1e-12, 2000, Kssor)
Log in to post a comment.