# DMCompositeSetCoupling
Sets user provided routines that compute the coupling between the separate components `DM` in a `DMCOMPOSITE` to build the correct matrix nonzero structure. 
## Synopsis
```
#include "petscdmcomposite.h"  
PetscErrorCode DMCompositeSetCoupling(DM dm, PetscErrorCode (*FormCoupleLocations)(DM, Mat, PetscInt *, PetscInt *, PetscInt, PetscInt, PetscInt, PetscInt))
```
Logically Collective


## Input Parameters

- ***dm -*** the composite object
- ***formcouplelocations -*** routine to set the nonzero locations in the matrix





## Note
See `DMSetApplicationContext()` and `DMGetApplicationContext()` for how to get user information into
this routine


## Fortran Note
Not available from Fortran


## See Also
 `DMCOMPOSITE`, `DM`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/composite/pack.c.html#DMCompositeSetCoupling">src/dm/impls/composite/pack.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/composite/pack.c)


[Index of all DM routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
