[petsc-dev] Recover from TS failure

Jed Brown jed at jedbrown.org
Wed Nov 1 21:30:49 CDT 2017

Mark Adams <mfadams at lbl.gov> writes:

> On Wed, Nov 1, 2017 at 8:30 PM, Jed Brown <jed at jedbrown.org> wrote:
>> Mark Adams <mfadams at lbl.gov> writes:
>> >>
>> >>
>> >>
>> >> The last relevant output you've shown me is SNES failing a bunch of
>> >> times as the adaptive controller attempts to shrink the step size and
>> >> retry.  If you fixed that problem, you need to tell me.  If not, THAT is
>> >> the problem you need to fix.
>> >>
>> >
>> > That is the problem I am trying to fix.
>> The solution to that isn't on the outside.
> Does the "inside" exist or is there simply not a proof that it does not
> exist?

I don't understand the question.  If SNES fails on iteration zero when
the step length is repeatedly shortened, there is something wrong with
your problem or initial condition.  The problem must be in your function
or Jacobian.  You aren't going to fix that by patching your own hokey
controller wrapped around the outside of TSStep.

>> > Note, I am also adapting the time step when the solver converges but
>> > talks a lot of iterations. Thus, no need for recovery.
>> You can encapsulate that in an adaptive controller or put the logic (to
>> get the SNES iteration number and decided whether to TSSetTimeStep) in
>> the TS PostStep function.
> That is what I do, and it is fine. It works well enough, I now am trying to
> deal with TS failure.

Wait, why is TS failing?  Still because SNES is failing repeatedly as
the step is rejected and retried with a shorter step?  You need to fix

>> > It is the SNES failure, recover, cut time step, try again, that I am
>> > working in now.
>> That is already running in the TSAdapt.  Your failure is a result of
>> something else.  Use -ts_adapt_monitor for more diagnostics about the
>> controller's decisions.
> I looked at TSAdapt for the first problem, of adapting when this look bad
> but work. 

Doesn't parse.

> It failed because its algo was not quite right for this problem.  So I
> put a simple algo in a post step method.

Can't do it from a post-step because stages fail before the step

> Can TSAdapt deal with a SNES failure, recover, cut time step, and rerun the
> step?


More information about the petsc-dev mailing list