<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></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 class=""><br class=""></div><div class="">   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 class=""><br class=""></div><div class="">   If you use SNES you can control "lagging" the preconditioner with SNESSetLagPreconditioner() </div><div class=""><br class=""></div><div class="">  Barry</div><div class=""><br class=""></div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 19, 2022, at 9:15 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class="">On Wed, Oct 19, 2022 at 9:13 AM 袁煕 <<a href="mailto:yuanxi@advancesoft.jp" class="">yuanxi@advancesoft.jp</a>> wrote:<br class=""></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" class=""><span style="font-family: Roboto, RobotoDraft, Helvetica, Arial, sans-serif; font-size: 14px;" class="">Hello,</span><div class=""><font color="rgba(0, 0, 0, 0.870588235294118)" face="Roboto, RobotoDraft, Helvetica, Arial, sans-serif" class=""><span style="font-size:14px" class=""><br class=""></span></font></div><div class=""><font color="rgba(0, 0, 0, 0.870588235294118)" face="Roboto, RobotoDraft, Helvetica, Arial, sans-serif" class=""><span style="font-size:14px" class="">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" class="">during those steps. That means I should reuse the symbolic factorization but recall numeric factorization when needed.</span><div class=""><br class=""></div><div class="">I have found the following anwser of a similar question</div><div class=""><a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2020-August/041846.html" target="_blank" class="">https://lists.mcs.anl.gov/pipermail/petsc-users/2020-August/041846.html</a><br class=""></div></div><div class=""><br class=""></div><div class="">which says "<span style="white-space: pre-wrap;" class="">it automatically uses the same factorization", but I don't know if it includes numerical factorization also.</span></div><div class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></div><div class=""><span style="white-space: pre-wrap;" class="">My question is : </span></div><div class=""><span style="white-space: pre-wrap;" class="">1. Does numeric factorization do automatically? If not</span></div></div></blockquote><div class=""><br class=""></div><div class="">Yes.</div><div class=""><br class=""></div><div class="">  Thanks,</div><div class=""><br class=""></div><div class="">     Matt</div><div class=""> </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" class=""><div class=""><span style="white-space: pre-wrap;" class="">2. Could I control when </span><span style="white-space: pre-wrap;" class="">numeric factorization should be done and how to do it?</span></div><div class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></div><div class=""><span style="white-space: pre-wrap;" class="">Much thanks</span></div><div class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></div><div class=""><span style="white-space: pre-wrap;" class="">YUAN</span></div></div>
</blockquote></div><br clear="all" class=""><div class=""><br class=""></div>-- <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="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class=""></div></div></div></div></div></div></div></div>
</div></blockquote></div><br class=""></div></body></html>