:orphan:
# SNESLineSearchGetSNES
Gets the `SNES` instance associated with the line search. Having an associated `SNES` is necessary because most line search implementations must be able to evaluate the function using `SNESComputeFunction()` for the associated `SNES`.  This routine is used in the line search implementations when one must get this associated `SNES` instance. 
## Synopsis
```
#include "petscsnes.h" 
PetscErrorCode SNESLineSearchGetSNES(SNESLineSearch linesearch, SNES *snes)
```
Not Collective


## Input Parameter

- ***linesearch -*** linesearch context



## Output Parameter

- ***snes -*** The `SNES` instance





## See Also
 `SNESLineSearch`, `SNESType`, `SNESLineSearchGetSNES()`, `SNESLineSearchSetVecs()`, `SNES`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/linesearch/interface/linesearch.c.html#SNESLineSearchGetSNES">src/snes/linesearch/interface/linesearch.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex15.c.html">src/snes/tutorials/ex15.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex1f.F90.html">src/snes/tutorials/ex1f.F90</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex3.c.html">src/snes/tutorials/ex3.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex27.c.html">src/ts/tutorials/ex27.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/linesearch/interface/linesearch.c)


[Index of all SNES routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
