[petsc-dev] What's the point of D(A/M)GetGlobalVector?

Aron Ahmadia aron.ahmadia at kaust.edu.sa
Fri Aug 27 06:13:01 CDT 2010


I'm posting this to -dev since I'm working in -dev, let me know if I should
be pushing this sort of question to -users.  I was debugging a code today
and noticed the following note in DAGetGlobalVector:

"The vector values are NOT initialized and may have garbage in them, so you
may need to zero them."

What exactly is the purpose of these routines then?  Is there a global
Vector associated with a DA?  If so, why are the values uninitialized?  On
the other hand, if there isn't one, what's the sense of 'get/restore'?  The
following code does NOT work the way I'd expect:

DAGetGlobalVector(x)

/* modify x */

DARestoreGlobalVector(x)

DAGetGlobalVector(x)

/* access previous values, except everything is zero*/

I guess I'm not grokking something about the concept of a DA or PETSc
objects, could somebody explain the purpose or correct usage of Get/Restore
here.

Thanks in advance,
Aron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20100827/268d23b4/attachment.html>


More information about the petsc-dev mailing list