Skip to content

Commit d6d0277

Browse files
committed
Update test for 4 dimensions (3 spatial + time)
1 parent df66f04 commit d6d0277

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/test_kernels.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,12 @@ def test_p2e2p(actx_factory, base_knl, expn_class, order, with_source_derivative
500500
# {{{ test_translations
501501

502502
@pytest.mark.parametrize("knl, local_expn_class, mpole_expn_class", [
503+
(HeatKernel(1), LinearPDEConformingVolumeTaylorLocalExpansion,
504+
LinearPDEConformingVolumeTaylorMultipoleExpansion),
503505
(HeatKernel(2), LinearPDEConformingVolumeTaylorLocalExpansion,
504506
LinearPDEConformingVolumeTaylorMultipoleExpansion),
507+
(HeatKernel(3), LinearPDEConformingVolumeTaylorLocalExpansion,
508+
LinearPDEConformingVolumeTaylorMultipoleExpansion),
505509
(LaplaceKernel(2), VolumeTaylorLocalExpansion, VolumeTaylorMultipoleExpansion),
506510
(LaplaceKernel(2), LinearPDEConformingVolumeTaylorLocalExpansion,
507511
LinearPDEConformingVolumeTaylorMultipoleExpansion),
@@ -542,7 +546,7 @@ def test_translations(actx_factory, knl, local_expn_class, mpole_expn_class,
542546

543547
# Just to make sure things also work away from the origin
544548
rng = np.random.default_rng(18)
545-
origin = np.array([0, 1, 2][-knl.dim:], np.float64)
549+
origin = np.array([0, 0, 1, 2][-knl.dim:], np.float64)
546550
sources = actx.from_numpy(
547551
0.7 * (-0.5 + rng.random((knl.dim, nsources), dtype=np.float64))
548552
+ origin[:, np.newaxis])
@@ -556,19 +560,19 @@ def test_translations(actx_factory, knl, local_expn_class, mpole_expn_class,
556560

557561
from sumpy.visualization import FieldPlotter
558562

559-
eval_offset = np.array([0.0, 0.0, 5.5][-knl.dim:])
563+
eval_offset = np.array([0.0, 0.0, 0.0, 5.5][-knl.dim:])
560564
fp = FieldPlotter(eval_offset + origin, extent=0.3, npoints=res)
561565

562566
centers = actx.from_numpy((np.array(
563567
[
564568
# box 0: particles, first mpole here
565-
[0, 0, 0][-knl.dim:],
569+
[0, 0, 0, 0][-knl.dim:],
566570

567571
# box 1: second mpole here
568-
np.array([0, 0.1, -0.2][-knl.dim:], np.float64),
572+
np.array([0, 0, 0.1, -0.2][-knl.dim:], np.float64),
569573

570574
# box 2: first local here
571-
eval_offset + np.array([0, -0.2, 0.3][-knl.dim:], np.float64),
575+
eval_offset + np.array([0, 0, -0.2, 0.3][-knl.dim:], np.float64),
572576

573577
# box 3: second local and eval here
574578
eval_offset
@@ -577,7 +581,7 @@ def test_translations(actx_factory, knl, local_expn_class, mpole_expn_class,
577581

578582
del eval_offset
579583

580-
if knl.dim == 2:
584+
if knl.dim == 2 and not isinstance(knl, HeatKernel):
581585
orders = [2, 3, 4]
582586
else:
583587
orders = [3, 4, 5]

0 commit comments

Comments
 (0)