<div dir="ltr">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<br><br>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:<br><br>mpi_A(total_elements X total_dofs)<br><br>                                                                    total_dofs<br>row_0 (element_0)                        a_0 a_1 a_2 ... a_23<br>row_1 (element_1)                                                     a_0 a_1 a_2 ... a_23<br>row_2 (element_2)                                                                                    a_0 a_1 a_2 ... a_23<br>.<br>.<br>.<br>row_n (element_n)                                     a_0 a_1 a_2 ... a_23 <br><br>The element number is related to the row index. And the matrix values are set depending of the DOFs related to the element.<br><br>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.<br><br>How to know the local or global element number related to the data provided by DMDAGetElements? <br><br>Thank you.</div>