[petsc-dev] Ghost update in VecAssembly?

Matthew Knepley knepley at gmail.com
Tue Mar 1 10:26:10 CST 2016


On Tue, Mar 1, 2016 at 10:19 AM, Jed Brown <jed at jedbrown.org> wrote:

> Matthew Knepley <knepley at gmail.com> writes:
>
> > Okay, this shows that we always need to specify exactly which vector,
> > local or global, we are talking about (and also why I don't use
> > VecGhost).
>
> Yes, it can be confusing and it wastes storage if you have many global
> Vecs (e.g., large Krylov space).
>
> > I was confusing the VecGhostUpdate() above which puts local values in the
> > global vector
> > with the update which would refresh the local portion. The former update
> > should be called
> > automatically during assembly, which already happens in the
> > FormFunctionLocals,
>
> Uh, no, and they don't use VecGhost...


Yes, it most certainly does happen when FormFunctionLocal is used. PETSc
calls
Assembly, at least in the Plex variant. Of course, they do not use VecGhost.

   Matt


> > and would make sense to have in VecAssembly() for VecGhost I think.
>
> No.  VecAssembly goes with VecSetValues, which has *nothing* to do with
> VecGhost.  If you don't want to use VecSetValues/VecAssembly, then you
> can use VecGhost and VecGetArray on the local form, followed by
> VecGhostUpdate(x,ADD_VALUES,SCATTER_REVERSE).  You use one or the other;
> I don't have any compelling use case for using both and it definitely
> wouldn't be typical.
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160301/6edf9cdf/attachment.html>


More information about the petsc-dev mailing list