DMGetCoordinates#

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

Synopsis#

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

Collective if the global vector with coordinates has not been set yet but the local vector with coordinates has been set

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 c will no longer be valid.

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

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

Does not work for DMSTAG

See Also#

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

Level#

intermediate

Location#

src/dm/interface/dmcoordinates.c

Examples#

src/snes/tutorials/ex22.c
src/snes/tutorials/ex33.c
src/ksp/ksp/tutorials/ex49.c
src/ksp/ksp/tutorials/ex71.c
src/snes/tutorials/ex46.c
src/snes/tutorials/ex55k.kokkos.cxx
src/snes/tutorials/ex5.c
src/ksp/ksp/tutorials/ex69.c
src/snes/tutorials/ex55.c
src/snes/tutorials/ex76.c


Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages