[petsc-users] DM Vector get vs. create

Richard Mills rtm at utk.edu
Wed May 6 18:49:54 CDT 2015


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 <bsmith at mcs.anl.gov> wrote:

>
> > On May 6, 2015, at 5:24 PM, Gideon Simpson <gideon.simpson at gmail.com>
> 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
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150506/8e861079/attachment.html>


More information about the petsc-users mailing list