PETSc version 3.16.3
Fix/Edit manual page


retrieves values from certain locations in a matrix using the local numbering of the indices defined previously by MatSetLocalToGlobalMapping()


#include "petscmat.h" 
PetscErrorCode MatGetValuesLocal(Mat mat,PetscInt nrow,const PetscInt irow[],PetscInt ncol,const PetscInt icol[],PetscScalar y[])
Not Collective

Input Parameters

mat - the matrix
nrow, irow - number of rows and their local indices
ncol, icol - number of columns and their local indices

Output Parameter

y - a logically two-dimensional array of values


If you create the matrix yourself (that is not with a call to DMCreateMatrix()) then you MUST call MatSetLocalToGlobalMapping() before using this routine.

This routine can only return values that are owned by the requesting MPI rank. That is, for standard matrix formats, rows that, in the global numbering, are greater than or equal to restart and less than rend where restart and rend are obtainable from MatGetOwnershipRange(mat,&rstart,&rend). One can determine if the resulting global row associated with the local row r is owned by the requesting MPI rank by applying the ISLocalToGlobalMapping set with MatSetLocalToGlobalMapping().

Developer Notes

This is labelled with C so does not automatically generate Fortran stubs and interfaces because it requires multiple Fortran interfaces depending on which arguments are scalar or arrays.

See Also

MatAssemblyBegin(), MatAssemblyEnd(), MatSetValues(), MatSetLocalToGlobalMapping(),
MatSetValuesLocal(), MatGetValues()




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