Barry, 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.
--Richard On Wed, May 6, 2015 at 3:32 PM, Barry Smith <[email protected]> wrote: > > > On May 6, 2015, at 5:24 PM, Gideon Simpson <[email protected]> > wrote: > > > > 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? > > 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. > > 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. > > > > > > -gideon > > > >
