# DMDACoor2d
Structure for holding 2d (x and y) coordinates when working with `DMDA` 


## Synopsis
```
.vb
DMDACoor2d **coors;
Vec      vcoors;
DM       cda;
DMGetCoordinates(da,&vcoors);
DMGetCoordinateDM(da,&cda);
DMDAVecGetArray(cda,vcoors,&coors);
DMDAGetCorners(cda,&mstart,&nstart,0,&m,&n,0)
for (i=mstart; i<mstart+m; i++) {
for (j=nstart; j<nstart+n; j++) {
x = coors[j][i].x;
y = coors[j][i].y;
......
}
}
DMDAVecRestoreArray(dac,vcoors,&coors);
.ve
```

## See Also
 `DMDACoor3d`, `DMDAVecRestoreArray()`, `DMDAVecGetArray()`, `DMGetCoordinateDM()`, `DMGetCoordinates()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscdmda.h.html#DMDACoor2d">include/petscdmda.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscdmda.h)


[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)  
