[petsc-users] updating the host value using the ghost values

Jed Brown jed at 59A2.org
Sun May 2 13:35:53 CDT 2010


On Sun, 2 May 2010 13:26:21 -0500, "Ravi Kannan" <rxk at cfdrc.com> wrote:
> Does anyone have a small function (petsc function), which takes in a vector
> (having host + ghost cell values of a scalar) and then updates the host
> values using the ghost values. The converse is well known :  update the
> ghost using the host. But how about updating the host from the ghost values?

To the sum the values on the owning process, you can use
DALocalToGlobalBegin(da,local,global) or
VecScatterBegin(scatter,local,global,ADD_VALUES,SCATTER_REVERSE).
INSERT_VALUES doesn't make sense in this context because shared values
are often ghosted multiple times.

Jed


More information about the petsc-users mailing list