# MatFDColoringSetFromOptions
Sets coloring finite difference parameters from the options database. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatFDColoringSetFromOptions(MatFDColoring matfd)
```
Collective

The Jacobian, F'(u), is estimated with the differencing approximation
```none
       F'(u)_{:,i} = [F(u+h*dx_{i}) - F(u)]/h where
       h = error_rel*u[i]                 if  abs(u[i]) > umin
         = +/- error_rel*umin             otherwise, with +/- determined by the sign of u[i]
       dx_{i} = (0, ... 1, .... 0)
```



## Input Parameter

- ***coloring -*** the coloring context



## Options Database Keys

- ***-mat_fd_coloring_err <err> -*** Sets <err> (square root of relative error in the function)
- ***-mat_fd_coloring_umin <umin> -*** Sets umin, the minimum allowable u-value magnitude
- ***-mat_fd_type -*** "wp" or "ds" (see MATMFFD_WP or MATMFFD_DS)
- ***-mat_fd_coloring_view -*** Activates basic viewing
- ***-mat_fd_coloring_view ::ascii_info -*** Activates viewing info
- ***-mat_fd_coloring_view draw -*** Activates drawing





## See Also
 `Mat`, `MatFDColoring`, `MatFDColoringCreate()`, `MatFDColoringView()`, `MatFDColoringSetParameters()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/matfd/fdmatrix.c.html#MatFDColoringSetFromOptions">src/mat/matfd/fdmatrix.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/tutorials/ex16.c.html">src/mat/tutorials/ex16.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex14.c.html">src/snes/tutorials/ex14.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/minsurf2.c.html">src/tao/unconstrained/tutorials/minsurf2.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/matfd/fdmatrix.c)


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