<div dir="ltr">Got it. <br><div><br></div><div>Thanks for your detailed explanation.</div><div><br></div><div>YUAN</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2022年10月19日(水) 23:58 Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>>:<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 style="overflow-wrap: break-word;"><div><br></div> Every time a matrix entry gets changes PETSc tracks these changes so for the next KSP by default solve it repeats the numerical factorization if the matrix has changed. Otherwise it reuses the still current factorization. <div><br></div><div> If you are calling KSP directly, you can call KSPSetReusePreconditioner() to prevent KSP from automatically performing a new factorization, so it will use the out-of-date preconditioner but if you use a KSPType of, for example, KSPGMRES, it will still solve the linear system correctly just taking some iterations. Reusing the preconditioner can be faster if the matrix does not change too much since a numerical factorization takes a lot of time</div><div><br></div><div> If you use SNES you can control "lagging" the preconditioner with SNESSetLagPreconditioner() </div><div><br></div><div> Barry</div><div><br></div><div><div><br><blockquote type="cite"><div>On Oct 19, 2022, at 9:15 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div dir="ltr">On Wed, Oct 19, 2022 at 9:13 AM 袁煕 <<a href="mailto:yuanxi@advancesoft.jp" target="_blank">yuanxi@advancesoft.jp</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"><span style="font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px">Hello,</span><div><font color="rgba(0, 0, 0, 0.870588235294118)" face="Roboto, RobotoDraft, Helvetica, Arial, sans-serif"><span style="font-size:14px"><br></span></font></div><div><font color="rgba(0, 0, 0, 0.870588235294118)" face="Roboto, RobotoDraft, Helvetica, Arial, sans-serif"><span style="font-size:14px">I am using Mumps to solve a problem with multiple time steps. The matrix structure does not change but its value may or may not change </span></font>
<span style="color:rgb(160,0,41);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:14px">during those steps. That means I should reuse the symbolic factorization but recall numeric factorization when needed.</span><div><br></div><div>I have found the following anwser of a similar question</div><div><a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2020-August/041846.html" target="_blank">https://lists.mcs.anl.gov/pipermail/petsc-users/2020-August/041846.html</a><br></div></div><div><br></div><div>which says "<span style="white-space:pre-wrap">it automatically uses the same factorization", but I don't know if it includes numerical factorization also.</span></div><div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">My question is : </span></div><div><span style="white-space:pre-wrap">1. Does numeric factorization do automatically? If not</span></div></div></blockquote><div><br></div><div>Yes.</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 dir="ltr"><div><span style="white-space:pre-wrap">2. Could I control when </span><span style="white-space:pre-wrap">numeric factorization should be done and how to do it?</span></div><div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">Much thanks</span></div><div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">YUAN</span></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <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="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</div></blockquote></div><br></div></div></blockquote></div>