<div dir="ltr"><div dir="ltr">On Tue, Dec 7, 2021 at 11:19 AM Marco Cisternino <<a href="mailto:marco.cisternino@optimad.it">marco.cisternino@optimad.it</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="IT" style="overflow-wrap: break-word;">
<div class="gmail-m_4236750629004618850WordSection1">
<p class="MsoNormal">Good morning,<u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">I’m still struggling with the Poisson equation with Neumann BCs.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I discretize the equation by finite volume method and I divide every line of the linear system by the volume of the cell. I could avoid this division, but I’m trying to understand.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">My mesh is not uniform, i.e. cells have different volumes (it is an octree mesh).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Moreover, in my computational domain there are 2 separated sub-domains.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I build the null space and then I use MatNullSpaceTest to check it.<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">If I do this:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">MatNullSpaceCreate(getCommunicator(), PETSC_TRUE, 0, nullptr, &nullspace);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">It works</span></p></div></div></blockquote><div><br></div><div>This produces the normalized constant vector.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="IT" style="overflow-wrap: break-word;"><div class="gmail-m_4236750629004618850WordSection1">
<p class="MsoNormal"><span lang="EN-GB">If I do this:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="FR">Vec nsp;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="FR">VecDuplicate(m_rhs, &nsp);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="FR">VecSet(nsp,1.0);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="FR">VecNormalize(nsp, nullptr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">MatNullSpaceCreate(getCommunicator(), PETSC_FALSE, 1, &nsp, &nullspace);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">It does not work</span></p></div></div></blockquote><div><br></div><div>This is also the normalized constant vector.</div><div><br></div><div>So you are saying that these two vectors give different results with MatNullSpaceTest()?</div><div>Something must be wrong in the code. Can you send a minimal example of this? I will go</div><div>through and debug it.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="IT" style="overflow-wrap: break-word;"><div class="gmail-m_4236750629004618850WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Probably, I have wrong expectations, but should not it be the same?<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<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span>Marco Cisternino, PhD<br>
<a href="mailto:marco.cisternino@optimad.it" target="_blank"><span style="color:blue">marco.cisternino@optimad.it</span></a><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">Optimad Engineering Srl<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Via Bligny 5,
</span><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif;color:rgb(32,31,30);background:white">Torino, Italia.</span><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif;color:rgb(32,31,30)"><br>
<span style="background:white">+3901119719782</span><br>
</span><span><a href="http://www.optimad.it/" target="_blank"><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif;color:blue;border:1pt none windowtext;padding:0cm;background:white">www.optimad.it</span></a></span><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
</div>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>