From 6997dac750ab8043092f40d031691ba5b1d8c707 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Fri, 2 Dec 2016 15:33:53 -0600 Subject: [PATCH 1/2] FMM: Fix NameError when coarsening multipoles on single level tree. --- sumpy/fmm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sumpy/fmm.py b/sumpy/fmm.py index 4c9b8360..5827e909 100644 --- a/sumpy/fmm.py +++ b/sumpy/fmm.py @@ -326,6 +326,7 @@ class SumpyExpansionWrangler(object): mpoles): tree = self.tree + evt = None # 2 is the last relevant source_level. # 1 is the last relevant target_level. # (Nobody needs a multipole on level 0, i.e. for the root box.) @@ -362,7 +363,8 @@ class SumpyExpansionWrangler(object): assert mpoles_res is target_mpoles_view - mpoles.add_event(evt) + if evt is not None: + mpoles.add_event(evt) return mpoles @@ -404,6 +406,9 @@ class SumpyExpansionWrangler(object): order = self.level_orders[lev] m2l = self.code.m2l(order, order) + with open("/home/matt/sad.loopy", "w") as outf: + print(m2l.get_kernel().stringify(with_dependencies=False), file=outf) + source_level_start_ibox, source_mpoles_view = \ self.multipole_expansions_view(mpole_exps, lev) target_level_start_ibox, target_local_exps_view = \ -- GitLab From 250667c1b7674e02cb3853164a2fafd9b7b3914e Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Fri, 2 Dec 2016 15:39:00 -0600 Subject: [PATCH 2/2] Remove debugging code that was accidentally included. --- sumpy/fmm.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/sumpy/fmm.py b/sumpy/fmm.py index 5827e909..3d313f25 100644 --- a/sumpy/fmm.py +++ b/sumpy/fmm.py @@ -406,9 +406,6 @@ class SumpyExpansionWrangler(object): order = self.level_orders[lev] m2l = self.code.m2l(order, order) - with open("/home/matt/sad.loopy", "w") as outf: - print(m2l.get_kernel().stringify(with_dependencies=False), file=outf) - source_level_start_ibox, source_mpoles_view = \ self.multipole_expansions_view(mpole_exps, lev) target_level_start_ibox, target_local_exps_view = \ -- GitLab