# SNESSetUpdate
Sets the general-purpose update function called at the beginning of every iteration of the nonlinear solve. Specifically it is called just before the Jacobian is "evaluated". 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESSetUpdate(SNES snes, PetscErrorCode (*func)(SNES, PetscInt))
```
Logically Collective on snes


## Input Parameters

- ***snes -*** The nonlinear solver context
- ***func -*** The function



## Calling sequence of func
```none
func (SNES snes, PetscInt step);
```


- ***step -*** The current step of the iteration





## Note
This is NOT what one uses to update the ghost points before a function evaluation, that should be done at the beginning of your function provided
to `SNESSetFunction()`, or `SNESSetPicard()`
This is not used by most users.

There are a varity of function hooks one many set that are called at different stages of the nonlinear solution process, see the functions listed below.


## See Also
 `SNES`, `SNESSolve()`, `SNESSetJacobian()`, `SNESSolve()`, `SNESLineSearchSetPreCheck()`, `SNESLineSearchSetPostCheck()`, `SNESNewtonTRSetPreCheck()`, `SNESNewtonTRSetPostCheck()`,
`SNESMonitorSet()`, `SNESSetDivergenceTest()`

## Level
advanced

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


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