From 6f2faca7dcaaa7ad6946a2da643ece80552b0c16 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Fri, 22 Nov 2019 00:56:03 -0800 Subject: [PATCH] Ignore size-1 axes when shifting --- meanas/fdfd/operators.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meanas/fdfd/operators.py b/meanas/fdfd/operators.py index 7052715..905c23e 100644 --- a/meanas/fdfd/operators.py +++ b/meanas/fdfd/operators.py @@ -531,6 +531,8 @@ def e_boundary_source(mask: vfield_t, shift = lambda axis, polarity: shift_with_mirror(axis=axis, shape=shape, shift_distance=polarity) for axis in (0, 1, 2): + if shape[axis] == 1: + continue for polarity in (-1, +1): r = shift(axis, polarity) - sparse.eye(numpy.prod(shape)) # shifted minus original r3 = sparse.block_diag((r, r, r))