From 7e6186f0693904ee27534e2d790c6149226464da Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 22 Feb 2018 19:21:49 -0600 Subject: [PATCH 1/2] Minor doc fix --- pytential/symbolic/execution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytential/symbolic/execution.py b/pytential/symbolic/execution.py index 3e96b00c..6b1707c3 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`. """ -- GitLab From 43c723bf1613facdffeb9f8105df34984e5fb102 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 22 Feb 2018 19:22:17 -0600 Subject: [PATCH 2/2] Do not attempt to oversample scalars in QBX --- pytential/qbx/__init__.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pytential/qbx/__init__.py b/pytential/qbx/__init__.py index e05a8063..d5d52ca6 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 -- GitLab