# MatFDColoringApplyTS

Given a matrix for which a MatFDColoring context has been created, computes the Jacobian for a function via finite differences.

### Synopsis

    #include "petscmat.h"
    #include "petscda.h"
    PetscErrorCode PETSCMAT_DLLEXPORT MatFDColoringApplyTS(Mat J,MatFDColoring coloring,PetscReal t,Vec x1,MatStructure *flag,void *sctx)

Collective on Mat, MatFDColoring, and Vec

### Input Parameters

| mat | - location to store Jacobian
| coloring | - coloring context created with MatFDColoringCreate()
| x1 | - location at which Jacobian is to be computed
| sctx | - optional context required by function (actually a SNES context)

### Options Database Keys

-mat_fd_coloring_freq <freq> -Sets coloring frequency

### See Also

MatFDColoringCreate(), MatFDColoringDestroy(), MatFDColoringView()

### Keywords

coloring, Jacobian, finite differences

Level:intermediate
Location: src/mat/matfd/fdmatrix.c
Index of all MatFD routines
Table of Contents for all manual pages
Index of all manual pages