# SNESLineSearchSetPostCheck
Sets a user function that is called after the line search has been applied to determine the step direction and length. Allows the user a chance to change or override the decision of the line search routine 
## Synopsis
```
#include "petscsnes.h" 
PetscErrorCode SNESLineSearchSetPostCheck(SNESLineSearch linesearch, PetscErrorCode (*func)(SNESLineSearch, Vec, Vec, Vec, PetscBool *, PetscBool *, void *), void *ctx)
```
Logically Collective linesearch


## Input Parameters

- ***linesearch -*** the `SNESLineSearch` context
- ***func -*** [optional] function evaluation routine, see `SNESLineSearchPostCheck`  for the calling sequence
- ***ctx        -*** [optional] user-defined context for private data for the function evaluation routine (may be NULL)





## Notes
Use `SNESLineSearchSetPreCheck()` to change the step before the line search.
search is complete.

Use `SNESVISetVariableBounds()` and `SNESVISetComputeVariableBounds()` to cause `SNES` to automatically control the ranges of variables allowed.


## See Also
 `SNESLineSearch`, `SNESGetLineSearch()`, `SNESLineSearchPostCheck()`, `SNESLineSearchSetPreCheck()`, `SNESLineSearchGetPreCheck()`, `SNESLineSearchGetPostCheck()`,
`SNESVISetVariableBounds()`, `SNESVISetComputeVariableBounds()`, `SNESSetFunctionDomainError()`, `SNESSetJacobianDomainError()

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex3.c.html">src/snes/tutorials/ex3.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex27.c.html">src/ts/tutorials/ex27.c.html</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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
