[petsc-users] Two questions regarding SNESLinesearchPrecheck
David Knezevic
david.knezevic at akselos.com
Tue Mar 8 10:47:42 CST 2022
OK, that's clear, thank you!
David
On Tue, Mar 8, 2022 at 11:43 AM Jed Brown <jed at jedbrown.org> wrote:
> I think SNESLineSearchApply_Basic will clarify these points. Note that the
> pre-check is applied before "taking the step", so X is x_k. You're right
> that the sign is flipped on search direction Y, as it's using -lambda below.
>
> /* precheck */
> ierr = SNESLineSearchPreCheck(linesearch,X,Y,&changed_y);CHKERRQ(ierr);
>
> /* update */
> ierr = VecWAXPY(W,-lambda,Y,X);CHKERRQ(ierr);
> [...]
> ierr = VecCopy(W, X);CHKERRQ(ierr);
>
> David Knezevic <david.knezevic at akselos.com> writes:
>
> > We're using SNESLinesearchPrecheck in order to implement some nonlinear
> > continuation methods, and we had a couple of questions:
> >
> > 1. The "search direction" that is handed to the pre-check function is
> > referred to as "y" in the documentation. We had assumed that we would
> have
> > "y = delta_x_k", where delta_x_k is as shown in the attached screenshot
> > from the PETSc manual. But after doing some testing it seems that in fact
> > we have "y = -delta_x_k", i.e. y is the NEGATIVE of the Newton step. Is
> > this correct?
> >
> > 2. In the documentation for SNESLineSearchPreCheck it says that "x" is
> the
> > "current solution". Referring again to the attached screenshot, does this
> > mean that it's x_k+1 or x_k? I assume it means x_k+1 but I wanted to
> > confirm this.
> >
> > Thanks for your help!
> >
> > Regards,
> > David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220308/0ce26d09/attachment.html>
More information about the petsc-users
mailing list