Add opt-in row-owned raw boundary exchange for blocked refinement

This commit is contained in:
Codex committed 2026-10-16 18:47:04 -07:00
1 parent 21bcb8a141
commit c750493b07
9 files changed
+658 -10

No files matched your search

+10 -1
View File
@@ -77,6 +77,9 @@ class _BlockedBoundary:
flags: object = None
device: object = None
kernel: object = None
last_raw: object = None
interval_integral: object = None
accumulate: object = None
def _prepare_blocked_boundary(boundary, layout, cfg, jets):
@@ -84,11 +87,17 @@ def _prepare_blocked_boundary(boundary, layout, cfg, jets):
return None
fluid_idx, dirs, q, body_id, rx, ry, _, fallback = boundary.curved_host
tables, _ = blocked_link_tables(layout, boundary.flags, fluid_idx, dirs, q, fallback)
# Physical row identity excludes body_id: duplicate owners are always wrong.
keys = np.column_stack((fluid_idx, dirs))
if len(np.unique(keys, axis=0)) != len(keys):
raise ValueError("duplicate physical boundary cut-link")
tables.update(body_id=np.asarray(body_id, np.int32), rx=np.asarray(rx, np.float32),
ry=np.asarray(ry, np.float32), aperture=np.zeros(len(dirs), bool))
actuated = bool(jets) or any(o.surface_actuation is not None for o in boundary.objects)
if actuated:
cfg = replace(cfg)
cfg.validate()
tables["surface_velocity"], _ = surface_link_velocity(
tables["surface_velocity"], tables["aperture"] = surface_link_velocity(
boundary.objects, cfg, boundary.flags, fluid_idx, dirs, body_id, rx, ry,
jets=jets, hits=boundary.curved_hits)
return _BlockedBoundary(boundary, tables, jets, actuated,