DMStagGetProductCoordinateLocationSlot — PETSc 3.25.0 documentation

Skip to main content
`Ctrl`+`K`

# DMStagGetProductCoordinateLocationSlot

get slot for use with local product coordinate arrays

## Synopsis

    #include "petscdmstag.h"
    #include "petscdmproduct.h"
    PETSC_EXTERN PetscErrorCode DMStagGetProductCoordinateLocationSlot(DM dm, DMStagStencilLocation loc, PetscInt *slot)

Not Collective

## Input Parameters

- dm - the `DMSTAG` object

- loc - the grid location

## Output Parameter

- slot - the index to use in local arrays

## Notes

High-level helper function to get slot indices for 1D coordinate `DM`s, for use with `DMStagGetProductCoordinateArrays()` and related functions.

For `loc`, one should use `DMSTAG_LEFT`, `DMSTAG_ELEMENT`, or `DMSTAG_RIGHT` for “previous”, “center” and “next” locations, respectively, in each dimension. One can equivalently use `DMSTAG_DOWN` or `DMSTAG_BACK` in place of `DMSTAG_LEFT`, and `DMSTAG_UP` or `DMSTACK_FRONT` in place of `DMSTAG_RIGHT`;

This function checks that the coordinates are actually set up so that using the slots from any of the 1D coordinate sub-`DM`s are valid for all the 1D coordinate sub-`DM`s.

## See Also

DMSTAG: Staggered, Structured Grid, `DMSTAG`, `DMPRODUCT`, `DMStagGetProductCoordinateArrays()`, `DMStagGetProductCoordinateArraysRead()`, `DMStagSetUniformCoordinates()`

## Level

intermediate

## Location

src/dm/impls/stag/stagutils.c

## Examples

src/dm/impls/stag/tutorials/ex6.c
src/dm/impls/stag/tutorials/ex2.c
src/dm/impls/stag/tutorials/ex4.c

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