[petsc-users] Diagnosing Poisson Solver Behavior

K. N. Ramachandran knram06 at gmail.com
Sat Oct 10 19:51:59 CDT 2015


Hello all,

I am a graduate student pursuing my Master's and I am trying to benchmark a
previous work by using PETSc for solving Poisson's Equation.

I am starting off with a serial code and I am trying to keep my code
modular, i.e. I generate the sparse matrix format and send it to PETSc or
any other solver. So I haven't built my code from the ground up using
PETSc's native data structures.

I am having trouble understanding the behavior of the solver and would like
your thoughts or inputs on what I can do better. I have both Dirichlet and
Neumann boundary conditions and my matrix size (number of rows) is around a
million but very sparse (~7 nonzeros per row), as can be expected from a
finite difference discretization of Poisson's equation.

I tried the methods outlined here
<http://scicomp.stackexchange.com/questions/513/why-is-my-iterative-linear-solver-not-converging?rq=1>
and here
<http://scicomp.stackexchange.com/questions/34/how-can-i-estimate-the-condition-number-of-a-large-sparse-matrix-using-petsc>.
Reverting to a 41^3 grid, I got the approximate condition number
(using  -ksp_monitor_singular_value
-ksp_type gmres -ksp_gmres_restart 1000 -pc_type none) as ~9072, which
seems pretty large. Higher matrix sizes give a larger condition number.

1) My best performing solver + preconditioner is bcgs+ilu(0) (on 1e6 grid)
which solves in around 32 seconds, 196 iterations. How do I get a fix for
what the lower bound on the running time could be?

2) Initially -pc_type hypre just Diverged and I was never able to use it.
Looking at this thread
<http://lists.mcs.anl.gov/pipermail/petsc-users/2013-October/019127.html>,
I had tried the options and it no longer diverges, but the residuals reduce
and hover around a constant value. How do I work with hypre to get a useful
preconditioner?

Initially I solve Laplace's equation, so the mesh grid size has no effect
and even when I solve Poisson's equation, the spacing is carried over to
the RHS, so I am pretty sure the spacing is not affecting the condition
number calculation.

Hope this helps. Please let me know if you might need more information.

Thanking You,
K.N.Ramachandran
Ph: 814-441-4279
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151010/34360b02/attachment.html>


More information about the petsc-users mailing list