# DMDACreatePatchIS
Creates an index set corresponding to a patch of the DA. 
## Synopsis
```
#include "petscdmda.h"   
PetscErrorCode DMDACreatePatchIS(DM da, MatStencil *lower, MatStencil *upper, IS *is, PetscBool offproc)
```
Collective


## Input Parameters

- ***da -*** the DMDA
- ***lower -*** a matstencil with i, j and k corresponding to the lower corner of the patch
- ***upper -*** a matstencil with i, j and k corresponding to the upper corner of the patch
- ***offproc -*** indicate whether the returned IS will contain off process indices



## Output Parameters

- ***is -*** the IS corresponding to the patch





## Notes
This routine always returns an IS on the DMDA's comm, if offproc is set to PETSC_TRUE,
the routine returns an IS with all the indices requested regardless of whether these indices
are present on the requesting rank or not. Thus, it is upon the caller to ensure that
the indices returned in this mode are appropriate. If offproc is set to PETSC_FALSE,
the IS only returns the subset of indices that are present on the requesting rank and there
is no duplication of indices.


## See Also
 `DMCreateDomainDecomposition()`, `DMCreateDomainDecompositionScatters()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/da/dadd.c.html#DMDACreatePatchIS">src/dm/impls/da/dadd.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex14.c.html">src/dm/tutorials/ex14.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex22.c.html">src/dm/tutorials/ex22.c.html</A><BR>


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


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