# DMStagStencil
data structure representing a degree of freedom on a `DMSTAG` grid 
## Synopsis
```
typedef struct {
  DMStagStencilLocation loc;
  PetscInt              i, j, k, c;
} DMStagStencil;
```
Data structure (C struct), analogous to describing a degree of freedom associated with a `DMSTAG` object,
in terms of a global element index in each of up to three directions, a "location" as defined by `DMStagStencilLocation`,
and a component number. Primarily for use with `DMStagMatSetValuesStencil()` (compare with use of `MatStencil` with `MatSetValuesStencil()`).


## Note
The component (c) field must always be set, even if there is a single component at a given location (in which case c should be set to 0).




## See Also
 `DMSTAG`, `DMStagMatSetValuesStencil()`, `DMStagVecSetValuesStencil()`, `DMStagStencilLocation`, `DMStagSetStencilWidth()`, `DMStagSetStencilType()`, `DMStagVecGetValuesStencil()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscdmstag.h.html#DMStagStencil">include/petscdmstag.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscdmstag.h)


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