# MatFDColoringSetUp
Sets up the internal data structures of matrix coloring context for the later use. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatFDColoringSetUp(Mat mat, ISColoring iscoloring, MatFDColoring color)
```
Collective


## Input Parameters

- ***mat -*** the matrix containing the nonzero structure of the Jacobian
- ***iscoloring -*** the coloring of the matrix; usually obtained with `MatGetColoring()` or `DMCreateColoring()`
- ***color -*** the matrix coloring context





## Notes
When the coloring type is `IS_COLORING_LOCAL` the coloring is in the local ordering of the unknowns.


## See Also
 `Mat`, `MatFDColoring`, `MatFDColoringCreate()`, `MatFDColoringDestroy()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/matfd/fdmatrix.c.html#MatFDColoringSetUp">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>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/mpi/fdmpiaij.c.html#MatFDColoringSetUp_MPIXAIJ">MatFDColoringSetUp_MPIXAIJ in src/mat/impls/aij/mpi/fdmpiaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/seq/fdaij.c.html#MatFDColoringSetUp_SeqXAIJ">MatFDColoringSetUp_SeqXAIJ in src/mat/impls/aij/seq/fdaij.c</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)  
