DMDAGetArray — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# DMDAGetArray

Gets a work array for a `DMDA`

## Synopsis

    #include "petscdmda.h"
    PetscErrorCode DMDAGetArray(DM da, PetscBool ghosted, void *vptr)

## Input Parameters

- da - a `DMDA`

- ghosted - do you want arrays for the ghosted or nonghosted patch

## Output Parameter

- vptr - array data structured

## Notes

The vector values are NOT initialized and may have garbage in them, so you may need to zero them.

Use `DMDARestoreArray()` to return the array

## See Also

DMDA - Creating vectors for structured grids, `DM`, `DMDA`, `DMDARestoreArray()`

## Level

advanced

## Location

src/dm/impls/da/dalocal.c

## Examples

src/ts/tutorials/ex9.c

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