[petsc-users] TSAdapt minimum step and exact final time

Zhang, Hong hongzhang at anl.gov
Wed Apr 20 19:57:09 CDT 2022



> On Apr 20, 2022, at 3:58 PM, Phlipot, Greg <Greg.Phlipot at jhuapl.edu> wrote:
> 
> Hello,
> 
> When using TS with the option TS_EXACT_FINALTIME_MATCHSTEP to force TS
> to stop at the final time, I'm seeing the adaptive step controller
> choose smaller time steps than the minimum time step that is set with
> TSAdaptGetStepLimits. For my problems, this leads to solutions that
> won't converge due to numerical issues.

Can you please elaborate a bit on why the solution diverges when using a small step size?

Thanks,
Hong (Mr.)

> 
> It seems like this might be due to the fact that TSAdaptChoose (
> https://petsc.org/main/src/ts/adapt/interface/tsadapt.c.html#TSAdaptChoose
> ) uses a tolerance of 10*PETSC_MACHINE_EPSILON to compare whether the
> candidate time step is close to the final time. For me,
> 10*PETSC_MACHINE_EPSILON is much smaller than my smallest time step so
> the adaptation scheme occasionally chooses a time step that results in
> a time much closer to the max time than the minimum time step. The
> subsequent time step is therefore forced to be smaller than the minimum
> time step.
> 
> Does anyone have an idea of a workaround (without changing the source
> code) where I would be able to modify this logic to use the minimum
> time step instead of 10*PETSC_MACHINE_EPSILON? E.g. with Pre/Post stage
> callbacks and manually modifying the time step?
> 
> Thank you,
> Greg



More information about the petsc-users mailing list