SNESSetLineSearch

Sets the line search routine to be used by the method SNES_EQ_LS.

Synopsis

int SNESSetLineSearch(SNES snes,int (*func)(SNES,Vec,Vec,Vec,Vec,Vec,
                             double,double*,double*,int*))

Input Parameters

snes - nonlinear context obtained from SNESCreate()
func - pointer to int function

Collective on SNES

Available Routines

SNESCubicLineSearch() - default line search
SNESQuadraticLineSearch() - quadratic line search
SNESNoLineSearch() - the full Newton step (actually not a line search)
SNESNoLineSearchNoNorms() - use the full Newton step (calculate no norms; faster in parallel)

Options Database Keys

-snes_eq_ls [basic,quadratic,cubic] - Selects line search
-snes_eq_ls_alpha <alpha> - Sets alpha
-snes_eq_ls_maxstep <max> - Sets maxstep
-snes_eq_ls_steptol <steptol> - Sets steptol

Calling sequence of func

   func (SNES snes, Vec x, Vec f, Vec g, Vec y, Vec w,
         double fnorm, double *ynorm, double *gnorm, *flag)

Input parameters for func

snes - nonlinear context
x - current iterate
f - residual evaluated at x
y - search direction (contains new iterate on output)
w - work vector
fnorm - 2-norm of f

Output parameters for func

g - residual evaluated at new iterate y
y - new iterate (contains search direction on input)
gnorm - 2-norm of g
ynorm - 2-norm of search length
flag - set to 0 if the line search succeeds; a nonzero integer on failure.

Keywords

SNES, nonlinear, set, line search, routine

See Also

SNESNoLineSearch(), SNESQuadraticLineSearch(), SNESCubicLineSearch()

Location: src/snes/impls/ls/ls.c
SNES Index
Table of Contents