DAGetColoring

Gets the coloring and nonzero structure required for computing the Jacobian via finite differences on a function defined using a stencil on the DA.

Synopsis

#include "petscda.h"     
#include "petscmat.h"    
int DAGetColoring(DA da,ISColoringType ctype,MatType mtype,ISColoring *coloring,Mat *J)
Collective on DA

Input Parameter

da - the distributed array
mtype - either MATMPIAIJ or MATMPIBAIJ

Output Parameters

coloring - matrix coloring for use in computing Jacobians (or PETSC_NULL if not needed)
J - matrix with the correct nonzero structure (or PETSC_NULL if not needed) (obviously without the correct Jacobian values)

Notes: These compute the graph coloring of the graph of A^{T}A. The coloring used for efficient (parallel or thread based) triangular solves etc is NOT yet available.

This does not yet handle BAIJ matrices, because 1) we need a way for the user to indicate what matrix type they want 2) after the matrix is created, for BAIJ matrices we need to set nc to 1 and use MatSetValuesBlockedLocal() instead of MatSetValuesLocal()

See Also

ISColoringView(), ISColoringGetIS(), MatFDColoringCreate(), DAGetColoringMPIBAIJ()

Level:advanced
Location:
src/dm/da/utils/fdda.c
Index of all DA routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/snes/examples/tutorials/ex5.c.html
src/snes/examples/tutorials/ex14.c.html
src/snes/examples/tutorials/ex24.c.html
src/ts/examples/tutorials/ex7.c.html