petsc-3.7.1 2016-05-15
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 Many br

### Input Parameters

| x | - the matrix Many br
| nrow, irow | - number of rows and their local indices Many br
| ncol, icol | - number of columns and their local indices Many br
| y | - a logically two-dimensional array of values Many br
| addv | - either INSERT_VALUES or ADD_VALUES, where Many brADD_VALUES adds values to any existing entries, and Many brINSERT_VALUES replaces existing entries with new values Many br

### Notes

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

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

Calls to MatSetValuesLocal() with the INSERT_VALUES and ADD_VALUES Many broptions cannot be mixed without intervening calls to the assembly Many brroutines. Many br

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

Many br

### See Also

MatAssemblyBegin(), MatAssemblyEnd(), MatSetValues(), MatSetLocalToGlobalMapping(),
MatSetValueLocal() Many br

Level:intermediate
Location:src/mat/interface/matrix.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/ksp/examples/tutorials/ex31.c.html
src/snes/examples/tutorials/ex5.c.html
src/snes/examples/tutorials/ex7.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.F.html
src/snes/examples/tutorials/ex5f90.F.html
src/snes/examples/tutorials/ex5f90t.F.html
src/snes/examples/tutorials/ex40f90.F90.html