test: construct shear remap fixture through per-level API
This commit is contained in:
@@ -8,14 +8,17 @@ from contextlib import ExitStack
|
|||||||
import unittest
|
import unittest
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from CelerisLab.cuda.context import CudaContext
|
from CelerisLab.cuda.context import CudaContext
|
||||||
from research.shear_refinement.example import (CHILDREN, make, initialize, observe,
|
from CelerisLab.lbm.refinement_stepper import FixedPatchStepper
|
||||||
topology, objects)
|
from research.shear_refinement.example import (CFG, PARENTS, CHILDREN, initialize,
|
||||||
|
observe, topology, objects)
|
||||||
|
|
||||||
|
|
||||||
class ShearRefinementGPU(unittest.TestCase):
|
class ShearRefinementGPU(unittest.TestCase):
|
||||||
def test_measured_growth_matches_explicit_manual_continuation(self):
|
def test_measured_growth_matches_explicit_manual_continuation(self):
|
||||||
with CudaContext(0) as ctx, ExitStack() as owned:
|
with CudaContext(0) as ctx, ExitStack() as owned:
|
||||||
old = owned.enter_context(make(ctx))
|
old = owned.enter_context(FixedPatchStepper(
|
||||||
|
CFG, context=ctx, refinements=[PARENTS, CHILDREN],
|
||||||
|
level_blocks=[(4, 4)] * 3, level_objects=[(), (), objects()]))
|
||||||
initialize(old)
|
initialize(old)
|
||||||
old.step(2)
|
old.step(2)
|
||||||
before = old.download()
|
before = old.download()
|
||||||
|
|||||||
Reference in New Issue
Block a user