diff --git a/sumpy/qbx.py b/sumpy/qbx.py index bf2922eba26839f394ccab484b886e415ad8bd2a..5a05c0578c2d0f751b337f0f5347c4a92135dba4 100644 --- a/sumpy/qbx.py +++ b/sumpy/qbx.py @@ -75,16 +75,6 @@ class LayerPotentialBase(KernelComputation, KernelCacheWrapper): from pytools import single_valued sdr = SourceDerivativeRemover() tdr = TargetDerivativeRemover() - if source_kernels is None and target_kernels is None: - from warnings import warn - warn("A list for the second argument of the constructor is deprecated." - "Use a single expansion and pass source_kernels and target_kernels", - DeprecationWarning, stacklevel=2) - source_kernel = single_valued(tdr(exp.kernel) for exp in expansion) - base_kernel = sdr(source_kernel) - target_kernels = tuple(sdr(exp.kernel) for exp in expansion) - source_kernels = (source_kernel,) - expansion = expansion[0].copy(kernel=base_kernel) KernelComputation.__init__(self, ctx=ctx, target_kernels=target_kernels, strength_usage=strength_usage, source_kernels=source_kernels, diff --git a/test/test_matrixgen.py b/test/test_matrixgen.py index d56341d273aab24444cd028be98feb16f57183cd..c51fc3ce3769d3269742a29b3f113f164cd778ef 100644 --- a/test/test_matrixgen.py +++ b/test/test_matrixgen.py @@ -109,24 +109,28 @@ def test_qbx_direct(ctx_factory, factor, lpot_id): from sumpy.kernel import LaplaceKernel, DirectionalSourceDerivative if lpot_id == 1: - knl = LaplaceKernel(ndim) + base_knl = LaplaceKernel(ndim) + knl = base_knl elif lpot_id == 2: - knl = LaplaceKernel(ndim) - knl = DirectionalSourceDerivative(knl, dir_vec_name="dsource_vec") + base_knl = LaplaceKernel(ndim) + knl = DirectionalSourceDerivative(base_knl, dir_vec_name="dsource_vec") else: raise ValueError("unknow lpot_id") from sumpy.expansion.local import LineTaylorLocalExpansion - lknl = LineTaylorLocalExpansion(knl, order) + expn = LineTaylorLocalExpansion(knl, order) from sumpy.qbx import LayerPotential - lpot = LayerPotential(ctx, [lknl]) + lpot = LayerPotential(ctx, expansion=expn, source_kernels=(knl,), + target_kernels=(base_knl,)) from sumpy.qbx import LayerPotentialMatrixGenerator - mat_gen = LayerPotentialMatrixGenerator(ctx, [lknl]) + mat_gen = LayerPotentialMatrixGenerator(ctx, expansion=expn, + source_kernels=(knl,), target_kernels=(base_knl,)) from sumpy.qbx import LayerPotentialMatrixBlockGenerator - blk_gen = LayerPotentialMatrixBlockGenerator(ctx, [lknl]) + blk_gen = LayerPotentialMatrixBlockGenerator(ctx, expansion=expn, + source_kernels=(knl,), target_kernels=(base_knl,)) for n in [200, 300, 400]: targets, sources, centers, expansion_radii, sigma = \