Jets: one jet may drive links of only one body

surface_link_velocity (the shared host check used by CurvedLinkSoA,
ObjectManager sync, prepare_fine_boundary and FixedPatchStepper) now
rejects a jet whose selected cut links carry more than one body id, at
any amplitude, before uploads. Identity is the scene-wide body id of the
physical cut-link list, so one body spanning storage blocks stays valid.
No body selector; empty-selection semantics unchanged.

Tests: two bodies under one jet rejected (amplitude 2e-3 and 0) on the
Simulation/manager path and on the fine path; separate jets on separate
bodies accepted on both; one fine body crossing 2x2 block seams accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-10-16 02:39:58 +00:00
co-authored by Claude Opus 5.5
parent f1e03423f3
commit 64d54ab23e
3 changed files with 54 additions and 1 deletions
@@ -47,6 +47,17 @@ def mocked(objects, jets, fine_block):
class JetStepperCPU(unittest.TestCase):
def test_one_body_across_blocks_accepted(self):
# Fine circle (19.5, 15.5) R4.3 crosses the 2x2 block seams; one body, one jet.
import math
from CelerisLab.body.jets import Jet, Radial, Sector
C = (16.0, 12.0)
whole = Jet(Sector(C, .1, math.pi, 3.), Radial(C, inward=False), amplitude=0.)
backend, _ = mocked([circle()], [whole], FINE_BLOCKS[1])
_, jet_id = backend._jet_cache
self.assertGreater(len(np.unique(backend._fine_tables["block"][jet_id == 0])), 1)
backend.close()
def test_blocked_jet_velocity_matches_legacy_rows(self):
legacy, _ = mocked([circle(actuation(SPEED))], (), FINE_BLOCKS[1])
driven, _ = mocked([circle()], [jet()], FINE_BLOCKS[1])