:orphan:
# PCASMCreateSubdomains2D
Creates the index sets for the overlapping Schwarz preconditioner, `PCASM`, for a two-dimensional problem on a regular grid. 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCASMCreateSubdomains2D(PetscInt m, PetscInt n, PetscInt M, PetscInt N, PetscInt dof, PetscInt overlap, PetscInt *Nsub, IS **is, IS **is_local)
```
Not Collective


## Input Parameters

- ***m   -*** the number of mesh points in the x direction
- ***n   -*** the number of mesh points in the y direction
- ***M   -*** the number of subdomains in the x direction
- ***N   -*** the number of subdomains in the y direction
- ***dof -*** degrees of freedom per node
- ***overlap -*** overlap in mesh lines



## Output Parameters

- ***Nsub -*** the number of subdomains created
- ***is -*** array of index sets defining overlapping (if overlap > 0) subdomains
- ***is_local -*** array of index sets defining non-overlapping subdomains





## Note
Presently `PCAMSCreateSubdomains2d()` is valid only for sequential
preconditioners.  More general related routines are
`PCASMSetTotalSubdomains()` and `PCASMSetLocalSubdomains()`.


## See Also
 `PCASM`, `PCASMSetTotalSubdomains()`, `PCASMSetLocalSubdomains()`, `PCASMGetSubKSP()`,
`PCASMSetOverlap()`

## Level
advanced

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

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


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


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