Hi Matthew,

Thank you for the reply. But my question was really related to what Barry had 
said – the BT method will use the full step as long as it leads to some decease 
in the function norm. The full step does indeed satisfy this condition, but the 
BT method does not seem to be using the full step. Why?

Is it because the step value is larger than the default maxstep? I don’t know 
what that value is or how to find it.

-Justin

From: Matthew Knepley <knep...@gmail.com>
Date: Tuesday, March 7, 2023 at 9:16 AM
To: "Angus, Justin Ray" <ang...@llnl.gov>
Cc: Barry Smith <bsm...@petsc.dev>, "petsc-dev@mcs.anl.gov" 
<petsc-dev@mcs.anl.gov>
Subject: Re: [petsc-dev] SNESNEWTONLS

On Tue, Mar 7, 2023 at 12:03 PM Angus, Justin Ray via petsc-dev 
<petsc-dev@mcs.anl.gov<mailto:petsc-dev@mcs.anl.gov>> wrote:
Hi Barry,

Very helpful.

I’m still having some trouble with reconciling your answer to question number 2 
based on some recent observations I have had. I’ve shared 1 slide concerning 
that observation, which I will briefly describe below.

I have a code that uses petsc but also has a native JFNK solver that works in 
the standard textbook way and always uses the full newton step. I recently 
found that the SNES newton solver in petsc with default options was failing on 
step 1 of a simulation, while our native solver worked fine. The fix for petsc 
was to switch from backtracking line search to basic.

Based in the information in the slide, can you make sense of this behavior?

Sure. It is completely possible to converge using full steps when you do not 
converge using BT. All of the convergence proofs
are predicated on starting "close enough" to the solution. You can start far 
away, take full steps, and by chance get into the basin of
convergence. BT, that is trying to guarantee convergence, will fail. There are 
a very small number of cases for which we can
guarantee global convergence.

  Thanks,

     Matt

-Justin

From: Barry Smith <bsm...@petsc.dev<mailto:bsm...@petsc.dev>>
Date: Tuesday, March 7, 2023 at 8:52 AM
To: "Angus, Justin Ray" <ang...@llnl.gov<mailto:ang...@llnl.gov>>
Cc: "petsc-dev@mcs.anl.gov<mailto:petsc-dev@mcs.anl.gov>" 
<petsc-dev@mcs.anl.gov<mailto:petsc-dev@mcs.anl.gov>>
Subject: Re: [petsc-dev] SNESNEWTONLS



On Mar 7, 2023, at 11:36 AM, Angus, Justin Ray via petsc-dev 
<petsc-dev@mcs.anl.gov<mailto:petsc-dev@mcs.anl.gov>> wrote:

Hello,

I’ve been using the default newton line search nonlinear solver in petsc. I 
recently discovered that the default line search method is bt – backtracking. I 
have two questions.


  1.  How exactly does the backtracking line search use the L2 norm of the 
function to modify the newton step? What is the formula?

   
https://petsc.org/main/src/snes/linesearch/impls/bt/linesearchbt.c.html#SNESLINESEARCHBT<https://urldefense.us/v3/__https:/petsc.org/main/src/snes/linesearch/impls/bt/linesearchbt.c.html*SNESLINESEARCHBT__;Iw!!G2kpM7uM-TzIFchu!gRMzIDCT2gk_bmfyFDMW_2hqc18xUq_eOd-GQOXGkPsHzw_F01t55J_ab98JKVI$>


  1.
  2.  Why is backtracking default? I would think that the basic method, which 
is a standard Newton method, would be default.

   All SNES Newton line searches use the full Newton step if it satisfies the 
Wolf conditions (there is some decrease in the function norm) and if the full 
Newton step is selected there is no nontrivial extra costs from using a line 
search (since the line search is never done) so there is no reason not to 
default to using SNESLINESEARCHBT. While using ONLY the full-step there may not 
convergence for many situations.  Hence our default.






  1.

-Justin



--
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

https://www.cse.buffalo.edu/~knepley/<https://urldefense.us/v3/__http:/www.cse.buffalo.edu/*knepley/__;fg!!G2kpM7uM-TzIFchu!j3AGZCLzChJI9AkGBKcae0TA2fNh_B_Y_Isx1koEbyAOIQVPHznYaIG73_xzqJw$>

Reply via email to