<div dir="ltr"><div dir="ltr">On Wed, Feb 23, 2022 at 6:01 PM Alfredo J Duarte Gomez <<a href="mailto:aduarteg@utexas.edu">aduarteg@utexas.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 dir="ltr"><div>Good morning PETSC team,</div><div><br></div><div>I am currently using a TS object to advance a set of PDEs in time.</div><div><br></div><div>However, the computation of the Jacobian is quite expensive and I wish to reuse it across time steps if possible.</div><div><br></div><div>I am well aware of the options -snes_lag_jacobian and -snes_lag_jacobian_persists, but I do not quite understand how to combine them for what I want.</div><div><br></div><div>In summary I want to compute the Jacobian only at the beginning of a given time step, reuse that Jacobian for N time steps, and then recompute again at the beginning of the next time step. <br></div><div><br></div><div>With my current understanding I have been able to reuse it across time steps by recomputing every N snes iterations, however, this leads to recomputations in the middle of time steps which is not what I desire.</div></div></blockquote><div><br></div><div>I think the right way to handle this is for the TS to set the lag to (-2, persist) at each timestep where it wants a recompute. I think putting this</div><div>in a TSMonitor should work. Is that okay for you?</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>Thank you,</div><div><br></div><div>-Alfredo <br></div><div><br></div><div><br></div><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><font face="arial, sans-serif">Alfredo Duarte</font><div><font face="arial, sans-serif">Graduate Research Assistant</font></div><div><font face="arial, sans-serif">The University of Texas at Austin</font></div></div></div></div></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>