PetscErrorCode DMStagVecSetValuesStencil(DM dm,Vec vec,PetscInt n,const DMStagStencil *pos,const PetscScalar *val,InsertMode insertMode)Not Collective
| dm | - the DMStag object | |
| vec | - the Vec | |
| n | - the number of values to set | |
| pos | - the locations to set values, as an array of DMStagStencil structs | |
| val | - the values to set | |
| insertMode | - INSERT_VALUES or ADD_VALUES |
This approach is not as efficient as setting values directly with DMStagVecGetArrayDOF(), which is recommended for matrix-free operators. For assembling systems, where overhead may be less important than convenience, this routine could be helpful in assembling a righthand side and a matrix (using DMStagMatSetValuesStencil()).