# PCGASMCreateSubdomains2D
Creates the index sets for the `PCGASM` overlapping Schwarz preconditioner for a two-dimensional problem on a regular grid. 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCGASMCreateSubdomains2D(PC pc, PetscInt M, PetscInt N, PetscInt Mdomains, PetscInt Ndomains, PetscInt dof, PetscInt overlap, PetscInt *nsub, IS **iis, IS **ois)
```
Collective


## Input Parameters

- ***pc       -*** the preconditioner context
- ***M        -*** the global number of grid points in the x direction
- ***N        -*** the global number of grid points in the y direction
- ***Mdomains -*** the global number of subdomains in the x direction
- ***Ndomains -*** the global number of subdomains in the y direction
- ***dof      -*** degrees of freedom per node
- ***overlap  -*** overlap in mesh lines



## Output Parameters

- ***Nsub -*** the number of local subdomains created
- ***iis  -*** array of index sets defining inner (nonoverlapping) subdomains
- ***ois  -*** array of index sets defining outer (overlapping, if overlap > 0) subdomains





## See Also
 `PCGASM`, `PCGASMSetSubdomains()`, `PCGASMGetSubKSP()`, `PCGASMSetOverlap()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/gasm/gasm.c.html#PCGASMCreateSubdomains2D">src/ksp/pc/impls/gasm/gasm.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex62.c.html">src/ksp/ksp/tutorials/ex62.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex64.c.html">src/ksp/ksp/tutorials/ex64.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/gasm/gasm.c)


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