[petsc-users] DMDAGetElements and global/local element number

Emmanuel Ayala juaneah at gmail.com
Thu Sep 12 14:19:48 CDT 2019


Hi everyone, it would be great if someone can give me a hint for this
issue, i have been trying to figure out how to solve it, but i did not
succeed

I'm using DMDA to generate a 3D mesh (DMDA_ELEMENT_Q1). I'm trying to fill
a MPI matrix with some values wich are related to the dofs of each element
node, moreover i need to set this values based on the element number.
Something like:

mpi_A(total_elements X total_dofs)

                                                 total_dofs
row_0 (element_0)                      a_0 a_1 a_2 ... a_23
row_1 (element_1)                                     a_0 a_1 a_2 ... a_23
row_2 (element_2)
a_0 a_1 a_2 ... a_23
.
.
.
row_n (element_n)                            a_0 a_1 a_2 ... a_23

The element number is related to the row index. And the matrix values are
set depending of the DOFs related to the element.

With DMDAGetElements i can read the LOCAL nodes connected to the element
and then the DOFs associated to the element. I can handle the local and
global relations with DMGetLocalToGlobalMapping, MatSetLocalToGlobalMapping
and MatSetValuesLocal. BUT i CAN NOT understand how to know the element
number in LOCAL or GLOBAL contex. DMDAGetElements gives the NUMBER OF
ELEMENTS owned in the local process, but there is not any information about
the local or global ELEMENT NUMBER.

How to know the local or global element number related to the data provided
by DMDAGetElements?

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190912/a535f621/attachment.html>


More information about the petsc-users mailing list