Skip to content

BoxInternalBoundary returns a point onto the wall it left by, that coordinate only - #1253

Merged
lmoresi merged 2 commits into
developmentfrom
bugfix/box-internal-boundary-clamp
Nov 20, 2026
Merged

lmoresi merged 2 commits into
developmentfrom
bugfix/box-internal-boundary-clamp

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 20, 2026

Copy link
Copy Markdown
Member

BoxInternalBoundary's return_coords_to_bounds had two faults:

  • It set every coordinate of an out-of-bounds point to the bound it had crossed (coords[x00s, :] = minCoords[0]). A point at (−0.25, 0.5) came back as (0, 0).
  • In 3-D it tested the y column against the z bounds.

Any point it clamped came back in the wrong place: a semi-Lagrangian departure point, or a swarm particle that left the box.

It now clamps each axis onto its own bound and leaves the other coordinates alone, as StructuredQuadBox does. An unstructured simplex box does the same after #1252. No issue was filed; this body is the report. It was found while reading the box clamps for #1252.

Test

test_1246 uses a 2-D box of 2 × 1 and a 3-D box of 2 × 1 × 3, so that every bound is distinct. It moves a point 0.25 outside each wall in turn. Each must return onto that wall with its other coordinates unchanged, and a point inside must be left alone.

  • On development: 2 failed. The first point, at x = −0.25, came back as all zeros in 2-D and in 3-D.
  • On this branch: passed.

The other tests that build a BoxInternalBoundary pass: test_0001 (meshes), 0502, 1069, 1103, 1184 and 1185, 67 passed with test_1246's file and test_0001 counted separately (19 passed).

Measured by H7 (the stress-history desk, a Claude session on a 96-thread Linux workstation: Intel Xeon Gold 6240R, MPICH).

Checklist (UW3 Style Charter)

  • Style Charter followed (S2); no drive-by changes (S9)
  • Regression test written first, with level_1 and tier_a markers; it fails on development (S8)
  • No hedging names, commented-out code or exception swallows (S3, S4)
  • Rank-local clamp, the same on every rank (S11)
  • The bounds are the box's own, not coordinates identifying entities (S12); no dependency changes
  • AI-assisted

Underworld development team with AI support from Claude Code

…ordinate only

Its return_coords_to_bounds set every coordinate of an out-of-bounds point to the bound
it had crossed, and in 3-D tested the y column against the z bounds. It now clamps each
axis onto its own bound, as StructuredQuadBox does (test_1246, a box with distinct bounds
per axis).

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 20, 2026 04:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@lmoresi
lmoresi merged commit 04f1ef7 into development Nov 20, 2026
10 checks passed
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