[petsc-dev] Vec set a block of values

Junchao Zhang jczhang at mcs.anl.gov
Fri Apr 20 15:10:56 CDT 2018


To pad a vector, i.e., copy a vector to a new one, I have to call
VecSetValue(newb,1,&idx,...) for each element. But to be efficient, what I
really needs is to set a block of values in one call. It looks PETSc does
not have a routine for that(?). I looked at VecSetValuesBlocked, but it
looks it is not for that purpose.
Should we have something like VecSetValuesBlock(Vec
<http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/Vec.html#Vec>
v,PetscInt
<http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInt.html#PetscInt>
i,PetscInt cnt,PetscScalar
<http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscScalar.html#PetscScalar>
*value,
InsertMode
<http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/InsertMode.html#InsertMode>
mode) to set cnt values starting at index i?

--Junchao Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20180420/acba6447/attachment.html>


More information about the petsc-dev mailing list