:orphan:
# DMStagGetProductCoordinateLocationSlot
get slot for use with local product coordinate arrays 
## Synopsis
```
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
 [](ch_stag), `DMSTAG`, `DMPRODUCT`, `DMStagGetProductCoordinateArrays()`, `DMStagGetProductCoordinateArraysRead()`, `DMStagSetUniformCoordinates()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/stagutils.c.html#DMStagGetProductCoordinateLocationSlot">src/dm/impls/stag/stagutils.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/tutorials/ex2.c.html">src/dm/impls/stag/tutorials/ex2.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/tutorials/ex4.c.html">src/dm/impls/stag/tutorials/ex4.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/tutorials/ex6.c.html">src/dm/impls/stag/tutorials/ex6.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/stag/stagutils.c)


[Index of all DMStag routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
