range check on VecGetArray

Matthew Knepley knepley at gmail.com
Wed Feb 11 14:31:39 CST 2009

The intention is that you use VecGhostGetLocalForm() first, and then
VecGetArray(). That way
the size is just the Vec length.


On Wed, Feb 11, 2009 at 1:49 PM, Fredrik Bengzon <
fredrik.bengzon at math.umu.se> wrote:

> Hi,
> When using VecGetArray(vec, &ptr2vec) on a vector, vec, with ghost nodes,
> is there a way of getting the size (length) of the ptr2vec array? In other
> words, how can I avoid out-of-range errors when accessing elements of
> ptr2vec?
> Best Regards
> Fredrik Bengzon, Umeå, Sweden

What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090211/3791a77c/attachment.htm>

More information about the petsc-users mailing list