SNESLineSearchType — PETSc 3.25.2 documentation

Skip to main content
`Ctrl`+`K`

# SNESLineSearchType

String with the name of a PETSc line search method `SNESLineSearch`. Provides all the linesearches for the nonlinear solvers, `SNES`, in PETSc.

## Synopsis

    typedef const char *SNESLineSearchType;
    #define SNESLINESEARCHBT        "bt"
    #define SNESLINESEARCHNLEQERR   "nleqerr"
    #define SNESLINESEARCHBASIC     "basic"
    #define SNESLINESEARCHNONE      "none"
    #define SNESLINESEARCHSECANT    "secant"
    #define SNESLINESEARCHL2        PETSC_DEPRECATED_MACRO(3, 24, 0, "SNESLINESEARCHSECANT", ) "secant"
    #define SNESLINESEARCHCP        "cp"
    #define SNESLINESEARCHSHELL     "shell"
    #define SNESLINESEARCHNCGLINEAR "ncglinear"
    #define SNESLINESEARCHBISECTION "bisection"

## Values

- `SNESLINESEARCHBASIC` - (or equivalently `SNESLINESEARCHNONE`) Simple damping line search, defaults to using the full Newton step

- `SNESLINESEARCHBT` - Backtracking line search over the L2 norm of the function or an objective function

- `SNESLINESEARCHSECANT` - Secant line search over the L2 norm of the function or an objective function

- `SNESLINESEARCHCP` - Critical point secant line search assuming \(F(x) = \nabla G(x)\) for some unknown \(G(x)\)

- `SNESLINESEARCHNLEQERR` - Affine-covariant error-oriented linesearch

- `SNESLINESEARCHBISECTION` - bisection line search for a root in the directional derivative

- `SNESLINESEARCHSHELL` - User provided `SNESLineSearch` implementation

## Note

Use `SNESLineSearchSetType()` or the options database key `-snes_linesearch_type` to set the specific line search algorithm to use with a given `SNES` object. Not all `SNESType` can utilize a line search.

## See Also

SNES: Nonlinear Solvers, `SNESLineSearch`, `SNESLineSearchSetType()`, `SNES`

## Level

beginner

## Location

include/petscsnes.h

Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages