Skip to content

Snapshot restore: split geometry vs topology mesh version (deform should not invalidate) #296

Description

@lmoresi

Problem

Mesh._mesh_version is bumped on any coordinate change, including deform() (mesh motion / free-surface RK stages). The snapshot-restore path (SnapshotInvalidatedError) refuses to restore whenever _mesh_version moved:

_mesh_version moved from 0 to 1 since snapshot. mesh.adapt() rebuild on restore
is scheduled for v1.2; v1 refuses rather than corrupt the DOF arrays

But a deformation changes geometry (node coordinates) while preserving topology (connectivity, DOF layout) — the DOF arrays are not invalidated, so a snapshot taken before a deform is still structurally restorable. Only a topology change (adapt(), refinement) should force the refuse.

Proposal

Split the single _mesh_version into two counters:

Snapshot restore keys the SnapshotInvalidatedError on _topology_version only; deformation-only changes restore cleanly.

Context

Supersedes #191 (which bumped _mesh_version on direct _deform_mesh and consequently broke snapshot restore — the version-bump itself is now already done by the merged #246 deform-gate). This is the 'v1.2' follow-up the error message references.

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