:orphan:
# MatMFFDSetFunctioniBase
Sets the base vector for a single component function evaluation for a `MATMFFD` matrix
## Synopsis
```
#include "petscmat.h"
PetscErrorCode MatMFFDSetFunctioniBase(Mat mat, PetscErrorCode (*func)(void *, Vec))
```
Logically Collective
## Input Parameters
- ***mat -*** the `MATMFFD` matrix free matrix
- ***func -*** the function to use
## Notes
If you use this you MUST call `MatAssemblyBegin()` and `MatAssemblyEnd()` on the matrix free
matrix inside your compute Jacobian routine.
This function is necessary to compute the diagonal of the matrix, used for example with `PCJACOBI`
## See Also
[](ch_matrices), `Mat`, `MATMFFD`, `MatCreateSNESMF()`, `MatMFFDGetH()`, `MatCreateMFFD()`, `MATMFFD`
`MatMFFDSetHHistory()`, `MatMFFDResetHHistory()`, `SNESetFunction()`, `MatGetDiagonal()`
## Level
advanced
## Location
src/mat/impls/mffd/mffd.c
## Implementations
MatMFFDSetFunctioniBase_MFFD in src/mat/impls/mffd/mffd.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/mffd/mffd.c)
[Index of all Mat routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)