From 5c37d75dc4e497832eee9eb2a3fc29dd5f56947d Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 15 Oct 2026 04:49:34 +0000 Subject: [PATCH] Validate physical fine_cfg before surface_link_velocity The blocked actuated path called the helper with an unvalidated fine config (nq=0), so receiver*nq+dir collapsed distinct writers and the unique-writer guard fired. Validate after wall-aware sanitization, as the dense path does before assign_surface; the test's fine_cfg helper too. Unique-writer guard unchanged. Co-Authored-By: Claude Opus 5.5 --- src/CelerisLab/lbm/refinement_stepper.py | 1 + tests/validation/multigrid/test_refinement_blocked_fine.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/CelerisLab/lbm/refinement_stepper.py b/src/CelerisLab/lbm/refinement_stepper.py index 58ec5d3..cb649a6 100644 --- a/src/CelerisLab/lbm/refinement_stepper.py +++ b/src/CelerisLab/lbm/refinement_stepper.py @@ -134,6 +134,7 @@ class FixedPatchStepper: b = self.fine_boundary self._actuated = any(obj.surface_actuation is not None for obj in b.objects) if self._actuated: + fine_cfg.validate() # derives nq etc.; the unique-writer key needs them fluid_idx, dirs, _, body_id, rx, ry, _, _ = b.curved_host self._fine_tables["surface_velocity"], _ = surface_link_velocity( b.objects, fine_cfg, b.flags, fluid_idx, dirs, body_id, rx, ry) diff --git a/tests/validation/multigrid/test_refinement_blocked_fine.py b/tests/validation/multigrid/test_refinement_blocked_fine.py index 7f65274..06448ce 100644 --- a/tests/validation/multigrid/test_refinement_blocked_fine.py +++ b/tests/validation/multigrid/test_refinement_blocked_fine.py @@ -74,6 +74,7 @@ def fine_cfg(mode, patch): if mode == "slot_reservoir": cfg = replace(cfg, y_wall_bc="bounce_back", top_wall_bc="velocity", wall_slot_width=0, wall_normal_velocity=0.0, velocity=0.0) + cfg.validate() # as the stepper does before surface_link_velocity return cfg