Skip to content

Restarting a moving IB re-measures the centre of mass from the body at the restart attitude, so the kinematics change reference point across a restart #1902

Description

@sbryngelson

Symptom

A run chained across restarts is not the same run as the unrestarted one, even with #1887 applied. The difference is small but systematic and does not decay.

Cause

For geometries whose working centroid is moved to the measured centre of mass (4, 5, 11, 12), centroid_offset is measured by voxelising the body — see s_compute_centroid_offset, which sums cell centres where ib_markers is set. On a restart that measurement is repeated with the body at its restart attitude, not the attitude it had at t = 0.

Voxelisation is attitude-dependent, so the offset comes out slightly different, and the prescribed kinematics — which rotate about the hinge and place the centroid relative to it using centroid_offset — then run about a slightly different point than the run being continued.

Fix

Write the offsets the run is actually using alongside the checkpoint and restore them instead of re-measuring. We write one line per global patch (gid ox oy oz) to restart_data/ib_offset_<step>.dat at each save and restore them on restart; when the file is absent the current behaviour stands, so old checkpoints keep working.

Companion to #1887, which fixed the other half of restart continuity (the stale device num_gps). With both, a mid-beat restart of a flapping wing matches the unrestarted run to 1e-13 at +105 steps.

Found with Claude Code on OLCF Frontier.

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