PetscErrorCode PETSCSNES_DLLEXPORT SNESLineSearchSet(SNES snes,PetscErrorCode (*func)(SNES,void*,Vec,Vec,Vec,Vec,Vec,PetscReal,PetscReal,PetscReal*,PetscReal*,PetscTruth*),void *lsctx)
snes | - nonlinear context obtained from SNESCreate() | |
lsctx | - optional user-defined context for use by line search | |
func | - pointer to int function |
Collective on SNES
SNESLineSearchCubic() | - default line search | |
SNESLineSearchQuadratic() | - quadratic line search | |
SNESLineSearchNo() | - the full Newton step (actually not a line search) | |
SNESLineSearchNoNorms() | - the full Newton step (calculating no norms; faster in parallel) |
-snes_ls [cubic,quadratic,basic,basicnonorms] | - Selects line search | |
-snes_ls_alpha <alpha> | - Sets alpha | |
-snes_ls_maxstep <maxstep> | - Sets maximum step the line search will use (if the 2-norm(y) > maxstep then scale y to be y = (maxstep/2-norm(y)) *y) | |
-snes_ls_minlambda <minlambda> | - Sets the minimum lambda the line search will use minlambda / max_i ( y[i]/x[i] ) |
func (SNES snes,void *lsctx,Vec x,Vec f,Vec g,Vec y,Vec w,PetscReal fnorm,PetscReal xnorm,PetscReal *ynorm,PetscReal *gnorm,PetscTruth *flag)
snes | - nonlinear context | |
lsctx | - optional user-defined context for line search | |
x | - current iterate | |
f | - residual evaluated at x | |
y | - search direction | |
w | - work vector | |
fnorm | - 2-norm of f |
g | - residual evaluated at new iterate y | |
w | - new iterate | |
gnorm | - 2-norm of g | |
ynorm | - 2-norm of search length | |
flag | - set to PETSC_TRUE if the line search succeeds; PETSC_FALSE on failure. |
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