<div dir="ltr"><div dir="ltr">On Wed, Apr 20, 2022 at 5:13 PM Phlipot, Greg <<a href="mailto:Greg.Phlipot@jhuapl.edu">Greg.Phlipot@jhuapl.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">Hello,<br>
<br>
When using TS with the option TS_EXACT_FINALTIME_MATCHSTEP to force TS<br>
to stop at the final time, I'm seeing the adaptive step controller<br>
choose smaller time steps than the minimum time step that is set with<br>
TSAdaptGetStepLimits. For my problems, this leads to solutions that<br>
won't converge due to numerical issues.<br>
<br>
It seems like this might be due to the fact that TSAdaptChoose (<br>
<a href="https://petsc.org/main/src/ts/adapt/interface/tsadapt.c.html#TSAdaptChoose" rel="noreferrer" target="_blank">https://petsc.org/main/src/ts/adapt/interface/tsadapt.c.html#TSAdaptChoose</a><br>
) uses a tolerance of 10*PETSC_MACHINE_EPSILON to compare whether the<br>
candidate time step is close to the final time. For me,<br>
10*PETSC_MACHINE_EPSILON is much smaller than my smallest time step so<br>
the adaptation scheme occasionally chooses a time step that results in<br>
a time much closer to the max time than the minimum time step. The<br>
subsequent time step is therefore forced to be smaller than the minimum<br>
time step.<br>
<br>
Does anyone have an idea of a workaround (without changing the source<br>
code) where I would be able to modify this logic to use the minimum<br>
time step instead of 10*PETSC_MACHINE_EPSILON? E.g. with Pre/Post stage<br>
callbacks and manually modifying the time step?<br></blockquote><div><br></div><div>It seems that if you want to disallow small timesteps, but also match accurately a final time,</div><div>then the best choice is interpolation (TS_EXACTFINALTIME_INTERPOLATE). If you only</div><div>want to be as accurate as your timestep, shouldn't you just let it step over?</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">
Thank you,<br>
Greg<br>
</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>