Hi, sorry if this is an obvious question, but i don't know how to use the ghost nodes with a DMPlex.

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)

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).

(I didn't use DMPlexConstructGhostCells, as i understood that is should be used for flux calculations on faces for FV methods).

I would like to update the contributions of those ghost nodes, where the vertex actually is (in a different processor).

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.

I tried  MatSetValues on the global Matrix with the global indexes. It seems to work.

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 ?

If i can have a starting point, it would be great !

Any help would be greatly appreciated!

Regards,

Yann

Reply via email to