# DMDASetSizes
Sets the number of grid points in the three dimensional directions 
## Synopsis
```
#include "petscdmda.h"   
PetscErrorCode DMDASetSizes(DM da, PetscInt M, PetscInt N, PetscInt P)
```
Logically Collective on da


## Input Parameters

- ***da -*** the `DMDA`
- ***M -*** the global X size
- ***N -*** the global Y size
- ***P -*** the global Z size





## Developer Note
Since the dimension may not yet have been set the code cannot error check for non-positive Y and Z number of grid points


## See Also
 `DM`, `DMDA`, `PetscSplitOwnership()`

## Level
intermediate

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

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/da/da.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)  
