[petsc-users] interpreting results of ISLocalToGlobalMappingView
Matthew Knepley
knepley at gmail.com
Sun Jun 4 19:15:13 CDT 2017
On Sun, Jun 4, 2017 at 7:08 PM, Wang <quanwang.us at gmail.com> wrote:
> Hello. I have some confusions about the results given
> by ISLocalToGlobalMappingView.
>
> After reading a simple mesh and associate each vertex with a scalar dof,
> the test code uses DMPlexDistribute to get a distributed dm. Then I use the
> following calls
>
> call DMGetLocalToGlobalMapping(dm,ltog,ierr)
> call ISLocalToGlobalMappingView(ltog, PETSC_VIEWER_STDOUT_WORLD, ierr);
>
> and get following results for l2g. (MatGetOwnershipRange gives [0 3] for
> rank 0 and [3 9] for rank 1)
>
> ISLocalToGlobalMapping Object: 2 MPI processes
> type: basic
> [0] 0 0
> [0] 1 1
> [0] 2 5
> [0] 3 2
> [0] 4 6
> [0] 5 8
> [1] 0 3
> [1] 1 4
> [1] 2 5
> [1] 3 6
> [1] 4 7
> [1] 5 8
>
>
> The question is why, on rank 0, the global indices (I assume the third
> column) are not grouped into local chunks and ghost chunks. I understand
> how to do local to global mapping without any concern of the actual
> ordering, but I have some impression that in PETSC the ghost information is
> always coming later in the local vector.
>
Nope. That is only guaranteed when using VecGhost.
> In this case, on rank 0, global index 5 should appear later than 0,1,2,
> because it is ghost vertex for rank 0.
>
> I'm not trying to use this for FEM, but instead using the mesh management
> in dmplex for other tasks. So I need to know more details.
>
We base the dof ordering on the mesh ordering. If you ordered the shared
parts of the mesh last, this would produce the ordering you expect.
Matt
> Thank you.
>
> QW
>
--
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
http://www.caam.rice.edu/~mk51/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170604/0e4d4972/attachment.html>
More information about the petsc-users
mailing list