VecSetValue

Set a single entry into a vector.

Synopsis

int VecSetValue(Vec v,int row,PetscScalar value, InsertMode mode);
Not Collective

Input Parameters

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

Notes

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

Note that VecSetValue() does NOT return an error code (since this is checked internally).

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

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

See Also

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

Level:beginner
Location:
src/vec/interface/vector.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/sles/examples/tutorials/ex10.c.html