petsc-3.6.4 2016-04-12
Report Typos and Errors


Sets the grid information for setting values into a matrix via MatSetValuesStencil()


#include "petscmat.h" 
PetscErrorCode  MatSetStencil(Mat mat,PetscInt dim,const PetscInt dims[],const PetscInt starts[],PetscInt dof)
Not Collective

Input Parameters

mat - the matrix
dim - dimension of the grid 1, 2, or 3
dims - number of grid points in x, y, and z direction, including ghost points on your processor
starts - starting point of ghost nodes on your processor in x, y, and z direction
dof - number of degrees of freedom per node

Inspired by the structured grid interface to the HYPRE package (

For matrices generated with DMCreateMatrix() this routine is automatically called and so not needed by the user.

See Also

MatSetOption(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValuesBlocked(), MatSetValuesLocal()
MatSetValues(), MatSetValuesBlockedStencil(), MatSetValuesStencil()

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