# DMGetCoordinates#

Gets a global vector with the coordinates associated with the DM.

## Synopsis#

#include "petscdm.h"
PetscErrorCode DMGetCoordinates(DM dm, Vec *c)


Collective on dm

## Input Parameter#

• dm - the DM

## Output Parameter#

• c - global coordinate vector

## Notes#

This is a borrowed reference, so the user should NOT destroy this vector. When the DM is destroyed the array will no longer be valid.

Each process has only the locally-owned portion of the global coordinates (does NOT have the ghost coordinates).

For DMDA, in two and three dimensions coordinates are interlaced (x_0,y_0,x_1,y_1,…) and (x_0,y_0,z_0,x_1,y_1,z_1…)

DM, DMDA, DMSetCoordinates(), DMGetCoordinatesLocal(), DMGetCoordinateDM(), DMDASetUniformCoordinates()

intermediate

## Location#

src/dm/interface/dmcoordinates.c

Edit on GitLab