<div dir="ltr"><div>Dear Petsc users and developers,<br></div><div><br></div><div>I am exploring the mapping between local, partition and global dofs.<br></div><div>The following is my pseudo code, dof2Partitionmapping denotes the mapping between the local dof (20 local dofs each tetrahedra) and partition dof.<br></div><div>Is this mapping determined by Petsc itself under the hood (PetscSectionGetOffset)?</div><div>For now, I am coding this mapping (local to partition) myself just based on the edge and face number in the partition. It seems the results are reasonable. But with this kind of self-defined mapping, the owned dofs and ghost dofs are interleaved. Will this bring bad results for the communication of MatStash? <br></div><div><br></div><div>Thanks,<br></div><div>Xiaodong<br></div><div><br></div><div><b>1. set 2 dofs for each edge  and 2 dofs for each edge face respectively</b></div><div>PetscSectionSetChart(s, faceStart, edgeEnd);</div><div>PetscSectionSetDof(s, faceIndex, 2); </div><div>PetscSectionSetFieldDof(s, faceIndex, 0, 1);<br></div><div>PetscSectionSetDof(s, edgeIndex, 2); </div><div>PetscSectionSetFieldDof(s, edgeIndex, 0, 1);<br></div><div>PetscSectionsetup(s)</div><div><br></div><div><b>2.  Create matrix based on DMPlex</b><br></div><div> DMSetMatType(dm, MATAIJ); </div><div> DMCreateMatrix(dm, &A);<br></div><div><br></div><div><b>3. loop over elements to set local values for Matrix</b><br></div><div>MatSetValuesLocal(A, dof2Partitionmapping.size(), dof2Partitionmapping.data(), dof2Partitionmapping.size(), dof2Partitionmapping.data(), Matrix_Local.data(), ADD_VALUES);</div></div>