[petsc-dev] TSStartingMethod_GLEE

Emil Constantinescu emconsta at mcs.anl.gov
Sun Apr 30 15:27:59 CDT 2017

On 4/30/17 2:54 PM, Lisandro Dalcin wrote:
> Emil, you added the slot ts->ops->startingmethod, which currently is
> just used for TSStartingMethod_GLEE(). The slot
> ts->ops->startingmethod is called in TSSetUp()
> Could you please explain what's the pourpose of
> ts->ops->startingmethod ? TSStartingMethod_GLEE() is so simple that I
> cannot figure out without digging deep in the GLEE implementation.

GLEE is an extension of general linear (GL) methods that includes error 
propagation. BDF, RK, and all other linear methods are particular cases 
of GL. All GL methods have a starting procedure and a finishing one. 
GLEE is even more complex as it's doing more than just solve the 
problem. We need the starting procedure to set the solutions (two 
solutions or solution and error vectors) in the right place. Currently 
it's a linear operation but it may be something else. I believe I 
explain it in the doc but I cannot find it now, the GLEE doc is not 
built - I'll check on that.

> If it is for what I think, I'm afraid that your approach will not work
> in general, and particularly in the case of handling TSEvent, where
> discontinuities in the solution may be introduced, and you have to
> start the time integration almost from scratch discarding previous
> history (e.g. in the case of BDF go back to BDF-1).

I agree. Events are trickier with GL and GLEE. Currently, it's more 
important to have more robust methods than to handle events. Discarding 
the history is not an option with GLEEs - it's possible to start cold, 
but highly suboptimal.

> Look at BDF, you most likely want to use the ts->steprestart flag to
> figure out whether you should use a starting method. I spent quite a
> bit of time making sure the ts->steprestart flag is handled
> appropriately in the case of initial step or TSEvent, and unless
> someone broke it recently, it should be doing the job.
> Also look at BDF or RK, you may need to handle appropriately the
> ts->steprollback flag, in the case of RK I'm querying the flag to
> disable the FSAL optimization. In general, if ts-rollback turns is
> TRUE, some cached values in your TS subtype may get outdated and you
> have to handle this case appropriately.

The GLEEs that are currently implemented don't need anything special for 
rollback. I'll check the logic again.

> Finally, if the ts->steprestart flag is actually enough, please update
> GLEE and remove ASAP the ts->ops->startingmethod slot to prevent
> accumulation of cruft.
> static PetscErrorCode TSStep_BDF(TS ts)
> {
>    ...
>    while (!ts->reason ...) {
>      if (ts->steprestart) {
>        ierr = TSBDF_Restart(ts,&stageok);CHKERRQ(ierr);
>        ...
>      }
>    ...
>    }

Start and restart are not the same. Start sets up the solutions, restart 
set up the solution or tells the integrator to drop the history.

Thanks for looking into this,


More information about the petsc-dev mailing list