Skip to content

Read the five trailing mechanics params in the order they are written - #445

Open
drbergman wants to merge 1 commit into
MathCancer:developmentfrom
drbergman:fix-resume-mechanics-order
Open

drbergman wants to merge 1 commit into
MathCancer:developmentfrom
drbergman:fix-resume-mechanics-order

Conversation

@drbergman

@drbergman drbergman commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

recreate_sim_state() (used by resume_from_MultiCellDS()) reads the five trailing mechanics parameters in one block but assigns them in a different order from the one the writer saves them in. The writer's order is relative_maximum_adhesion_distance, maximum_number_of_attachments, attachment_elastic_constant, attachment_rate, detachment_rate. As a result, every resumed cell got those five values swapped around, e.g. its attachment_elastic_constant was set to the saved relative_maximum_adhesion_distance. This PR reorders the assignments (and the debug prints) to match the writer.

🤖 Generated with Claude Code

The writer saves relative_maximum_adhesion_distance,
maximum_number_of_attachments, attachment_elastic_constant, attachment_rate,
detachment_rate, but recreate_sim_state() assigned them as if the order were
attachment_elastic_constant, attachment_rate, detachment_rate,
relative_maximum_adhesion_distance, maximum_number_of_attachments. Resumed
cells got those five values scrambled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings December 2, 2026 18:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No actionable issues were found in the reviewed changes.

No open issues 🎉

What changed in this PR

Fixes restoration of five mechanics parameters when resuming a simulation from MultiCellDS data by matching the reader’s assignments to the writer’s saved order.

Changes:

  • Reorders the five parameter assignments to prevent swapped values.
  • Updates debug output and the explanatory comment to match.
File Description
modules/​PhysiCell_MultiCellDS.cpp Corrects mechanics parameter restoration order and corresponding debug output.

Review effort: Balanced

@rheiland

rheiland commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Good catch! Weird.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants