[petsc-users] Is there easy to update the ghost value in the vector created using DMCreatLocalVector?

leejearl leejearl at mail.nwpu.edu.cn
Tue Jan 15 19:34:29 CST 2019


Hi all Petscer,

I have a question about how to update the ghost value in the vector.
The prolblem is as follow.

1. A dmplex dm object is created using DMPlexCreateFromFile
2. The dm is distributed using DMPlexDistribute, and the overlap is set
as 1.
3. The ghosted dm is constructed by DMConstructGhostCells.
4. A global Vector X and a local vector localX are created by
DMCreateGlobalVector and DMCreateLocalVector

Now, the problem is that the ghost value are needed in the computation
using local vector localX. and the ghost value must be update from the
global vector. 

For example, gCellId is the index of ghost cell in the local vector
localX of process 0, and cellId is the index of cell in the global
vector of process 1. I must update the data of cellId to gCellId. How
can I do it easily?

I can implement it use the PetscSFBcastBegin/PetscSFBcastEnd. Is there
other simple way to do it?


Any helps are appreciated.

Thanks.



leejearl



More information about the petsc-users mailing list