:orphan: # DMStagMatGetValuesStencil retrieve local matrix entries using grid indexing ## Synopsis ``` PetscErrorCode DMStagMatGetValuesStencil(DM dm, Mat mat, PetscInt nRow, const DMStagStencil *posRow, PetscInt nCol, const DMStagStencil *posCol, PetscScalar *val) ``` Not Collective ## Input Parameters - ***dm -*** the `DMSTAG` object - ***mat -*** the matrix - ***nRow -*** number of rows - ***posRow -*** grid locations (including components) of rows - ***nCol -*** number of columns - ***posCol -*** grid locations (including components) of columns ## Output Parameter - ***val -*** logically two-dimensional array of values ## See Also [](ch_stag), `DMSTAG`, `DMStagStencil`, `DMStagStencilLocation`, `DMStagVecGetValuesStencil()`, `DMStagVecSetValuesStencil()`, `DMStagMatSetValuesStencil()`, `MatSetValuesStencil()`, `MatAssemblyBegin()`, `MatAssemblyEnd()`, `DMCreateMatrix()` ## Level advanced ## Location src/dm/impls/stag/stagstencil.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/stag/stagstencil.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)