int SNESSetLineSearchCheck(SNES snes,int (*func)(SNES,void*,Vec,PetscTruth*),void *checkctx)
snes | - nonlinear context obtained from SNESCreate() | |
func | - pointer to int function | |
checkctx | - optional user-defined context for use by step checking routine |
Collective on SNES
int func (SNES snes, void *checkctx, Vec x, PetscTruth *flag)where func returns an error code of 0 on success and a nonzero on failure.
snes | - nonlinear context | |
checkctx | - optional user-defined context for use by step checking routine | |
x | - current candidate iterate |
x | - current iterate (possibly modified) | |
flag | - flag indicating whether x has been modified (either PETSC_TRUE of PETSC_FALSE) |
SNESQuadraticLineSearch() and SNESCubicLineSearch() also accept the new iterate computed by the line search checking routine. In particular, these routines (1) compute a candidate iterate u_{i+1} as well as a candidate nonlinear function f(u_{i+1}), (2) pass control to the checking routine, and then (3) force a re-evaluation of f(u_{i+1}) if any changes were made to the candidate iterate in the checking routine (as indicated by flag=PETSC_TRUE). The overhead of this function re-evaluation can be very costly, so use this feature with caution!
Level:advanced
Location:src/snes/impls/ls/ls.c
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages