From 435680b57e5595ed32ae491254ffad7a7877ab0f Mon Sep 17 00:00:00 2001 From: euklid Date: Sat, 22 Aug 2015 16:40:02 +0200 Subject: [PATCH] important bug fix (never forget to initialize...) and further tweaks --- fmm2d.cpp | 8 ++++++++ kernel_laplace_point_2d.cpp | 2 +- main.cpp | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/fmm2d.cpp b/fmm2d.cpp index b35b1f8..2226eb8 100644 --- a/fmm2d.cpp +++ b/fmm2d.cpp @@ -67,6 +67,10 @@ void FMM2D::upward_pass() #endif // leaf node has to calculate its moments + if(cur_cell->get_source_elements().empty()) + { + continue; + } if (cur_cell->is_leaf()) { std::vector moments = m_kernel->calc_moments_cmp(cur_cell->get_source_elements(), @@ -128,6 +132,10 @@ void FMM2D::m2l_downward_pass(Cell* cur_cell) for(unsigned int i = 0; i shifted_moments(m_loc_terms,0); + if(interaction_list[i]->get_source_elements().empty()) + { + continue; + } m_kernel->M2L_cmp(interaction_list[i]->get_moments_cmp(), interaction_list[i]->get_center(), shifted_moments, diff --git a/kernel_laplace_point_2d.cpp b/kernel_laplace_point_2d.cpp index 37ad887..704ff2f 100644 --- a/kernel_laplace_point_2d.cpp +++ b/kernel_laplace_point_2d.cpp @@ -131,7 +131,7 @@ complex_t Laplace2DKernel::L2element_cmp(const std::vector &local_in, { complex_t dist = (complex_t)el.get_position() - local_center; unsigned int num_local_exp = local_in.size(); - complex_t fac; + complex_t fac(1,0); complex_t res = local_in[0]; for(int i = 1; iget_target_value() << std::endl; + std::cout << "diff: dir: " << direct_val[i] <<" fmm: " << tgt_elements[i]->get_target_value() << " diff: " << direct_val[i]-tgt_elements[i]->get_target_value() << std::endl; } #endif std::cout << "Hello World!" << std::endl;