[petsc-users] Is xout always already zero'ed when being called back on PCShellSetApply ?

Matthew Knepley knepley at gmail.com
Sun May 21 11:41:10 CDT 2017


On Sun, May 21, 2017 at 11:11 AM, Franck Houssen <franck.houssen at inria.fr>
wrote:

> When using http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/
> PCShellSetApply.html, do I have the guaranty that xout from "
> PetscErrorCode
> <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode>
> apply (PC
> <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PC.html#PC>
> pc,Vec
> <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/Vec.html#Vec>
> xin,Vec
> <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/Vec.html#Vec>
> xout)" has always been previously filled with zeros ?
> I may have to fill xout by blocks (I would += several possibly overlapping
> blocks: I need to make sure xout is first filled with zero to get the
> correct result).
>

No, we do not initialize the output vector. Yo ucan call VecSet(xout, 0.0);

  Thanks,

    Matt


> Franck
>



-- 
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

http://www.caam.rice.edu/~mk51/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170521/bf822ced/attachment-0001.html>


More information about the petsc-users mailing list