SNESGetLineSearch — PETSc 3.25.1 documentation

Skip to main content
`Ctrl`+`K`

# SNESGetLineSearch

Returns the line search associated with the `SNES`.

## Synopsis

    #include "petscsnes.h"
    #include "petscsnes.h"
    PetscErrorCode SNESGetLineSearch(SNES snes, SNESLineSearch *linesearch)

Not Collective

## Input Parameter

- snes - iterative context obtained from `SNESCreate()`

## Output Parameter

- linesearch - linesearch context

## Notes

It creates a default line search instance which can be configured as needed in case it has not been already set with `SNESSetLineSearch()`.

You can also use the options database keys `-snes_linesearch_*` to configure the line search. See `SNESLineSearchSetFromOptions()` for the possible options.

## See Also

SNES: Nonlinear Solvers, `SNESLineSearch`, `SNESSetLineSearch()`, `SNESLineSearchCreate()`, `SNESLineSearchSetFromOptions()`

## Level

beginner

## Location

src/snes/interface/snes.c

## Examples

src/ts/utils/dmplexlandau/tutorials/ex1f90.F90
src/snes/tutorials/ex1f.F90
src/ts/tutorials/ex22.c
src/snes/tutorials/ex15.c
src/ts/tutorials/ex22f.F90
src/ts/tutorials/ex27.c
src/snes/tutorials/ex3.c

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