Discussion:
[petsc-users] Matrix indexing for distributed DMPlex
Matthew Kury
2015-11-07 00:35:36 UTC
Permalink
Dear All,

I have been trying to figure out how to appropriately index a matrix that was created from a DMPlex with a section defined for it.

I created the matrix with DMCreateMatrix() and I tried to index the entries by using the ISLocalToGlobalMapping obtained from DMGetLocalToGlobalMapping, with the local indices being those obtained from PetscSectionGetOffset() with the appropriate points from the D.A.G. However this does not seem to work.

In particular, with the ISLocalToGlobalMapping, what I understand is that it gives the relationship of the local indexing to the global indexing, however there are negative numbers in this mapping which I fail to find an explanation of in the documentation. In addition, there do not appear to be redundant indexes to the global matrix as one would expect in a distributed DMPlex because there can be some of the same points on different processors.

Any help is greatly appreciated.

Thank you for your time,


Matthew W. Kury
Ph.D. Candidate
CMRL UC Berkeley
M.S. Mechanical Engineering UC Berkeley, 2014
Matthew Knepley
2015-11-07 02:16:49 UTC
Permalink
Post by Matthew Kury
Dear All,
I have been trying to figure out how to appropriately index a matrix that
was created from a DMPlex with a section defined for it.
I created the matrix with DMCreateMatrix() and I tried to index the
entries by using the ISLocalToGlobalMapping obtained from
DMGetLocalToGlobalMapping, with the local indices being those obtained from
PetscSectionGetOffset() with the appropriate points from the D.A.G. However
this does not seem to work.
It should work. However, you can always get the global section using
DMGetDefaultGlobalSection() which directly gives global offsets,
although nonlocal offsets are stored as -(off+1).
Post by Matthew Kury
In particular, with the ISLocalToGlobalMapping, what I understand is that
it gives the relationship of the local indexing to the global indexing,
however there are negative numbers in this mapping which I fail to find an
explanation of in the documentation. In addition, there do not appear to be
redundant indexes to the global matrix as one would expect in a distributed
DMPlex because there can be some of the same points on different
processors.
Yes, the negative numbers are -(off+1) for nonlocal offsets. I am not sure
I understand your point about redundant offsets.

Thanks,

Matt
Post by Matthew Kury
Any help is greatly appreciated.
Thank you for your time,
Matthew W. Kury
Ph.D. Candidate
CMRL UC Berkeley
M.S. Mechanical Engineering UC Berkeley, 2014
--
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
Loading...