# SNESComputeFunction
Calls the function that has been set with `SNESSetFunction()`. 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESComputeFunction(SNES snes, Vec x, Vec y)
```
Collective


## Input Parameters

- ***snes -*** the `SNES` context
- ***x -*** input vector



## Output Parameter

- ***y -*** function vector, as set by `SNESSetFunction()`



## Note
`SNESComputeFunction()` is typically used within nonlinear solvers
implementations, so users would not generally call this routine themselves.




## See Also
 `SNES`, `SNESSetFunction()`, `SNESGetFunction()`, `SNESComputeMFFunction()`

## Level
developer

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex12.c.html">src/snes/tutorials/ex12.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex1f.F90.html">src/snes/tutorials/ex1f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex22.c.html">src/snes/tutorials/ex22.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex63.c.html">src/snes/tutorials/ex63.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex77.c.html">src/snes/tutorials/ex77.c.html</A><BR>


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