[petsc-dev] VECCUSP needs to be zeroed?
Matthew Knepley
knepley at gmail.com
Tue Nov 8 06:51:26 CST 2011
On Tue, Nov 8, 2011 at 10:37 AM, Jose E. Roman <jroman at dsic.upv.es> wrote:
> The following code prints a vector of uninitialized entries.
>
> ierr = VecCreate(comm,&v);CHKERRQ(ierr);
> ierr = VecSetSizes(v,n,n);CHKERRQ(ierr);
> ierr = VecSetType(v,VECSEQCUSP);CHKERRQ(ierr);
> ierr = VecView(v,PETSC_NULL);CHKERRQ(ierr);
>
> In contrast, if the type is VECSEQ the vector is initialized to zero. So
> it seems that VecSet(v,0.0) must always be called. Is this the expected
> behaviour?
There is no guarantee of initialization for any Vec type.
Matt
>
> Jose
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20111108/68a810ad/attachment.html>
More information about the petsc-dev
mailing list