# SNESDAComputeJacobianWithAdic

This is a universal Jacobian evaluation routine that may be used with SNESSetJacobian() as long as the user context has a DA as its first record and DASetLocalAdicFunction() has been called.

### Synopsis

    #include "petscda.h"
    #include "petscmg.h"
    #include "petscdmmg.h"
    PetscErrorCode PETSCSNES_DLLEXPORT SNESDAComputeJacobianWithAdic(SNES snes,Vec X,Mat *J,Mat *B,MatStructure *flag,void *ptr)

Collective on SNES

### Input Parameters

| snes | - the SNES context
| X | - input vector
| J | - Jacobian
| B | - Jacobian used in preconditioner (usally same as J)
| flag | - indicates if the matrix changed its structure
| ptr | - optional user-defined context, as set by SNESSetFunction()

### See Also

DASetLocalFunction(), DASetLocalAdicFunction(), SNESSetFunction(), SNESSetJacobian()

Level:intermediate
Location:src/snes/utils/damgsnes.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