[petsc-users] snes linesearch bt vs basic?
Matthew Knepley
knepley at gmail.com
Mon Feb 1 19:12:22 CST 2016
On Mon, Feb 1, 2016 at 6:22 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> > On Feb 1, 2016, at 4:45 PM, Xiangdong <epscodes at gmail.com> wrote:
> >
> >
> >
> > On Mon, Feb 1, 2016 at 5:26 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> >
> > > On Feb 1, 2016, at 2:16 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> > >
> > >
> > >> On Feb 1, 2016, at 1:46 PM, Xiangdong <epscodes at gmail.com> wrote:
> > >>
> > >> Hello everyone,
> > >>
> > >> I have a question on snes with line search. Under what circumstance,
> applying the (globalized) line search can perform WORSE than without line
> search (i.e. full newton step ls type basic)?
> > >>
> > >> When I apply snes with my problem, I found that at some time steps,
> snes diverges with linesearch_bt, but can converge with linesearch_basic
> (using same initial guess). For the same problem, there are also some
> steps, at which linearsearch_basic fails, but linesearch_bt converges.
> > >
> > > Here are you referring to "time steps"? When doing time stepping,
> depending on the evolution of the equations, the nonlinear systems can
> become more difficult to solver or easier to solve. One can often adjust
> the time-step size to make sure the nonlinear equations are never to
> difficult. So for example if the nonlinear solver is taking more than, say,
> 10 Newton steps, or is failing, decrease the timestep by some factor and
> try again. If the nonlinear solver needs only 1 or 2 Newton steps one can
> try increasing the time-step. Ideally this is also done in conjunction with
> an ODE error estimator to control the error by adjusting the timestep. Some
> of the PETSc implicit TS ODE integrators do this automatically. Generally
> adjusting the timestep is a more reliable way to insure convergence than
> trying to produce a completely robust nonlinear solver (as Matt points out
> if you did develop a completely robust nonlinear solver you could retire on
> your fame).
> >
> > Of course this will not always work, if the solution develops a
> singularity in finite time or is "really nasty" the time-step could be
> driven to zero; but having a more robust nonlinear solver won't help in
> that situation either.
> >
> > Actually my problem is not that ill-conditioned. Here is my situation.
> Let us say at time step n the snes_linesearch_basic failed. I have at least
> two options now: i) cut the dt immediately, ii) switch to
> snes_linesearch_bt with the same dt. Sometimes, switching to a different
> linesearch method without cutting dt will make snes converge, but sometimes
> not (then I need to cut dt, which is bad since more nonlinear iterations
> were wasted). Based on what you mentioned, it is impossible to decide which
> option is good and I just need to simply pick one.
>
> SNESLineSearch_Basic simply does the full Newton step regardless of
> whether it decreases or increases the function value. IMHO if basic
> converges while bt does not then this is just blind luck; not that basic
> was "better" for that configuration. I would just stick to bt and adjust
> the dt accordingly.
>
I will note that 'nleqerr' is a new line search that performs considerably
better than 'bt' which was added by Patrick Farrell of Oxford. I would
give this a try if bt is failing.
Thanks,
Matt
> Barry
>
> >
> > Thanks.
> >
> > Xiangdong
> >
> >
> >
> > Barry
> >
> > >
> > > Barry
> > >
> > >
> > >> Is there a general guide line to decide whether linesearch should be
> used?
> > >>
> > >> Thanks.
> > >>
> > >> Xiangdong
> > >
> >
> >
>
>
--
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/20160201/3333372a/attachment-0001.html>
More information about the petsc-users
mailing list