[petsc-users] ghost nodes with a DMPlex
Matthew Knepley
knepley at gmail.com
Wed Jan 16 12:15:47 CST 2019
On Wed, Jan 16, 2019 at 1:12 PM Yann Jobic via petsc-users <
petsc-users at mcs.anl.gov> wrote:
> Hi, sorry if this is an obvious question, but i don't know how to use
> the ghost nodes with a DMPlex.
>
DMGlobalToLocal() and DMLocalToGlobal().
> The procedure i do is as follow :
>
> 1) create the DMPlex
>
> 2) distribute it
>
> 3) Create the Matrix and associated vectors with DMCreateMatrix,
> DMCreateGlobalVector and DMCreateLocalVector
>
> 4) In each cells, compute the different integrals (FEM code)
>
Yes
> I know the location of the ghost points, as the global index is negative
> (and the global index is -(i+1) using the global PetscSection).
>
Yes
> (I didn't use DMPlexConstructGhostCells, as i understood that is should
> be used for flux calculations on faces for FV methods).
>
Yes
> I would like to update the contributions of those ghost nodes, where the
> vertex actually is (in a different processor).
>
Yes, use LocalToGlobal()
> So far, i used VecSetValues with the local indexes of the local vector.
> Then i used DMLocalToGlobalBegin in order to update them. It's working
> fine.
>
Okay, that is the way to do it.
> I tried MatSetValues on the global Matrix with the global indexes. It
> seems to work.
>
Yes
> However, maybe i'm doing it the wrong way, with a lot of communications.
> Is it a scalable way the handle them ? How should i do it ?
>
What you described is scalable. There is only 1 communication.
Thanks,
Matt
> If i can have a starting point, it would be great !
>
> Any help would be greatly appreciated!
>
> Regards,
>
> Yann
>
>
--
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
https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190116/82f0f494/attachment.html>
More information about the petsc-users
mailing list