diff --git a/pytential/qbx/__init__.py b/pytential/qbx/__init__.py index e05a80635060b634348e6302e77502c43ca784a2..d5d52ca6daa575484ae621ded4668179c01f1266 100644 --- a/pytential/qbx/__init__.py +++ b/pytential/qbx/__init__.py @@ -491,8 +491,13 @@ class QBXLayerPotentialSource(LayerPotentialSourceBase): def exec_compute_potential_insn(self, queue, insn, bound_expr, evaluate): from pytools.obj_array import with_object_array_or_scalar - from functools import partial - oversample = partial(self.resampler, queue) + + def oversample_nonscalars(vec): + from numbers import Number + if isinstance(vec, Number): + return vec + else: + return self.resampler(queue, vec) if not self._refined_for_global_qbx: from warnings import warn @@ -502,7 +507,7 @@ class QBXLayerPotentialSource(LayerPotentialSourceBase): def evaluate_wrapper(expr): value = evaluate(expr) - return with_object_array_or_scalar(oversample, value) + return with_object_array_or_scalar(oversample_nonscalars, value) if self.fmm_level_to_order is False: func = self.exec_compute_potential_insn_direct diff --git a/pytential/symbolic/execution.py b/pytential/symbolic/execution.py index 213eb42827840ea4c4af770778953ee58bacfb99..96cac5c4f5074bfb74f8a7460855894210095c26 100644 --- a/pytential/symbolic/execution.py +++ b/pytential/symbolic/execution.py @@ -266,7 +266,7 @@ class BoundExpression: :arg domains: a list of discretization identifiers or *None* values indicating the domains on which each component of the solution vector lives. *None* values indicate that the component - is a scalar. If *None*, + is a scalar. If *domains* is *None*, :class:`pytential.symbolic.primitives.DEFAULT_TARGET`, is required to be a key in :attr:`places`. """