<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 30, 2014 at 2:53 PM, Danny Lathouwers - TNW <span dir="ltr"><<a href="mailto:D.Lathouwers@tudelft.nl" target="_blank">D.Lathouwers@tudelft.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div lang="NL" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Dear users,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span lang="EN-GB">I encountered a strange problem. I have a singular matrix P (Poisson, Neumann boundary conditions, N=4). The rhs b sums to 0.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">If I hand-fill the matrix with the right entries (non-zeroes only) things work with KSPCG and ICC preconditioning and using the MAT_SHIFT_POSITIVE_DEFINITE option. Convergence in 2 iterations to (a) correct solution.
So far for the debugging problem.</span></p></div></div></blockquote><div><br></div><div>That option changes the preconditioner matrix to (alpha I + P). I don't know of a theoretical reason that this</div><div>should be a good preconditioner, but perhaps it exists. Certainly ICC is exquisitely sensitive (you can easily</div>
<div>write down matrices where an epsilon change destroys convergence).</div><div><br></div><div>Yes, you should use null space, and here it is really easy</div><div><br></div><div> -ksp_constant_null_space</div><div><br>
</div><div>Its possible that this fixes your convergence, if the ICC perturbation was introducing components in the</div><div>null space to your solution.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div lang="NL" link="blue" vlink="purple"><div>
<p class="MsoNormal"><span lang="EN-GB">My real problem computes P from D * M * D^T. If I do this I get the same matrix (on std out I do not see the difference to all digits).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">The system P * x = b now does NOT converge.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">More strange is that is if I remove the zeroes from D then things do work again.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Either things are overly sensitive or I am misusing petsc.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">It does work when using e.g. the AMG preconditioner (again it is a correct but different solution). So system really seems OK.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Should I also use the Null space commands as I have seen in some of the examples as well?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">But, I recall from many years ago when using MICCG (alpha) preconditioning that no such tricks were needed for CG with Poisson-Neumann. I am supposing the MAT_SHIFT_POSITIVE_DEFINITE option does something similar as MICCG.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">For clarity I have included the code (unfortunately this is the smallest I could get it; it’s quite straightforward though).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">By setting the value of option to 1 in main.f90 the code use P = D * M * D^T otherwise it will use the hand-filled matrix.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">The code prints the matrix P and solution etc.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Anyone any hints on this?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">What other preconditioners (serial) are suitable for this problem besides ICC/AMG?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Thanks very much.<span class=""><font color="#888888"><u></u><u></u></font></span></span></p><span class=""><font color="#888888">
<p class="MsoNormal"><span lang="EN-GB">Danny Lathouwers<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
</font></span></div>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>