FixedPatchStepper: exchange metadata on the boundary record; _boundaries name
- _exchange_spacing/_exchange_centers (two more per-level lists, only read for levels that have a boundary) become _BlockedBoundary.spacing/centers. - _level_blocks dropped: remap_finest reads each layout's own .block. - _device_boundaries -> _boundaries: the record holds host geometry, tables, Jets and device handles, so 'device' was misleading (the old host-only _boundaries list no longer exists). Tests migrated mechanically. Remaining per-level lists (_layouts, _level_cfgs, _leaf, _state, _boundaries) are the immutable construction plan, built before the memory preflight and kept after close; _levels holds device handles only and is cleared on close. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c5a3cdb757
commit
442979b4db
18 files changed
+85
-84
No files matched your search
@@ -62,9 +62,9 @@ class PinnedBodyRemap(unittest.TestCase):
|
||||
run.set_jet_amplitude(0,.017,level=2)
|
||||
before=run.download()
|
||||
clone=run.remap_finest(B,objects=objects)
|
||||
self.assertEqual(clone._device_boundaries[2].jets[0].amplitude,.017)
|
||||
np.testing.assert_array_equal(clone._device_boundaries[2].tables['surface_velocity'],
|
||||
run._device_boundaries[2].tables['surface_velocity'])
|
||||
self.assertEqual(clone._boundaries[2].jets[0].amplitude,.017)
|
||||
np.testing.assert_array_equal(clone._boundaries[2].tables['surface_velocity'],
|
||||
run._boundaries[2].tables['surface_velocity'])
|
||||
self.assertTrue(same_physical_boundary(run.boundaries[2],clone.boundaries[2]))
|
||||
clone.step()
|
||||
self.assertEqual((run.step_count,clone.step_count),(7,8))
|
||||
@@ -74,8 +74,8 @@ class PinnedBodyRemap(unittest.TestCase):
|
||||
def test_static_body_without_actuation(self):
|
||||
run,module,allocations,storage,objects=ready(jets=())
|
||||
clone=run.remap_finest(A,objects=objects)
|
||||
self.assertFalse(clone._device_boundaries[2].actuated)
|
||||
self.assertNotIn('surface_velocity',clone._device_boundaries[2].tables)
|
||||
self.assertFalse(clone._boundaries[2].actuated)
|
||||
self.assertNotIn('surface_velocity',clone._boundaries[2].tables)
|
||||
for a,b in zip(run.download(),clone.download()): np.testing.assert_array_equal(a,b)
|
||||
clone.close();run.close()
|
||||
|
||||
|
||||
Reference in new issue
Block a user