Skip to content

Reloading a checkpointed mesh built with refinement>=1 gives a corrupt DM: the integral of 1 is 0.07 on a unit square and the kinetic energy is negative #690

Description

@lmoresi

petsc_save_checkpoint on a mesh built with refinement=2 (UnstructuredSimplexBox(cellSize=4/64, refinement=2), 9824 cells, three-level hierarchy) writes a mesh file that uw.discretisation.Mesh(<mesh h5>) reloads with the same cell count and a rebuilt three-level hierarchy, but with the vertices in a different order: the same-index coordinate mismatch between the reloaded mesh and the mesh rebuilt by the original call is 1.0 (the domain size) at both the vertices and the P2 nodes. read_timestep maps the saved field by DOF index, so a P2 velocity read back onto the reloaded mesh is scrambled (the render is a jumble of triangles); read onto a mesh rebuilt by the original call it is correct. Meshes without refinement round-trip correctly (the Re 100 and Re 400 cavity runs from the same driver render fine).

The reload appears to re-refine the saved base rather than restore the refined DM, which renumbers the points. Workaround used in ~/+Simulations/navier_stokes_supg/scripts/render_ns.py (-uw_rebuild cavity:64:2): rebuild the mesh the way the run did and read the fields into that. Related to the split-mesh round-trip defect #640 in shape (a checkpoint that does not preserve the DOF map).

Underworld development team with AI support from Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions