Skip to main content
`Ctrl`+`K`

# DMStagStencilToIndexLocal

Convert an array of `DMStagStenci`l objects to an array of indices into a local vector.

## Synopsis

    #include "petscdmstag.h"
    PetscErrorCode DMStagStencilToIndexLocal(DM dm, PetscInt dim, PetscInt n, const DMStagStencil *pos, PetscInt *ix)

Not Collective

## Input Parameters

- dm - the `DMSTAG` object

- dim - the dimension of the `DMSTAG` object

- n - the number of `DMStagStencil` objects

- pos - an array of `n` `DMStagStencil` objects

## Output Parameter

- ix - output array of `n` indices

## Notes

The `DMStagStencil` objects in `pos` use global element indices.

The `.c` fields in `pos` must always be set (even if to `0`).

## Developer Notes

This is a “hot” function, and accepts the dimension redundantly to avoid having to perform any error checking inside the function.

## See Also

DMSTAG: Staggered, Structured Grid, `DMSTAG`, `DMStagStencilLocation`, `DMStagStencil`, `DMGetLocalVector`, `DMCreateLocalVector`

## Level

developer

## Location

src/dm/impls/stag/stagstencil.c

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