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:
co-authored by
Claude Opus 5.5
parent
f1e03423f3
commit
64d54ab23e
@@ -6,7 +6,8 @@ packing), over every link in the scene; it carries no body association.
|
||||
Per-link velocity = amplitude * profile(s) * field(hit), where ``s`` in [-1, 1]
|
||||
is the region's lateral coordinate. Velocities are lattice units of the level
|
||||
whose links are evaluated; callers convert frames/units before evaluation.
|
||||
One physical link (receiver, direction) may be driven by at most one jet.
|
||||
One physical link (receiver, direction) may be driven by at most one jet, and
|
||||
one jet may drive the links of only one body (checked at assignment, any amplitude).
|
||||
|
||||
Edge rule: the lateral bound |s| < 1 is exclusive (the profile vanishes
|
||||
there for parabolic/quartic); Sector r_min/r_max and Tube 0 <= along <= length
|
||||
@@ -222,6 +223,11 @@ def surface_link_velocity(objects, cfg, flags, fluid_idx, dir, body_id, rx, ry,
|
||||
raise ValueError("Jets require D2Q9/FP32/unshifted/double_buffer")
|
||||
shape, jet_id = jet_link_shapes(jets, hits)
|
||||
driven = jet_id >= 0
|
||||
for j in range(len(jets)): # scene-wide body identity, independent of storage blocks
|
||||
bodies = np.unique(body_id[jet_id == j])
|
||||
if len(bodies) > 1:
|
||||
raise ValueError(f"Jet {j} selects cut links of bodies {bodies.tolist()}; "
|
||||
"one jet may drive only one body")
|
||||
owners = {obj.obj_id: obj for obj in objects}
|
||||
for bid in np.unique(body_id[driven]):
|
||||
state = vars(owners[int(bid)].state)
|
||||
|
||||
Reference in New Issue
Block a user