<div dir="ltr"><div>Sorry, some more questions.<br></div><div><br>3) Also, for Dirichlet bc, I specify the value through Identity rows, i.e. A_ii = 1 and the rhs value would correspond to the Dirichlet condition. I am specifying it this way for my convenience. I am aware that MatZerosRowColumns might help here, but would keeping it this way be detrimental?<br><br></div>4) Can I expect symmetric matrices to perform better, i.e. if I eliminate Dirichlet rows? But I would still be left with Neumann boundary conditions, where I use the second order formulation. If I used the first order formulation and made it symmetric, would that be an advantage? I tried the latter, but I didn't see the condition number change much.<br><br><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 10, 2015 at 8:51 PM, K. N. Ramachandran <span dir="ltr"><<a href="mailto:knram06@gmail.com" target="_blank">knram06@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hello all,<br><br></div>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.<br><br></div>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.<br><br></div>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.<br><br></div>I tried the methods outlined <a href="http://scicomp.stackexchange.com/questions/513/why-is-my-iterative-linear-solver-not-converging?rq=1" target="_blank">here</a> and <a href="http://scicomp.stackexchange.com/questions/34/how-can-i-estimate-the-condition-number-of-a-large-sparse-matrix-using-petsc" target="_blank">here</a>. Reverting to a 41^3 grid, I got the approximate condition number (usingĀ <code>-ksp_monitor_singular_value -ksp_type gmres -ksp_gmres_restart 1000 -pc_type none) <font face="arial,helvetica,sans-serif">as ~9072, which seems pretty large. Higher matrix sizes give a larger condition number.</font><br><br></code></div><code><font face="arial,helvetica,sans-serif">1) </font></code><code><font face="arial,helvetica,sans-serif"><code><font face="arial,helvetica,sans-serif">My best performing solver + preconditioner is bcgs+ilu(0) (on 1e6 grid) which solves in around 32 seconds, 196 iterations</font>.<font face="arial,helvetica,sans-serif"> </font></code>How do I get a fix for what the lower bound on the running time could be?<br><br></font></code></div><code><font face="arial,helvetica,sans-serif">2) Initially <span style="font-family:monospace,monospace">-pc_type hypre</span> just Diverged and I was never able to use it. Looking at <a href="http://lists.mcs.anl.gov/pipermail/petsc-users/2013-October/019127.html" target="_blank">this thread</a>, I had tried the options and it no longer diverges, but the residuals reduce and hover around a constant value.</font></code> How do I work with hypre to get a useful preconditioner?<br><code></code><div><div><div><div><div><div><div><div><br></div><div>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.<br><br></div><div>Hope this helps. Please let me know if you might need more information.<br clear="all"></div><div><br></div><div>Thanking You,<br></div><div><div><div dir="ltr">K.N.Ramachandran<br><div>Ph: <a href="tel:814-441-4279" value="+18144414279" target="_blank">814-441-4279</a></div></div></div>
</div></div></div></div></div></div></div></div></div>
</blockquote></div><br><br clear="all"></div><div class="gmail_extra">Thanking You,<br></div><div class="gmail_extra"><div class="gmail_signature"><div dir="ltr">K.N.Ramachandran<br><div>Ph: 814-441-4279</div></div></div>
</div></div>