MatMFFDSetFunction#
Sets the function used in applying the matrix-free MATMFFD matrix.
Synopsis#
#include "petscmat.h"
PetscErrorCode MatMFFDSetFunction(Mat mat, MatMFFDFn *func, void *funcctx)
Logically Collective
Input Parameters#
mat - the matrix-free matrix
MATMFFDcreated viaMatCreateSNESMF()orMatCreateMFFD()func - the function to use
funcctx - optional function context passed to function
Notes#
If you use this you MUST call MatAssemblyBegin() and MatAssemblyEnd() on the matrix-free
matrix inside your compute Jacobian routine
If this is not set then it will use the function set with SNESSetFunction() if MatCreateSNESMF() was used.
See Also#
Matrices, Mat, MATMFFD, MatMFFDFn, MatCreateSNESMF(), MatMFFDGetH(), MatCreateMFFD(),
MatMFFDSetHHistory(), MatMFFDResetHHistory(), SNESSetFunction()
Level#
advanced
Location#
Examples#
Implementations#
MatMFFDSetFunction_MFFD() in src/mat/impls/mffd/mffd.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages