[petsc-users] Reusing pseudo time-stepper

zakaryah zakaryah at gmail.com
Mon Jun 25 15:55:27 CDT 2018


I'm interested in using a time-stepper to solve problems arising from
multiple data sets (external forces).  Currently, I do the following:

TSCreate
TSSetProblemType
TSSetSolution
TSSetDM
TSSetRHSFunction
TSSetRHSJacobian
TSSetType
TSSetMaxSteps
TSSetMaxTime
TSSetExactFinalTime
TSSetMaxStepRejections

then, inside the loop over different data sets:

TSSetTimeStep
TSPseudoSetTimeStepIncrement
TSSetTime        (to zero)
TSSetStepNumber    (to zero)
TSSetUp
TSSolve

This seems to be working, but the step increment behaves oddly on every
loop iteration after the first.  Regardless of what I set the time step to,
the first TSSolve iteration makes a step which is about twelve orders of
magnitude smaller than the specified dt, and from that point on, the
controller multiplies every step size by the specified pseudo time step
increment (1.5), up until the very end, at which point the multiplier
becomes very large as expected near convergence.

If I create, set up, and destroy the TS in each iteration of the loop, the
behavior is as expected, i.e. the first step is almost always by the
specified dt.  Is there additional information inside the TS that I need to
reset?  Is it a bad idea to reuse a TS?

A couple tangential questions - I don't seem to be getting any output from
-ts_adapt_monitor, and calling TSSetMaxStepRejections(ts,(PetscInt)-1)
seems to set the maximum number of accepted step rejections to zero, rather
than to unlimited, as specified by the documentation.

Thanks for any help you can provide!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180625/0acb217d/attachment.html>


More information about the petsc-users mailing list