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.
Problem
Mesh._mesh_versionis bumped on any coordinate change, includingdeform()(mesh motion / free-surface RK stages). The snapshot-restore path (SnapshotInvalidatedError) refuses to restore whenever_mesh_versionmoved: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_versioninto two counters:_geometry_version— bumped ondeform()/ coordinate mutation (drives the kdtree navigation-cache invalidation added in Consolidate and unify cached spatial indexing (KDTree) #182/Invalidate evaluate/DMInterp/topology caches on Mesh._deform_mesh #188)._topology_version— bumped onadapt()/ refinement (drives the snapshot refuse).Snapshot restore keys the
SnapshotInvalidatedErroron_topology_versiononly; deformation-only changes restore cleanly.Context
Supersedes #191 (which bumped
_mesh_versionon direct_deform_meshand 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.