]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix local_end_weight definition.
authorMenno Fraters <menno.fraters@outlook.com>
Sat, 25 Jan 2020 05:52:33 +0000 (21:52 -0800)
committerMenno Fraters <menno.fraters@outlook.com>
Sat, 25 Jan 2020 05:52:33 +0000 (21:52 -0800)
source/particles/generators.cc

index 60d1b36f4140352fe3b0688cf38968f7c7f9307a..d767559d3d23550b6e8a44ec252c37cc4c6e579d 100644 (file)
@@ -312,7 +312,8 @@ namespace Particles
         // Calcualate number of local particles
         const types::particle_index end_particle_id =
           llround(static_cast<double>(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)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.