Ghost nodes in Mesh.geometry and Mesh.topology IndexMap

Hello,

I have a question about the mesh implementation in dolfinx.

Suppose that mesh is an object of type dolfinx.mesh.Mesh.
Then the objects mesh.geometry.index_map() and mesh.topology.index_map(0) stores the information regarding the indices of the nodes of the mesh.
If I run the code on only one processor, the two index_map coincides and are coherent. When I run the code in parallel instead, the information regarding the local nodes is still coherent among the two objects but the order of the ghost nodes is different.

Is there a reason why the order of the ghost nodes cannot be the same in both objects?
Is there an official method to move from one ordering of the ghost nodes to the other?

Best,
Federico

The mesh geometry and topology are separated due to the fact that the mesh geometry can be higher order (using curved elements), while the mesh topology only stores vertices (not nodes on facets).

You can use entities_to_geometry to go from the mesh topology to the geometry indices: Code search results ยท GitHub

Thank you a lot for the answer.