# DMDATSSetIFunctionLocal
set a local residual evaluation function for use with `DMDA` 
## Synopsis
```
#include "petscdmda.h" 
#include "petscts.h" 
PetscErrorCode DMDATSSetIFunctionLocal(DM dm, InsertMode imode, DMDATSIFunctionLocal func, void *ctx)
```
Logically Collective


## Input Parameters

- ***dm   -*** `DM` to associate callback with
- ***func -*** local residual evaluation
- ***ctx  -*** optional context for local residual evaluation



## Calling sequence for func

- ***info -*** `DMDALocalInfo` defining the subdomain to evaluate the residual on
- ***t    -*** time at which to evaluate residual
- ***x    -*** array of local state information
- ***xdot -*** array of local time derivative information
- ***f    -*** output array of local function evaluation information
- ***ctx -*** optional context passed above





## See Also
 [](chapter_ts), `DMDA`, `DMTSSetIFunction()`, `DMDATSSetIJacobianLocal()`, `DMDASNESSetFunctionLocal()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/utils/dmdats.c.html#DMDATSSetIFunctionLocal">src/ts/utils/dmdats.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex26.c.html">src/ts/tutorials/ex26.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex29.c.html">src/ts/tutorials/ex29.c.html</A><BR>


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