Non-matching coordinate ordering for CG1 functions defined on submeshes

It is intended behavior as:

  1. the function is designed to work with arbitrary order function spaces and meshes, you cannot rely on this 1-1 correspondence.
  2. It is supposed to work in parallel (on data partitioned with mpi), which introduces a whole other set of considerations

Why do you rely on this ordering being the same?
There are several functions to map data from degrees of freedom to vertices, and even the mesh geometry nodes, as discussed in:

(And to some extent in: Renumbered .msh imported data giving wrong subdomains - #4 by dokken)

I would start with mapping dofs in the submesh to the nodes of the geometry in the submesh, and then use the last output argument of ‘create_submesh` to map these geometry indices from the submesh to the parent mesh.
https://docs.fenicsproject.org/dolfinx/v0.9.0/python/generated/dolfinx.mesh.html#dolfinx.mesh.create_submesh

1 Like