diff --git a/boxtree/traversal.py b/boxtree/traversal.py index 6960e45c79cb9343ddc5711ad82ec16c164eddeb..90510674825b62981aa1c3d21f7d7493ab51b99d 100644 --- a/boxtree/traversal.py +++ b/boxtree/traversal.py @@ -794,8 +794,8 @@ void generate(LIST_ARG_DECL USER_ARG_DECL box_id_t target_box_number) coord_t l_2_box_dist = sqrt(l_2_squared_center_dist) - sqrt((coord_t) (${dimensions})) - * tgt_stickout_l_inf_rad - - source_l_inf_rad; + * (tgt_stickout_l_inf_rad + + source_l_inf_rad); meets_sep_crit = l_2_box_dist >= (2 - 8 * COORD_T_MACH_EPS) * source_l_inf_rad; @@ -921,6 +921,24 @@ inline bool meets_sep_bigger_criterion( coord_vec_t source_center, int source_level, coord_t stick_out_factor) { + <% + assert not sources_have_extent + %> + + // What we are interested in ensuring is that + + // (*) + // d_2(src_box, tgt_center) + // >= 3 * (radius of tgt box potentially + // including stick-out) + + // (because convergence factors are in l^2, + // irrespective of how we measure) + + // Since d_2(a, b) >= d_inf(a, b), ensuring that + // (*) holds with d_inf implies that it also holds + // with d_2. + coord_t target_rad = LEVEL_TO_RAD(target_level); coord_t source_rad = LEVEL_TO_RAD(source_level); coord_t max_allowed_center_l_inf_dist = (