-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: When making a mesh hierarchy from a base mesh loaded from file, the fine mesh does not match the coarse mesh #3739
Comments
I think the coordinates of the mesh saved in |
Details: A Firedrake mesh object wraps a PETSc DMPlex object, which contains the topology information and the coordinates. As Firedrake uses different DoF orderings from PETSc, we convert DMPlex coordinates to Firedrake coordinates when the mesh is initialised using reorderd_coords function: Line 1948 in d041208
When Firedrake's coordinates are modified, coordinates of the underlying DMPlex are not automatically updated accordingly. (If we then save/load the mesh, both Firedrake coordinates and the unsynchronised DMPlex coordinates are saved/loaded, but checkpointing is not directly relevant here.) This causes a problem as MeshHierarchy uses a DMPlex function to do refinement, and this DMPlex function will not know that coordinates have been modified. So, when you modify Firedrake coordinates, you might also want to modify DMPlex coordinates accordingly. This can be done (if you do not have high order coordinates) by doing the reverse of |
What do we need to do to start natively using the DMPlex coordinates? Is it not simply that we need to build a new cell-node map that has an extra permutation? In the same way that we do hex meshes? I'm guessing that there might be issues to do with higher-order coordinates - does DMPlex support them? |
I think DMPlex supports higher-order coordinates. We first need to have |
This doesn't strike me as being too difficult. We already build Sections like this.
Indeed, I was thinking we could represent this as an alternative variant of a normal |
Describe the bug
I am loading a mesh from a file and making a mesh hierarchy. I expect the refined mesh to coincide with the coarse mesh. It does not.
Steps to Reproduce
Save and gunzip the following mesh.
mesh_0.h5.gz
Run
I find that
mesh_initial.pvd
matches perfectly withmesh_after_0.pvd
(as expected, but thatmesh_after_0.pvd
andmesh_after_1.pvd
do not coincide geometrically.Zoom in at the leading edge of the coarse mesh, coloured in red (
mesh_after_0.pvd
)The same view of the fine mesh, coloured in blue (
mesh_after_1.pvd
)Expected behavior
I expected the two meshes to coincide geometrically.
Environment:
firedrake-status
Additional Info
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: