<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">So other than the minor point of it zeroing out the data, is there any conceivable reason to use Create/Destroy over Get/Restore?<div class=""><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  ">-gideon</span>

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Apr 14, 2015, at 7:16 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 14, 2015 at 6:15 PM, Gideon Simpson <span dir="ltr" class=""><<a href="mailto:gideon.simpson@gmail.com" target="_blank" class="">gideon.simpson@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Other than zeroing things out, is there any substantive difference between DMCreateLocalVector and DMGetLocalVector?<br class=""></blockquote><div class=""><br class=""></div><div class="">The Get version caches vectors, so you are not continually creating/destroying</div><div class=""><br class=""></div><div class="">   Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-gideon<br class="">
<br class="">
> On Apr 14, 2015, at 7:02 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" class="">bsmith@mcs.anl.gov</a>> wrote:<br class="">
><br class="">
><br class="">
>  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).<br class="">
><br class="">
>   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.<br class="">
><br class="">
>  Barry<br class="">
><br class="">
>> On Apr 14, 2015, at 5:52 PM, Gideon Simpson <<a href="mailto:gideon.simpson@gmail.com" class="">gideon.simpson@gmail.com</a>> wrote:<br class="">
>><br class="">
>> 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?<br class="">
>><br class="">
>> -gideon<br class="">
>><br class="">
><br class="">
<br class="">
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div>
</div></div>
</div></blockquote></div><br class=""></div></body></html>