Skip to content

Fix CylindricalBinaryCompactObject bugs in grid anchors and time dependent maps#7225

Merged
wthrowe merged 3 commits into
sxs-collaboration:developfrom
macedo22:cbco_fix_grid_anchors_and_time_dep_maps
May 7, 2026
Merged

Fix CylindricalBinaryCompactObject bugs in grid anchors and time dependent maps#7225
wthrowe merged 3 commits into
sxs-collaboration:developfrom
macedo22:cbco_fix_grid_anchors_and_time_dep_maps

Conversation

@macedo22
Copy link
Copy Markdown
Contributor

@macedo22 macedo22 commented Apr 30, 2026

Proposed changes

This fixes a couple bugs in CylindricalBinaryCompactObject involving the grid achors orientation and time dependent maps in the outer sphere region. Details are in the commit messages

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.
  • If a coding agent is used, have one of
    "Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com",
    "Co-Authored-by: Codex noreply@openai.com", or
    "Co-Authored-By: GitHub Copilot CLI noreply@microsoft.com"
    as the last line of the commit, depending on the agent.

Further comments

This fixes a bug where control_system::ControlErrors::Expansion::operator() was getting the incorrect x, y, z coordinates of the grid positions via Parallel::get<domain::Tags::ObjectCenter<domain::ObjectLabel::A>> (and same for object B).
@macedo22 macedo22 mentioned this pull request Apr 30, 2026
3 tasks
// rotation + translation map from the grid to inertial frame. No maps to
// the distorted frame
grid_to_inertial_block_maps[first_outer_shell_block] =
grid_to_inertial_block_maps[74] =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like later on line 987 this is still accessed as grid_to_inertial_block_maps[first_outer_shell_block]. Is that still right?

Also, if the first outer shell block is always 74 we shouldn't have a variable first_outer_shell_block containing something else, and if it isn't always 74 then the comment on this line is no longer correct. One of these should be fixed, but I'm not sure which one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

74 is still correct in this case because when both inner spheres are included, it's 74, and we currently have it that if time dependent options are used, both inner spheres and the outer one must be used. However, I think this is pretty fragile and less maintainable. There is a reason we have first_outer_shell_block as a variable, and it's because it can change. I'm going to revert this 74->first_outer_shell_block in a fixup because that's definitely better, especially given that we'll be adding support for spherical shells for the inner spheres, which will shift these block numbers around.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, all these magic numbers floating around aren't great, but your change makes sense now. Looks good.

macedo22 added 2 commits May 6, 2026 17:39
Blocks in outer sphere (blocks >= 74) should have the transition expansion, but it had the rigid expansion.
Removes unused variable and adds missing consts
@macedo22 macedo22 force-pushed the cbco_fix_grid_anchors_and_time_dep_maps branch from 7334d18 to 2cc7476 Compare May 6, 2026 21:40
@macedo22
Copy link
Copy Markdown
Contributor Author

macedo22 commented May 6, 2026

@wthrowe Directly squashed in the 74->first_outer_shell_block change

@wthrowe wthrowe merged commit 2a5c5b6 into sxs-collaboration:develop May 7, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants