# SNESNewtonTRSetPreCheck
Sets a user function that is called before the search step has been determined. Allows the user a chance to change or override the decision of the line search routine. 
## Synopsis
```
#include "petscsnes.h"   
PetscErrorCode SNESNewtonTRSetPreCheck(SNES snes, PetscErrorCode (*func)(SNES, Vec, Vec, PetscBool *, void *), void *ctx)
```
Deprecated use `SNESNEWTONDCTRDC`

Logically Collective


## Input Parameters

- ***snes -*** the nonlinear solver object
- ***func -*** [optional] function evaluation routine, see `SNESNewtonTRPreCheck()`  for the calling sequence
- ***ctx  -*** [optional] user-defined context for private data for the function evaluation routine (may be NULL)





## Note
This function is called BEFORE the function evaluation within the `SNESNEWTONTR` solver.


## See Also
 `SNESNEWTONDCTRDC`, `SNESNEWTONDCTR`, `SNESNewtonTRPreCheck()`, `SNESNewtonTRGetPreCheck()`, `SNESNewtonTRSetPostCheck()`, `SNESNewtonTRGetPostCheck()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/tr/tr.c.html#SNESNewtonTRSetPreCheck">src/snes/impls/tr/tr.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/impls/tr/tr.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)  
