<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hello,</p>
<p><br>
</p>
<p>I am working on DMStag and I have one dof on vertices (let us call it V), <span style="font-size: 12pt;">one dof on edges </span><span style="font-size: 12pt;">(let us call it </span><span style="font-size: 12pt;">E)</span><span style="font-size: 12pt;">,
one dof on faces (</span><span style="font-size: 12pt;">(let us call it </span><span style="font-size: 12pt;">F)</span><span style="font-size: 12pt;">) </span><span style="font-size: 12pt;">and one dof on cells </span><span style="font-size: 12pt;">(let us
call it </span><span style="font-size: 12pt;">C)</span><span style="font-size: 12pt;">.</span></p>
<p>I build<span style="font-size: 12pt;"> a matrix on this DM, and I </span><font size="3">was </font>wondering if there was a way to get blocks (or sub matrices) of this matrix corresponding to specific degrees of freedom, for example rows corresponding to
V dofs and columns corresponding to E dofs.</p>
<p>I already asked this question before and the answer I got was I could call <span style="font-size: 12pt;">PCFieldSplitSetDetectSaddlePoint with the diagonal entries being of the matrix being zero or nonzero. </span></p>
<p>That worked well. Nonetheless, I am curious to know if<span style="font-size: 12pt;"> there was another alternative that does not require creating </span><span style="font-size: 12pt;">a dummy matrix with appropriate diagonal entries and solving a dummy
linear system with this matrix to </span><span style="font-size: 12pt;">define the splits. </span></p>
<p><span style="font-size: 12pt;"></span></p>
<p><span style="font-size: 12pt;"></span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;">Many thanks.</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;">Best regards,</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;">Zakariae</span></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> petsc-users <petsc-users-bounces@mcs.anl.gov> on behalf of Tang, Qi <tangqi@msu.edu><br>
<b>Sent:</b> Sunday, April 18, 2021 11:51:59 PM<br>
<b>To:</b> Patrick Sanan<br>
<b>Cc:</b> petsc-users@mcs.anl.gov; Tang, Xianzhu<br>
<b>Subject:</b> [EXTERNAL] Re: [petsc-users] Question about PCFieldSplit</font>
<div> </div>
</div>
<div>
<div class="">Thanks a lot, Patrick. We appreciate your help.</div>
<div class=""><br class="">
</div>
<div class="">Qi<br class="">
<div class=""><br class="">
</div>
<br class="Apple-interchange-newline">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Apr 18, 2021, at 11:30 PM, Patrick Sanan <<a href="mailto:patrick.sanan@gmail.com" class="">patrick.sanan@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
We have this functionality in a branch, which I'm working on cleaning up to get to master. It doesn't use PETScSection. Sorry about the delay!<br class="">
<div class=""><br class="">
</div>
<div class="">You can only use PCFieldSplitSetDetectSaddlePoint when your diagonal entries being zero or non-zero defines the splits correctly. </div>
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">Am 17.04.2021 um 21:09 schrieb Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>>:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<div dir="ltr" class="">On Fri, Apr 16, 2021 at 8:39 PM Jorti, Zakariae via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>> wrote:<br class="">
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr" class="">
<div id="gmail-m_7270498382696629604divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">
<p class="">Hello,</p>
<p class=""><br class="">
</p>
<p class="">I have a DMStag grid with one dof on each edge and face center. </p>
<p class="">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 class="">In the DMStag examples (ex2.c and ex3.c), the function PCFieldSplitSetDetectSaddlePoint is used to <font size="3" class="">determine those </font><font size="3" class="">fields based on zero diagonal entries. In my case, I have a Jacobian matrix
that does not have </font>zero<font size="3" class=""> diagonal entries. </font></p>
<p class=""><font size="3" class=""><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">Can I use that </span></font><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">PCFieldSplitSetDetectSaddlePoint
in this case? </span></p>
<p class=""><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">If not, how should I do? </span></p>
<p class=""><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">Should</span><font size="3" class=""><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class=""> I do like this example (</span></font><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class=""><a href="https://urldefense.com/v3/__https://www.mcs.anl.gov/petsc/petsc-master/src/ksp/ksp/tutorials/ex43.c.html__;!!HXCxUKc!jbBwV2h9luOW4dtBcNh6n_W1ULQnSVeXpxl0Ef1752s4Hlef-nC2JcnksFSO3Q$" target="_blank" class="">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;" class="">: </span></p>
<p class=""><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">const PetscInt Bfields[1] = {0},Efields[1] = {1};</span></p>
<p class=""><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">KSPGetPC(ksp,&pc);</span></p>
<p class=""><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">PCFieldSplitSetBlockSize(pc,2);</span></p>
<p class=""><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">PCFieldSplitSetFields(pc,"B",1,Bfields,Bfields); PCFieldSplitSetFields(pc,"E",1,Efields,Efields); </span></p>
<p class=""><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">where my B unknowns are defined on face centers and E unknowns are defined on edge centers?</span></p>
</div>
</div>
</blockquote>
<div class="">That will not work.That interface only works for colocated fields that you get from DMDA.<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Patrick, does DMSTAG use PetscSection? Then the field split would be automatically calculated. If not, does it maintain the</div>
<div class="">field division so that it could be given to PCFIELDSPLIT as ISes?</div>
<div class=""><br class="">
</div>
<div class=""> Thanks,</div>
<div class=""><br class="">
</div>
<div class=""> Matt</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr" class="">
<div id="gmail-m_7270498382696629604divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">
<p class="">One last thing, I do not know which field comes first. Is it the one defined for face dofs or edge dofs.</p>
<p class=""><br class="">
</p>
<p class="">Thank you.</p>
<p class="">Best regards,</p>
<p class=""><br class="">
</p>
<p class="">Zakariae</p>
<div class=""><br class="webkit-block-placeholder">
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
--<span class="Apple-converted-space"> </span><br class="">
<div dir="ltr" class="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://urldefense.com/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!HXCxUKc!jbBwV2h9luOW4dtBcNh6n_W1ULQnSVeXpxl0Ef1752s4Hlef-nC2JcmGgSwfag$" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>