Migrate current callers to level-indexed refinement API
This commit is contained in:
@@ -204,7 +204,7 @@ class BlockedBaseCPU(unittest.TestCase):
|
||||
level_blocks=[(3, 4), FINE_BLOCK],
|
||||
level_objects=[(), (circle(actuation(.002)),)])
|
||||
try:
|
||||
backend.initialize(state(NY, NX, 1), state(*backend.patch.fine_shape, 2))
|
||||
backend.initialize(state(NY, NX, 1), state(*backend.hierarchy.pairs[0].fine_shape, 2))
|
||||
coarse, fine = backend._levels
|
||||
current, spare, fine_current = coarse.current, coarse.spare, fine.current
|
||||
backend.step(2)
|
||||
@@ -255,7 +255,7 @@ class BlockedBaseCPU(unittest.TestCase):
|
||||
with mocked_backend() as m:
|
||||
backend = FixedPatchStepper(config("periodic"), context=m["context"], refinements=[BOUNDS],
|
||||
level_blocks=[(3, 4), FINE_BLOCK])
|
||||
backend.initialize(state(NY, NX, 1), state(*backend.patch.fine_shape, 2))
|
||||
backend.initialize(state(NY, NX, 1), state(*backend.hierarchy.pairs[0].fine_shape, 2))
|
||||
m["functions"]["BlockCoalesce"].side_effect = RuntimeError("injected parent stage failure")
|
||||
current = backend._levels[0].current
|
||||
with self.assertRaisesRegex(RuntimeError, "injected parent stage"):
|
||||
|
||||
Reference in New Issue
Block a user