# SNESTSFormFunction
Function to evaluate nonlinear residual 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode SNESTSFormFunction(SNES snes, Vec U, Vec F, void *ctx)
```
Logically Collective


## Input Parameters

- ***snes -*** nonlinear solver
- ***U -*** the current state at which to evaluate the residual
- ***ctx -*** user context, must be a TS



## Output Parameter

- ***F -*** the nonlinear residual





## Note
This function is not normally called by users and is automatically registered with the `SNES` used by `TS`.
It is most frequently passed to `MatFDColoringSetFunction()`.


## See Also
 [](chapter_ts), `SNESSetFunction()`, `MatFDColoringSetFunction()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/ts.c.html#SNESTSFormFunction">src/ts/interface/ts.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/arkimex/arkimex.c.html#SNESTSFormFunction_ARKIMEX">SNESTSFormFunction_ARKIMEX in src/ts/impls/arkimex/arkimex.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/bdf/bdf.c.html#SNESTSFormFunction_BDF">SNESTSFormFunction_BDF in src/ts/impls/bdf/bdf.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/eimex/eimex.c.html#SNESTSFormFunction_EIMEX">SNESTSFormFunction_EIMEX in src/ts/impls/eimex/eimex.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/explicit/rk/rk.c.html#SNESTSFormFunction_RK">SNESTSFormFunction_RK in src/ts/impls/explicit/rk/rk.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/glee/glee.c.html#SNESTSFormFunction_GLEE">SNESTSFormFunction_GLEE in src/ts/impls/glee/glee.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/implicit/alpha/alpha1.c.html#SNESTSFormFunction_Alpha">SNESTSFormFunction_Alpha in src/ts/impls/implicit/alpha/alpha1.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/implicit/alpha/alpha2.c.html#SNESTSFormFunction_Alpha">SNESTSFormFunction_Alpha in src/ts/impls/implicit/alpha/alpha2.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/implicit/discgrad/tsdiscgrad.c.html#SNESTSFormFunction_DiscGrad">SNESTSFormFunction_DiscGrad in src/ts/impls/implicit/discgrad/tsdiscgrad.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/implicit/glle/glle.c.html#SNESTSFormFunction_GLLE">SNESTSFormFunction_GLLE in src/ts/impls/implicit/glle/glle.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/implicit/irk/irk.c.html#SNESTSFormFunction_IRK">SNESTSFormFunction_IRK in src/ts/impls/implicit/irk/irk.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/implicit/theta/theta.c.html#SNESTSFormFunction_Theta">SNESTSFormFunction_Theta in src/ts/impls/implicit/theta/theta.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/mimex/mimex.c.html#SNESTSFormFunction_Mimex">SNESTSFormFunction_Mimex in src/ts/impls/mimex/mimex.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/pseudo/posindep.c.html#SNESTSFormFunction_Pseudo">SNESTSFormFunction_Pseudo in src/ts/impls/pseudo/posindep.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/rosw/rosw.c.html#SNESTSFormFunction_RosW">SNESTSFormFunction_RosW in src/ts/impls/rosw/rosw.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/interface/ts.c)


[Index of all TS routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
