<div dir="ltr"><div dir="ltr">On Fri, Jul 16, 2021 at 3:33 PM Tang, Qi <<a href="mailto:tangqi@msu.edu">tangqi@msu.edu</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 style="overflow-wrap: break-word;">
<div>Matt,</div>
<div><br>
</div>
<div>We are confident that the modified Schur complement works well based on our subksp and ksp tests. Let me summarize what you suggest us to do regarding to our original question of TSSolve. Instead of calling subksp, you suggest we should provide
two matrices J and Jpre through TSSetIJacobian, where J is the original Jacobian and Jpre is the one we modified and both are 2x2 blocks. Then if we call fieldsplit, petsc will automatically use Jpre to construct its Schur complement in the preconditioner
stage. Is that what you suggested?</div></div></blockquote><div><br></div><div>Yes, exactly. We should be able to reproduce what you have done, but now completely from the command line.</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 style="overflow-wrap: break-word;">
<div>Thanks a lot!</div>
<div><br>
</div>
<div>Qi</div>
<div>
<div><br>
</div>
</div>
<div> <br>
<div><br>
</div>
<br>
</div>
<div><br>
<blockquote type="cite">
<div>On Jul 7, 2021, at 3:54 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div>
<br>
<div>
<div dir="ltr" style="font-family:Helvetica;font-size:16px;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;text-decoration:none">
<div dir="ltr">On Wed, Jul 7, 2021 at 2:33 PM Jorti, Zakariae <<a href="mailto:zjorti@lanl.gov" target="_blank">zjorti@lanl.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>
<div id="gmail-m_3579230707828746117gmail-m_4217968377908507552divtagdefaultwrapper" dir="ltr" style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">
<p>Hi Matt,</p>
<p><br>
</p>
<p>Thanks for your quick reply. </p>
<p>I have not completely understood your suggestion, could you please elaborate a bit more? </p>
<p>For your convenience, here is how I am proceeding for the moment in my code: </p>
<p><br>
</p>
<p>TSGetKSP(ts,&ksp);<br>
</p>
<p>KSPGetPC(ksp,&pc); <br>
</p>
<p>PCSetType(pc,PCFIELDSPLIT);</p>
<p>PCFieldSplitSetDetectSaddlePoint(pc,PETSC_TRUE);</p>
<p>PCSetUp(pc);</p>
<p>PCFieldSplitGetSubKSP(pc, &n, &subksp);</p>
<p>KSPGetPC(subksp[1], &(subpc[1]));</p>
</div>
</div>
</blockquote>
<div>I do not like the two lines above. We should not have to do this. <br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div id="gmail-m_3579230707828746117gmail-m_4217968377908507552divtagdefaultwrapper" dir="ltr" style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">
<p><span style="font-size:12pt">KSPSetOperators(subksp[1],T,T);</span></p>
</div>
</div>
</blockquote>
<div> In the above line, I want you to use a separate preconditioning matrix M, instead of T. That way, it will provide<br>
</div>
<div>the preconditioning matrix for your Schur complement problem.</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>
<div id="gmail-m_3579230707828746117gmail-m_4217968377908507552divtagdefaultwrapper" dir="ltr" style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif">
<p><span style="font-size:12pt">KSPSetUp(subksp[1]);</span><br>
</p>
<p>PetscFree(subksp);</p>
<p>TSSolve(ts,X);<br>
</p>
<p><br>
</p>
<p>Thank you.</p>
<p>Best,</p>
<p><br>
</p>
<p>Zakariae</p>
</div>
<hr style="display:inline-block;width:1015.22px">
<div id="gmail-m_3579230707828746117gmail-m_4217968377908507552divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b><span> </span>Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
<b>Sent:</b><span> </span>Wednesday, July 7, 2021 12:11:10 PM<br>
<b>To:</b><span> </span>Jorti, Zakariae<br>
<b>Cc:</b><span> </span><a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>; Tang, Qi; Tang, Xianzhu<br>
<b>Subject:</b><span> </span>[EXTERNAL] Re: [petsc-users] Problem with PCFIELDSPLIT</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">On Wed, Jul 7, 2021 at 1:51 PM Jorti, Zakariae via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">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_3579230707828746117gmail-m_4217968377908507552gmail-m_4230588803823514004divtagdefaultwrapper" dir="ltr" style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Hi,</p>
<p><br>
</p>
<p>I am trying to build a PCFIELDSPLIT preconditioner for a matrix </p>
<p>J = [A00 A01]</p>
<p> [A10 A11] </p>
<p>that has the following shape: </p>
<p><br>
</p>
<p>M_{user}^{-1} = [I -ksp(A00) A01] [ksp(A00) 0] [I 0]</p>
<p> [0 I] [0 ksp(T)] [-A10 ksp(A00) I ]<br>
</p>
<p><br>
</p>
<p>where T is a user-defined Schur complement approximation that replaces the true Schur complement S:= A11 - A10 ksp(A00) A01.</p>
<p><br>
</p>
<p>I am trying to do something similar to this example (lines 41--45 and 116--121): <a href="https://urldefense.com/v3/__https://www.mcs.anl.gov/petsc/petsc-current/src/snes/tutorials/ex70.c.html__;!!HXCxUKc!hoEfgnaraTfQoSgAiplsc6GJ_HuPXN88m5AJVy1gb7WVMNkGENDnJ3zToOGlhw$" id="gmail-m_3579230707828746117gmail-m_4217968377908507552gmail-m_4230588803823514004LPlnk826214" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/src/snes/tutorials/ex70.c.html</a></p>
<p><br>
</p>
<p>The problem I have is that I manage to replace S with T on a separate single linear system but not for the linear systems generated by my time-dependent PDE. Even if I set the preconditioner <span style="font-size:12pt">M_{user}^{-1}
correctly, the T matrix gets replaced by S in the preconditioner once I call TSSolve. </span></p>
<p><span style="font-size:12pt">Do you have any suggestions how to fix this knowing that the matrix J does not change over time?</span></p>
<div><span style="font-size:12pt"></span><br>
</div>
</div>
</div>
</blockquote>
<div>I don't like how it is done in that example for this very reason.</div>
<div><br>
</div>
<div>When I want to use a custom preconditioning matrix for the Schur complement, I always give a preconditioning matrix M to the outer solve.</div>
<div>Then PCFIELDSPLIT automatically pulls the correct block from M, (1,1) for the Schur complement, for that preconditioning matrix without</div>
<div>extra code. Can you do this?</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_3579230707828746117gmail-m_4217968377908507552gmail-m_4230588803823514004divtagdefaultwrapper" dir="ltr" style="font-size:12pt;font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<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><span style="font-size:12pt"></span><br>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
--<span> </span><br>
<div dir="ltr">
<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="https://urldefense.com/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!HXCxUKc!hoEfgnaraTfQoSgAiplsc6GJ_HuPXN88m5AJVy1gb7WVMNkGENDnJ3wB3dcMFw$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
--<span> </span><br>
<div dir="ltr">
<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="https://urldefense.com/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!HXCxUKc!hoEfgnaraTfQoSgAiplsc6GJ_HuPXN88m5AJVy1gb7WVMNkGENDnJ3wB3dcMFw$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</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>