MatFDColoringSetFunction
Sets the function to use for computing the Jacobian.
Synopsis
#include "petscmat.h"
PetscErrorCode MatFDColoringSetFunction(MatFDColoring matfd,PetscErrorCode (*f)(void),void *fctx)
Logically Collective on MatFDColoring
Input Parameters
| coloring | - the coloring context
|
| f | - the function
|
| fctx | - the optional user-defined function context
|
Calling sequence of (*f) function
For SNES: PetscErrorCode (*f)(SNES,Vec,Vec,void*)
For TS: PetscErrorCode (*f)(TS,PetscReal,Vec,Vec,void*)
If not using SNES or TS: PetscErrorCode (*f)(void *dummy,Vec,Vec,void*) and dummy is ignored
Notes: This function is usually used automatically by SNES or TS (when one uses SNESSetJacobian() with the argument
SNESDefaultComputeJacobianColor() or TSSetRHSJacobian() with the argument TSDefaultComputeJacobianColor()) and only needs to be used
by someone computing a matrix via coloring directly by calling MatFDColoringApply()
Fortran Notes
In Fortran you must call MatFDColoringSetFunction() for a coloring object to
be used without SNES or TS or within the SNES solvers and MatFDColoringSetFunctionTS() if it is to be used
within the TS solvers.
Keywords
Mat, Jacobian, finite differences, set, function
See Also
MatFDColoringCreate(), MatFDColoringGetFunction(), MatFDColoringSetFromOptions()
Level:advanced
Location:src/mat/matfd/fdmatrix.c
Index of all MatFD routines
Table of Contents for all manual pages
Index of all manual pages
Examples
src/snes/examples/tutorials/ex5s.c.html
src/snes/examples/tutorials/ex14.c.html
src/snes/examples/tutorials/ex26.c.html
src/snes/examples/tutorials/ex45.c.html
src/ts/examples/tutorials/ex7.c.html
src/ts/examples/tutorials/ex10.c.html
src/ts/examples/tutorials/ex12.c.html
src/ts/examples/tutorials/ex13.c.html
src/ts/examples/tutorials/ex15.c.html
src/ts/examples/tutorials/ex17.c.html