[petsc-users] ghost values
Gideon Simpson
gideon.simpson at gmail.com
Tue Apr 14 18:25:46 CDT 2015
So other than the minor point of it zeroing out the data, is there any conceivable reason to use Create/Destroy over Get/Restore?
-gideon
> On Apr 14, 2015, at 7:16 PM, Matthew Knepley <knepley at gmail.com> wrote:
>
> On Tue, Apr 14, 2015 at 6:15 PM, Gideon Simpson <gideon.simpson at gmail.com <mailto:gideon.simpson at gmail.com>> wrote:
> Other than zeroing things out, is there any substantive difference between DMCreateLocalVector and DMGetLocalVector?
>
> The Get version caches vectors, so you are not continually creating/destroying
>
> Matt
>
> -gideon
>
> > On Apr 14, 2015, at 7:02 PM, Barry Smith <bsmith at mcs.anl.gov <mailto:bsmith at mcs.anl.gov>> wrote:
> >
> >
> > When PETSc vectors are created initially they always have 0 everywhere. So if you use DMCreateLocalVector() it will have zero in all those ghost places (as well as everywhere else).
> >
> > But if you use DMGetLocalVector() it returns vectors that maybe dirty so you need to fill in any locations you want to have a known value with that known value. Or call VecSet() to clear the entire vector.
> >
> > Barry
> >
> >> On Apr 14, 2015, at 5:52 PM, Gideon Simpson <gideon.simpson at gmail.com <mailto:gideon.simpson at gmail.com>> wrote:
> >>
> >> If i use the DM_BOUNDARY_GHOSTED flag in the creation of a DMDA array, are the ghosted values automatically set to zero, or should they be manually set to zero if that’s the desired ghost value?
> >>
> >> -gideon
> >>
> >
>
>
>
>
> --
> 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-users/attachments/20150414/b0028fee/attachment.html>
More information about the petsc-users
mailing list