From 3eb56387e23e0bcc45ef8f43cae043a6b7b3c365 Mon Sep 17 00:00:00 2001 From: Menno Fraters Date: Fri, 24 Jan 2020 21:52:33 -0800 Subject: [PATCH] fix local_end_weight definition. --- source/particles/generators.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/particles/generators.cc b/source/particles/generators.cc index 60d1b36f41..d767559d3d 100644 --- a/source/particles/generators.cc +++ b/source/particles/generators.cc @@ -312,7 +312,8 @@ namespace Particles // Calcualate number of local particles const types::particle_index end_particle_id = llround(static_cast(n_particles_to_create) * - local_end_weight / global_weight_integral); + ((local_start_weight + local_weight_integral) / + global_weight_integral)); n_local_particles = end_particle_id - start_particle_id; if (random_cell_selection) -- 2.39.5