setting values in parallel vectors

Jed Brown jed at
Thu Apr 2 14:18:06 CDT 2009

On Thu 2009-04-02 15:09, Khan, Irfan wrote:
> Thank you, that was very helpful. Please do let me know if I understood this right. Generally VecSetValues()+VecGhostUpdateBegin/End() is faster than VecGetArray()+assign_array()+VecRestoreArray()+VecGhostUpdateBegin/End(). Also both these operation would be equivalent.

These operations would be equivalent.  The second option would be
faster, but only because it doesn't do a function call and
range-checking in an inner loop.  It would be nearly impossible to tell
the difference in a real code so don't worry about it, just use
whichever is more natural.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <>

More information about the petsc-users mailing list