:orphan:
# SNESLineSearchReason
indication if the line search has succeeded or failed and why 
## Synopsis
```
typedef enum {
  SNES_LINESEARCH_SUCCEEDED,
  SNES_LINESEARCH_FAILED_NANORINF,
  SNES_LINESEARCH_FAILED_DOMAIN,
  SNES_LINESEARCH_FAILED_REDUCT, /* INSUFFICIENT REDUCTION */
  SNES_LINESEARCH_FAILED_USER,
  SNES_LINESEARCH_FAILED_FUNCTION
} SNESLineSearchReason;
```

## Values

- ***`SNES_LINESEARCH_SUCCEEDED` -*** the line search succeeded
- ***`SNES_LINESEARCH_FAILED_NANORINF` -*** a not a number of infinity appeared in the computions
- ***`SNES_LINESEARCH_FAILED_DOMAIN` -*** the function was evaluated outside of its domain, see `SNESSetFunctionDomainError()` and `SNESSetJacobianDomainError()`
- ***`SNES_LINESEARCH_FAILED_REDUCT` -*** the linear search failed to get the requested decrease in its norm or objective
- ***`SNES_LINESEARCH_FAILED_USER` -*** used by `SNESLINESEARCHNLEQERR` to indicate the user changed the search direction inappropriately
- ***`SNES_LINESEARCH_FAILED_FUNCTION` -*** indicates the maximum number of function evaluations allowed has been surpassed, `SNESConvergedReason` is also
set to `SNES_DIVERGED_FUNCTION_COUNT`





## Developer Note
Some of these reasons overlap with values of `SNESConvergedReason`


## See Also
 [](ch_snes), `SNES`, `SNESSolve()`, `SNESGetConvergedReason()`, `KSPConvergedReason`, `SNESSetConvergenceTest()`,
`SNESSetFunctionDomainError()` and `SNESSetJacobianDomainError()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscsnes.h.html#SNESLineSearchReason">include/petscsnes.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscsnes.h)


[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)  
