From 3a3ef4065697b5dfdba4fd774f161af83cd7d6a8 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Tue, 27 Aug 2019 22:47:35 -0500 Subject: [PATCH] TS: Fix variable initialization The flag variables for which expansions to evaluate were not always being initialized. This changes the code to always initialize the flags. --- pytential/qbx/target_specific/impl.pyx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pytential/qbx/target_specific/impl.pyx b/pytential/qbx/target_specific/impl.pyx index 37884f3f..60e9bbad 100644 --- a/pytential/qbx/target_specific/impl.pyx +++ b/pytential/qbx/target_specific/impl.pyx @@ -638,9 +638,10 @@ def eval_target_specific_qbx_locals( if ifdipole and ifgrad: raise ValueError("Does not support computing gradient of dipole sources") - if helmholtz_k == 0: - helmholtz_s = helmholtz_sp = helmholtz_d = 0 + laplace_s = laplace_sp = laplace_d = 0 + helmholtz_s = helmholtz_sp = helmholtz_d = 0 + if helmholtz_k == 0: if ifpot: laplace_s = ifcharge laplace_d = ifdipole @@ -649,8 +650,6 @@ def eval_target_specific_qbx_locals( laplace_sp = ifcharge else: - laplace_s = laplace_sp = laplace_d = 0 - if ifpot: helmholtz_s = ifcharge helmholtz_d = ifdipole -- GitLab