diff --git a/pytential/qbx/__init__.py b/pytential/qbx/__init__.py index c3ca7d95fc58877182743fb6760b1de04b65d94a..82ef3e190a96942c22ec1baa2ecf31ee319a7bcc 100644 --- a/pytential/qbx/__init__.py +++ b/pytential/qbx/__init__.py @@ -409,12 +409,9 @@ class QBXLayerPotentialSource(LayerPotentialSourceBase): @memoize_method def _expansion_radii(self, last_dim_length): if last_dim_length == "npanels": - # FIXME: Make this an error - - from warnings import warn - warn("Passing 'npanels' as last_dim_length to _expansion_radii is " - "deprecated. Expansion radii should be allowed to vary " - "within a panel.", stacklevel=3) + raise ValueError( + "Passing 'npanels' as last_dim_length to _expansion_radii is " + "not allowed. Allowed values are 'nsources' and 'ncenters'.") with cl.CommandQueue(self.cl_context) as queue: return (self._panel_sizes(last_dim_length).with_queue(queue) * 0.5 diff --git a/test/test_global_qbx.py b/test/test_global_qbx.py index cc0f26f0ebbce0cee1ab5c423fb92f6ed94b9c66..c7609387b8bbdef3c5e74edcdd78e1bd9a2351a2 100644 --- a/test/test_global_qbx.py +++ b/test/test_global_qbx.py @@ -121,7 +121,7 @@ def run_source_refinement_test(ctx_getter, mesh, order, helmholtz_k=None): int_centers = np.array([axis.get(queue) for axis in int_centers]) ext_centers = get_centers_on_side(lpot_source, +1) ext_centers = np.array([axis.get(queue) for axis in ext_centers]) - expansion_radii = lpot_source._expansion_radii("npanels").get(queue) + expansion_radii = lpot_source._expansion_radii("nsources").get(queue) panel_sizes = lpot_source._panel_sizes("npanels").get(queue) fine_panel_sizes = lpot_source._fine_panel_sizes("npanels").get(queue) @@ -150,8 +150,8 @@ def run_source_refinement_test(ctx_getter, mesh, order, helmholtz_k=None): # A center cannot be closer to another panel than to its originating # panel. - rad = expansion_radii[centers_panel.element_nr] - assert dist >= rad * (1-expansion_disturbance_tolerance), \ + rad = expansion_radii[centers_panel.discr_slice] + assert (dist >= rad * (1-expansion_disturbance_tolerance)).all(), \ (dist, rad, centers_panel.element_nr, sources_panel.element_nr) def check_sufficient_quadrature_resolution(centers_panel, sources_panel):