diff --git a/sumpy/expansion/local.py b/sumpy/expansion/local.py index 235af1958b5691e0eccf9e6dce2ce39044074969..e6e16d2ae83162ec9f0266afd053e4dede73920e 100644 --- a/sumpy/expansion/local.py +++ b/sumpy/expansion/local.py @@ -98,12 +98,6 @@ class LineTaylorLocalExpansion(LocalExpansionBase): for i in self.get_coefficient_identifiers()] def evaluate(self, tgt_kernel, coeffs, bvec, rscale, sac=None): - from sumpy.kernel import TargetDerivativeRemover - tdr = TargetDerivativeRemover() - if tgt_kernel != tdr(tgt_kernel): - raise ValueError("Line Taylor expansion cannot support " - "target derivatives") - # no point in heeding rscale here--just ignore it from pytools import factorial return sym.Add(*( diff --git a/sumpy/qbx.py b/sumpy/qbx.py index 49928f2e062dbcd38796e25d542f5c0e01eb68a8..f530cd2b9f484efc2e9b0f434e7b41c0cd95aa6c 100644 --- a/sumpy/qbx.py +++ b/sumpy/qbx.py @@ -98,7 +98,16 @@ class LayerPotentialBase(KernelComputation, KernelCacheWrapper): return coefficients def _evaluate(self, sac, avec, bvec, rscale, expansion_nr, coefficients): + from sumpy.expansion.local import LineTaylorLocalExpansion tgt_knl = self.target_kernels[expansion_nr] + if isinstance(tgt_knl, LineTaylorLocalExpansion): + # In LineTaylorLocalExpansion.evaluate, we can't run + # postprocess_at_target because the coefficients are assigned + # symbols and postprocess with a derivative will make them zero. + # Instead run postprocess here before the coeffients are assigned. + coefficients = [tgt_knl.postprocess_at_target(coeff, bvec) for + coeff in coefficients] + assigned_coeffs = [ sym.Symbol( sac.assign_unique("expn%dcoeff%s" % ( diff --git a/test/test_qbx.py b/test/test_qbx.py index 0e2e76c2fe1a18b0d11dcee3ce332c9685e21dc0..379ef0e221327f13d5452c34e8f1601de9fad421 100644 --- a/test/test_qbx.py +++ b/test/test_qbx.py @@ -151,13 +151,6 @@ def test_direct_qbx_vs_eigval_with_tgt_deriv(ctx_factory, expn_class): strengths = (sigma * h,) - if expn_class is LineTaylorLocalExpansion: - with pytest.raises(ValueError): - evt, (result_qbx_dx,) = lpot_dx(queue, targets, sources, centers, - strengths, expansion_radii=expansion_radii) - - continue - evt, (result_qbx_dx,) = lpot_dx(queue, targets, sources, centers, strengths, expansion_radii=expansion_radii) evt, (result_qbx_dy,) = lpot_dy(queue, targets, sources, centers, strengths,