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

Matthew Knepley knepley at gmail.com
Wed Jan 16 07:07:04 CST 2019


On Tue, Jan 15, 2019 at 8:34 PM leejearl via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> 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?
>

Doesn't DMGlobalToLocal() work?

  Thanks,

    Matt


> Any helps are appreciated.
>
> Thanks.
>
>
>
> leejearl
>
>

-- 
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/f96af7b7/attachment.html>


More information about the petsc-users mailing list