<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
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 2.0cm 2.0cm 2.0cm;}
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="IT" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Good morning,<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">I’m still struggling with the Poisson equation with Neumann BCs.<o:p></o:p></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.<o:p></o:p></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).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Moreover, in my computational domain there are 2 separated sub-domains.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I build the null space and then I use MatNullSpaceTest to check it.<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">If I do this:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">MatNullSpaceCreate(getCommunicator(), PETSC_TRUE, 0, nullptr, &nullspace);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">It works<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">If I do this:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR">Vec nsp;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR">VecDuplicate(m_rhs, &nsp);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR">VecSet(nsp,1.0);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR">VecNormalize(nsp, nullptr);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">MatNullSpaceCreate(getCommunicator(), PETSC_FALSE, 1, &nsp, &nullspace);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">It does not work<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">Probably, I have wrong expectations, but should not it be the same?<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<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:IT">Marco Cisternino, PhD<br>
<a href="mailto:marco.cisternino@optimad.it"><span style="color:blue">marco.cisternino@optimad.it</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:IT">______________________<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:IT">Optimad Engineering Srl<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:IT">Via Bligny 5,
</span><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif;color:#201F1E;background:white;mso-fareast-language:IT">Torino, Italia.</span><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif;color:#201F1E;mso-fareast-language:IT"><br>
<span style="background:white">+3901119719782</span><br>
</span><span style="mso-fareast-language:IT"><a href="http://www.optimad.it/" target="_blank"><span lang="EN-GB" style="font-family:"Segoe UI",sans-serif;color:blue;border:none windowtext 1.0pt;padding:0cm;background:white">www.optimad.it</span></a></span><span lang="EN-GB" style="mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
</div>
</body>
</html>