[petsc-users] accessing global vector in a DMMA

Jed Brown jedbrown at mcs.anl.gov
Wed Aug 21 23:07:41 CDT 2013


Zhang <zyzhang at nuaa.edu.cn> writes:

> Dear All,
> Now I am confused with the way to access a global vector defined from DMDA.
>
> Here is the codes. When I switch on _DEBUG1_ the results get wrong.  While if it's off,
>
> the results fine. I just wonder why I gave to use the local form of ul,vl,wl to access the
> values such as ul[k][j][i+1], and etc.

The global vector doesn't contain space for those ghost points, so you
have to scatter to the local vector if you want to access ghost points.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130822/f99fc6da/attachment.pgp>


More information about the petsc-users mailing list