:orphan:
# DMPlexSNESComputeJacobianFEM
Form the local portion of the Jacobian matrix `Jac` at the local solution `X` using pointwise functions specified by the user. 
## Synopsis
```
#include "petscdmplex.h" 
#include "petscsnes.h"   
PetscErrorCode DMPlexSNESComputeJacobianFEM(DM dm, Vec X, Mat Jac, Mat JacP, void *user)
```

## Input Parameters

- ***dm -*** The `DM`
- ***X  -*** Local input vector
- ***user -*** The user context



## Output Parameters

- ***Jac  -*** Jacobian matrix
- ***JacP -*** approximate Jacobian from which the preconditioner will be built, often `Jac`





## Note
We form the residual one batch of elements at a time. This allows us to offload work onto an accelerator,
like a GPU, or vectorize on a multicore machine.


## See Also
 `DMPLEX`, `Mat`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/utils/dmplexsnes.c.html#DMPlexSNESComputeJacobianFEM">src/snes/utils/dmplexsnes.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/tutorials/ex3.c.html">src/tao/tutorials/ex3.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/utils/dmplexsnes.c)


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