<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="NL" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Dear users,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></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.<o:p></o:p></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. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<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).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">The system P * x = b now does NOT converge.<o:p></o:p></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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Either things are overly sensitive or I am misusing petsc.<o:p></o:p></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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></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?<o:p></o:p></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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></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).<o:p></o:p></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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">The code prints the matrix P and solution etc.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Anyone any hints on this?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">What other preconditioners (serial) are suitable for this problem besides ICC/AMG?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Thanks very much.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:NL">Danny Lathouwers<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
</div>
</body>
</html>