# DMCompositeGetMatrix

Creates a matrix with the correct parallel layout and nonzero structure required for computing the Jacobian on a function defined using the stencils set in the DA's and coupling in the array variables

### Synopsis

    #include "petscda.h"
    PetscErrorCode PETSCDM_DLLEXPORT DMCompositeGetMatrix(DMComposite packer, MatType mtype,Mat *J)

Collective on DA

### Input Parameter

| da | - the distributed array
| mtype | - Supported types are MATSEQAIJ, MATMPIAIJ

### Output Parameters

J -matrix with the correct nonzero structure (obviously without the correct Jacobian values)

Notes: This properly preallocates the number of nonzeros in the sparse matrix so you do not need to do it yourself.

### See Also

DAGetMatrix(), DMCompositeCreate()

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