[petsc-dev] VECCUSP needs to be zeroed?
Jed Brown
jedbrown at mcs.anl.gov
Wed Nov 9 13:28:57 CST 2011
On Wed, Nov 9, 2011 at 13:25, Matthew Knepley <knepley at gmail.com> wrote:
> The simpler answer is yes, I always initialize the Mat or Vec to zero when
> I use it. Even if its initialized when created,
> I almost always get something from DMGetGlobalVector() etc. which could
> have been used before.
>
Since we keep track of access that could mutate, it would be easy to make
VecZeroEntries a no-op when the array is already zeroed. (In debug mode, it
could actually check that the array is still zero.)
I agree with Matt that you should call VecZeroEntries() when you want to
rely on the Vec being zeroed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20111109/44cf9169/attachment.html>
More information about the petsc-dev
mailing list