<div dir="ltr">Barry,<div><br></div><div>Perhaps it would be good to put your explanation into the manual pages for these routines? The difference between the two is not obvious without looking at examples.</div><div><br></div><div>--Richard</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 6, 2015 at 3:32 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On May 6, 2015, at 5:24 PM, Gideon Simpson <<a href="mailto:gideon.simpson@gmail.com">gideon.simpson@gmail.com</a>> wrote:<br>
><br>
> What are the relative merits of DMGetGlobalVector and DMCreateGlobalVector, and the analogous question for the Local Vectors? Are there scenarios where one should be used over the other?<br>
<br>
</span> Get are intended for obtaining work vectors that one intends to restore soon, likely in the same function that did the get. Create is for long living vectors that you are likely passing around to solvers, subroutines etc.<br>
<br>
Explanation: sometimes a subroutine needs some work vectors. For example often a PETSc SNESFormFunction will do a DMGlobalToLocalBegin/End() at the beginning to allow access of ghost values. That local vector is only needed in that subroutine so one should use the get.<br>
<br>
<br>
><br>
> -gideon<br>
><br>
<br>
</blockquote></div><br></div>