Jets: explicit cell-edge/node frame conversion, same-physical-hit test

Replace fine_hits_to_physical with fine_hits_to_edge_frame (patch
cell-edge frame, coarse centers at I+1/2, as FixedPatchStepper uses) and
edge_to_node_frame (Simulation integer-node frame, shift -1/2). Test one
physical circle through both frames: fine hits converted to node frame
lie on the Simulation circle and one node-frame Jet selects the same arc
on coarse and fine links; relabelling without conversion is detected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-15 08:23:28 +00:00
1 parent b1cd555b0f
commit da8bfb0d4a
2 files changed
+45 -5

No files matched your search

+13 -2
View File
@@ -156,6 +156,17 @@ def jet_link_velocity(jets, shape, jet_id):
return (amplitude[jet_id][:, None]*shape).astype(np.float32)
def fine_hits_to_physical(hits_local, fine_origin, dx):
"""Fine-local cell-index hits -> physical frame: origin + dx*(hit + 1/2)."""
# Two coarse-unit frames coexist (see FixedPatchStepper docs): the patch
# cell-edge frame puts coarse cell I's center at I + 1/2, while Simulation
# geometry uses the integer-node frame with that center at I. Jets are
# evaluated in the frame their region/field were written in; convert hits
# explicitly, never by relabelling.
def fine_hits_to_edge_frame(hits_local, fine_origin, dx):
"""Fine-local cell-index hits -> coarse cell-edge frame: origin + dx*(hit + 1/2)."""
return np.asarray(fine_origin, np.float64) + dx*(np.asarray(hits_local, np.float64) + .5)
def edge_to_node_frame(points):
"""Coarse cell-edge frame -> Simulation integer-node frame (shift by -1/2)."""
return np.asarray(points, np.float64) - .5