<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 14, 2015 at 6:25 PM, Gideon Simpson <span dir="ltr"><<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">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></blockquote><div><br></div><div>Nope, and calling VecSet(v, 0.0) is really cheap.</div><div><br></div><div>  Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div>
<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;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">-gideon</span>

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