petsc-3.7.1 2016-05-15
Report Typos and Errors

VecSetValue

Set a single entry into a vector.

Synopsis

#include <petscvec.h>
PetscErrorCode VecSetValue(Vec v,PetscInt row,PetscScalar value, InsertMode mode);
Not Collective Many br

Input Parameters

v - the vector Many br
row - the row location of the entry Many br
value - the value to insert Many br
mode - either INSERT_VALUES or ADD_VALUES Many br

Notes

For efficiency one should use VecSetValues() and set several or Many brmany values simultaneously if possible. Many br

These values may be cached, so VecAssemblyBegin() and VecAssemblyEnd() Many brMUST be called after all calls to VecSetValues() have been completed. Many br

VecSetValues() uses 0-based indices in Fortran as well as in C. Many br

Many br

See Also

VecSetValues(), VecAssemblyBegin(), VecAssemblyEnd(), VecSetValuesBlockedLocal(), VecSetValueLocal()

Level:beginner
Location:
src/vec/vec/../../../include/petscvec.h
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/ksp/ksp/examples/tutorials/ex43.c.html
src/ksp/ksp/examples/tutorials/ex49.c.html
src/ksp/ksp/examples/tutorials/ex56.c.html
src/snes/examples/tutorials/ex28.c.html
src/snes/examples/tutorials/ex30.c.html
src/snes/examples/tutorials/ex70.c.html
src/ts/examples/tutorials/extchem.c.html