[petsc-users] Aborting outer iterations when inner iterations reach maxits fieldsplit

Matthew Knepley knepley at gmail.com
Mon Feb 3 14:03:38 CST 2014


On Mon, Feb 3, 2014 at 1:51 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
> On Feb 3, 2014, at 12:58 PM, James MBewu <james.mbewu at gmail.com> wrote:
>
> > Hi all petsc gurus,
> >
> > I am solving Navier Stokes equations using Q2-Q1 elements via libmesh
> and using petsc fieldsplit schur complement etc for the solving I was
> wondering whether it was possible to abort the outer iterations of the
> solver if the inner solver reached a set maximum iterations. At the moment
> if I set the maximum iterations of the inner solver, then once that is
> reached, the outer iterations continue and another inner solve is
> performed. Essentially I would like to say "I can't solve the inner problem
> so let's just give up on the whole thing". Is there any (easy) way to do
> this?
>
>    When the outer and inner iterations are linear we don't currently have
> any way of handling. We call KSPSolve() on any inner solve (from the outer
> solve) and then blindly continue after that solve is "complete" regardless
> of the "quality" of the "inner" solver.
>
>    One way we could handle this is to always call KSPGetConvergedReason()
> after the "inner" solver and based on that value decide if the "outer"
> solve should be short circuited and marked as "did not converge".   What
> makes this nontrivial is that depending on the circumstances one may which
> to continue the "outer" solver or not and we need to leave flexibility of
> what to do in this situation and also propagate (or not depending on the
> circumstance) this "short circuit" business through several layers of
> "inner solvers".
>
>    This is a great question, PETSc gurus what do you think?
>

Okay, I was not thinking before. However, it shows how we handle this for
Newton. We make the enclosing
solver keep track of the failure of its subsolver and decide what to do.
This does allow you to fail a certain
number of times before signaling failure above.

I don't like this for nested solvers since it seems to make every solver
more complex. I would rather that there
was a generic solver switch that caused non-convergence to be reported as a
non-failure. This does not allow
us to keep track of how many happen, but it seems much simpler than making
all solvers reproduce the Newton
behavior. Also, I don't think there are any compelling reasons that you
want K failures.

  Matt


>    Barry
>
>
>
> >
> > Please advise, thanks,
> > James
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140203/25d09686/attachment.html>


More information about the petsc-users mailing list