:orphan:
# TaoSetJacobianDesignRoutine
Sets the function to compute the Jacobian of the constraint function with respect to the design variables.  Used only for PDE-constrained optimization. 
## Synopsis
```
#include "petsctao.h" 
PetscErrorCode TaoSetJacobianDesignRoutine(Tao tao, Mat J, PetscErrorCode (*func)(Tao, Vec, Mat, void *), void *ctx)
```
Logically Collective


## Input Parameters

- ***tao  -*** the `Tao` context
- ***J    -*** Matrix used for the Jacobian
- ***func -*** Jacobian evaluation routine
- ***ctx  -*** [optional] user-defined context for private data for the
Jacobian evaluation routine (may be `NULL`)



## Calling sequence of `func`
```none
PetscErrorCode func(Tao tao, Vec x, Mat J, void *ctx);
```

- ***tao -*** the `Tao` context
- ***x   -*** input vector
- ***J   -*** Jacobian matrix
- ***ctx -*** [optional] user-defined Jacobian context





## See Also
 [](ch_tao), `Tao`, `TaoComputeJacobianDesign()`, `TaoSetJacobianStateRoutine()`, `TaoSetStateDesignIS()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/interface/taosolver_hj.c.html#TaoSetJacobianDesignRoutine">src/tao/interface/taosolver_hj.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/pde_constrained/tutorials/elliptic.c.html">src/tao/pde_constrained/tutorials/elliptic.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/pde_constrained/tutorials/hyperbolic.c.html">src/tao/pde_constrained/tutorials/hyperbolic.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/pde_constrained/tutorials/parabolic.c.html">src/tao/pde_constrained/tutorials/parabolic.c</A><BR>


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


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