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

Phlipot, Greg Greg.Phlipot at jhuapl.edu
Thu Apr 21 07:52:50 CDT 2022


I wish I could give you an definitive reason why, but I can't. Before
TS gets into this situtation where it needs to take a tiny time step,
TS takes time steps of ~1.0, and the shift in TSSetIJacobian is ~1.0.
Then it gets really close to the max time and the time step drops to
~1e-12 and the shift in TSSetIJacobian becomes ~1e12.

When this happens, my ILU-preconditioned gmres linear solve converges
in a single interation, and the backtracking line search in my newton
solver fails.

Thank you,Greg


On Thu, 2022-04-21 at 00:57 +0000, Zhang, Hong wrote:
> APL external email warning: Verify sender hongzhang at anl.gov before
> clicking links or attachments 
> 
> 
> 
> > 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