Skip to content

Commit d74bfc1

Browse files
committed
port test_misc to arraycontext
1 parent be42a79 commit d74bfc1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/test_misc.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def test_pde_check_kernels(actx_factory, knl_info, order=5):
112112
actx = actx_factory()
113113

114114
dim = knl_info.kernel.dim
115-
tctx = t.ToyContext(actx, knl_info.kernel,
115+
tctx = t.ToyContext(knl_info.kernel,
116116
extra_source_kwargs=knl_info.extra_kwargs)
117117

118118
rng = np.random.default_rng(42)
@@ -127,7 +127,7 @@ def test_pde_check_kernels(actx_factory, knl_info, order=5):
127127

128128
for h in [0.1, 0.05, 0.025]:
129129
cp = CalculusPatch(np.array([1, 0, 0])[:dim], h=h, order=order)
130-
pot = pt_src.eval(cp.points)
130+
pot = pt_src.eval(actx, cp.points)
131131

132132
pde = knl_info.pde_func(cp, pot)
133133

@@ -297,19 +297,19 @@ def test_toy_p2e2e2p(actx_factory, case):
297297
from sumpy.expansion import VolumeTaylorExpansionFactory
298298

299299
actx = actx_factory()
300-
ctx = t.ToyContext(actx,
300+
ctx = t.ToyContext(
301301
LaplaceKernel(dim),
302302
expansion_factory=VolumeTaylorExpansionFactory())
303303

304304
errors = []
305305

306306
src_pot = t.PointSources(ctx, src, weights=np.array([1.]))
307-
pot_actual = src_pot.eval(tgt).item()
307+
pot_actual = src_pot.eval(actx, tgt).item()
308308

309309
for order in ORDERS_P2E2E2P:
310-
expn = case.expansion1(src_pot, case.center1, order=order)
311-
expn2 = case.expansion2(expn, case.center2, order=order)
312-
pot_p2e2e2p = expn2.eval(tgt).item()
310+
expn = case.expansion1(actx, src_pot, case.center1, order=order)
311+
expn2 = case.expansion2(actx, expn, case.center2, order=order)
312+
pot_p2e2e2p = expn2.eval(actx, tgt).item()
313313
errors.append(np.abs(pot_actual - pot_p2e2e2p))
314314

315315
conv_factor = approx_convergence_factor(1 + np.array(ORDERS_P2E2E2P), errors)

0 commit comments

Comments
 (0)