setting values in parallel vectors

Jed Brown jed at 59A2.org
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.

Jed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090402/cacb9d71/attachment.pgp>


More information about the petsc-users mailing list