petsc-3.9.4 2018-09-11
Report Typos and Errors

MatSetValuesLocal

Inserts or adds values into certain locations of a matrix, using a local ordering of the nodes.

Synopsis

#include "petscmat.h" 
PetscErrorCode MatSetValuesLocal(Mat mat,PetscInt nrow,const PetscInt irow[],PetscInt ncol,const PetscInt icol[],const PetscScalar y[],InsertMode addv)
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
y - a logically two-dimensional array of values
addv - either INSERT_VALUES or ADD_VALUES, where ADD_VALUES adds values to any existing entries, and INSERT_VALUES replaces existing entries with new values

Notes

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

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

Calls to MatSetValuesLocal() with the INSERT_VALUES and ADD_VALUES options cannot be mixed without intervening calls to the assembly routines.

These values may be cached, so MatAssemblyBegin() and MatAssemblyEnd() MUST be called after all calls to MatSetValuesLocal() have been completed.

Developer Notes: This is labeled 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(),
MatSetValueLocal()

Level

intermediate

Location

src/mat/interface/matrix.c

Examples

src/ksp/ksp/examples/tutorials/ex70.c.html
src/snes/examples/tutorials/ex5.c.html
src/snes/examples/tutorials/ex14.c.html
src/snes/examples/tutorials/ex28.c.html
src/snes/examples/tutorials/ex35.c.html
src/snes/examples/tutorials/ex46.c.html
src/snes/examples/tutorials/ex5f.F90.html
src/snes/examples/tutorials/ex5f90.F90.html
src/snes/examples/tutorials/ex5f90t.F90.html
src/snes/examples/tutorials/ex40f90.F90.html
src/ts/examples/tutorials/ex2.c.html

Implementations

MatSetValuesLocal_HYPREStruct_3d in src/dm/impls/da/hypre/mhyp.c
MatSetValuesLocal_HYPRESStruct_3d in src/dm/impls/da/hypre/mhyp.c
MatSetValuesLocal_SubMat_IS in src/mat/impls/is/matis.c
MatSetValuesLocal_IS in src/mat/impls/is/matis.c
MatSetValuesLocal_LocalRef_Scalar in src/mat/impls/localref/mlocalref.c

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