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

Phlipot, Greg Greg.Phlipot at jhuapl.edu
Wed Apr 20 15:58:44 CDT 2022


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.

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