petsc-3.3-p7 2013-05-11

SNESDefaultComputeJacobianColor

Computes the Jacobian using finite differences and coloring to exploit matrix sparsity.

Synopsis

#include "petscsnes.h"  
PetscErrorCode  SNESDefaultComputeJacobianColor(SNES snes,Vec x1,Mat *J,Mat *B,MatStructure *flag,void *ctx)
Collective on SNES

Input Parameters

snes - nonlinear solver object
x1 - location at which to evaluate Jacobian
ctx - coloring context, where ctx must have type MatFDColoring, as created via MatFDColoringCreate()

Output Parameters

J - Jacobian matrix (not altered in this routine)
B - newly computed Jacobian matrix to use with preconditioner (generally the same as J)
flag - flag indicating whether the matrix sparsity structure has changed

Keywords

SNES, finite differences, Jacobian, coloring, sparse

See Also

SNESSetJacobian(), SNESTestJacobian(), SNESDefaultComputeJacobian()
MatFDColoringCreate(), MatFDColoringSetFunction()

Level:intermediate
Location:
src/snes/interface/snesj2.c
Index of all SNES 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/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
src/ts/examples/tutorials/ex26.c.html