<div dir="ltr"><div dir="ltr">On Fri, Apr 16, 2021 at 8:39 PM Jorti, Zakariae via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</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 dir="ltr">
<div id="gmail-m_7270498382696629604divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hello,</p>
<p><br>
</p>
<p>I have a DMStag grid with one dof on each edge and face center. </p>
<p>I want to use a PCFieldSplit preconditioner on a Jacobian matrix that I assume is already split but I am not sure how to determine the fields. </p>
<p>In the DMStag examples (ex2.c and ex3.c), the function PCFieldSplitSetDetectSaddlePoint is used to <font size="3">determine those </font><font size="3">fields based on zero diagonal entries. In my case, I have a Jacobian matrix that does not have </font>zero<font size="3"> diagonal
 entries. </font></p>
<p><font size="3"><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">Can I use that </span></font><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">PCFieldSplitSetDetectSaddlePoint in this case? </span></p>
<p><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">If not, how should I do? </span></p>
<p><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">Should</span><font size="3"><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif"> I do like this example (</span></font><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif"><a href="https://www.mcs.anl.gov/petsc/petsc-master/src/ksp/ksp/tutorials/ex43.c.html" target="_blank">https://www.mcs.anl.gov/petsc/petsc-master/src/ksp/ksp/tutorials/ex43.c.html</a>)</span><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">: </span></p>
<p><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">const PetscInt Bfields[1] = {0},Efields[1] = {1};</span></p>
<p><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">KSPGetPC(ksp,&pc);</span></p>
<p><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">PCFieldSplitSetBlockSize(pc,2);</span></p>
<p><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">PCFieldSplitSetFields(pc,"B",1,Bfields,Bfields); PCFieldSplitSetFields(pc,"E",1,Efields,Efields); </span></p>
<p><span style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">where my B unknowns are defined on face centers and E unknowns are defined on edge centers?</span></p></div></div></blockquote><div>That will not work.That interface only works for colocated fields that you get from DMDA.<br></div><div><br></div><div>Patrick, does DMSTAG use PetscSection? Then the field split would be automatically calculated. If not, does it maintain the</div><div>field division so that it could be given to PCFIELDSPLIT as ISes?</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div id="gmail-m_7270498382696629604divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>One last thing, I do not know which field comes first. Is it the one defined for face dofs or edge dofs.</p>
<p><br>
</p>
<p>Thank you.</p>
<p>Best regards,</p>
<p><br>
</p>
<p>Zakariae</p>
<p></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>