# SNESSetInitialFunction
Sets the function vector to be used as the initial function value at the initialization of the method.  In some instances, the user has precomputed the function before calling `SNESSolve()`.  This function allows one to avoid a redundant call to `SNESComputeFunction()` in that case. 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESSetInitialFunction(SNES snes, Vec f)
```
Logically Collective


## Input Parameters

- ***snes -*** the `SNES` context
- ***f -*** vector to store function value



## Notes
This should not be modified during the solution procedure.

This is used extensively in the `SNESFAS` hierarchy and in nonlinear preconditioning.




## See Also
 `SNES`, `SNESFAS`, `SNESSetFunction()`, `SNESComputeFunction()`, `SNESSetInitialFunctionNorm()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/interface/snes.c.html#SNESSetInitialFunction">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)  
