]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix numbering in ParticleHandler::insert_particles()
authorDaniel Arndt <arndtd@ornl.gov>
Sat, 30 Nov 2019 15:55:16 +0000 (10:55 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Sun, 1 Dec 2019 15:36:08 +0000 (10:36 -0500)
doc/news/changes/minor/20191130DanielArndt [new file with mode: 0644]
source/particles/particle_handler.cc
tests/particles/particle_handler_07.with_p4est=true.mpirun=1.output
tests/particles/particle_handler_serial_07.output

diff --git a/doc/news/changes/minor/20191130DanielArndt b/doc/news/changes/minor/20191130DanielArndt
new file mode 100644 (file)
index 0000000..93b2628
--- /dev/null
@@ -0,0 +1,6 @@
+Fixed: ParticleHandler::insert_particles() taking a std::vector of Point objects
+starts numbering the particles with 0 instead of 1 to be consistent with the
+other ParticleHandler::insert_particles() function and the 
+ParticleHandler::insert_particle() function.
+<br>
+(Daniel Arndt, 2019/11/30)
index f64f192fcb33ef9eb7c337ab1971a15eadf9840b..2d8949147285d02be5d6784731963453f88923e0 100644 (file)
@@ -193,17 +193,21 @@ namespace Particles
         global_number_of_particles = dealii::Utilities::MPI::sum(
           particles.size(), parallel_triangulation->get_communicator());
         next_free_particle_index =
-          dealii::Utilities::MPI::max(
-            locally_highest_index, parallel_triangulation->get_communicator()) +
-          1;
+          global_number_of_particles == 0 ?
+            0 :
+            dealii::Utilities::MPI::max(
+              locally_highest_index,
+              parallel_triangulation->get_communicator()) +
+              1;
         global_max_particles_per_cell = dealii::Utilities::MPI::max(
           local_max_particles_per_cell,
           parallel_triangulation->get_communicator());
       }
     else
       {
-        global_number_of_particles    = particles.size();
-        next_free_particle_index      = locally_highest_index + 1;
+        global_number_of_particles = particles.size();
+        next_free_particle_index =
+          global_number_of_particles == 0 ? 0 : locally_highest_index + 1;
         global_max_particles_per_cell = local_max_particles_per_cell;
       }
   }
index 066bf60dcc54478272584f37c8ac6d6d2a6820e4..f60b28e24c776c222f9c352aba612204a33d5f35 100644 (file)
@@ -1,97 +1,97 @@
 
 DEAL:2d/2d::Particle number: 10
-DEAL:2d/2d::Particle id 3 is in cell 2.0
+DEAL:2d/2d::Particle id 2 is in cell 2.0
 DEAL:2d/2d::     at location 0.250000 0.250000
 DEAL:2d/2d::     at reference location 1.00000 1.00000
-DEAL:2d/2d::Particle id 2 is in cell 2.0
+DEAL:2d/2d::Particle id 1 is in cell 2.0
 DEAL:2d/2d::     at location 0.150000 0.150000
 DEAL:2d/2d::     at reference location 0.600000 0.600000
-DEAL:2d/2d::Particle id 1 is in cell 2.0
+DEAL:2d/2d::Particle id 0 is in cell 2.0
 DEAL:2d/2d::     at location 0.0500000 0.0500000
 DEAL:2d/2d::     at reference location 0.200000 0.200000
-DEAL:2d/2d::Particle id 5 is in cell 2.3
+DEAL:2d/2d::Particle id 4 is in cell 2.3
 DEAL:2d/2d::     at location 0.450000 0.450000
 DEAL:2d/2d::     at reference location 0.800000 0.800000
-DEAL:2d/2d::Particle id 4 is in cell 2.3
+DEAL:2d/2d::Particle id 3 is in cell 2.3
 DEAL:2d/2d::     at location 0.350000 0.350000
 DEAL:2d/2d::     at reference location 0.400000 0.400000
-DEAL:2d/2d::Particle id 8 is in cell 2.12
+DEAL:2d/2d::Particle id 7 is in cell 2.12
 DEAL:2d/2d::     at location 0.750000 0.750000
 DEAL:2d/2d::     at reference location 1.00000 1.00000
-DEAL:2d/2d::Particle id 7 is in cell 2.12
+DEAL:2d/2d::Particle id 6 is in cell 2.12
 DEAL:2d/2d::     at location 0.650000 0.650000
 DEAL:2d/2d::     at reference location 0.600000 0.600000
-DEAL:2d/2d::Particle id 6 is in cell 2.12
+DEAL:2d/2d::Particle id 5 is in cell 2.12
 DEAL:2d/2d::     at location 0.550000 0.550000
 DEAL:2d/2d::     at reference location 0.200000 0.200000
-DEAL:2d/2d::Particle id 10 is in cell 2.15
+DEAL:2d/2d::Particle id 9 is in cell 2.15
 DEAL:2d/2d::     at location 0.950000 0.950000
 DEAL:2d/2d::     at reference location 0.800000 0.800000
-DEAL:2d/2d::Particle id 9 is in cell 2.15
+DEAL:2d/2d::Particle id 8 is in cell 2.15
 DEAL:2d/2d::     at location 0.850000 0.850000
 DEAL:2d/2d::     at reference location 0.400000 0.400000
 DEAL:2d/2d::OK
 DEAL:2d/3d::Particle number: 10
-DEAL:2d/3d::Particle id 3 is in cell 2.0
+DEAL:2d/3d::Particle id 2 is in cell 2.0
 DEAL:2d/3d::     at location 0.250000 0.250000 0.250000
 DEAL:2d/3d::     at reference location 1.00000 1.00000
-DEAL:2d/3d::Particle id 2 is in cell 2.0
+DEAL:2d/3d::Particle id 1 is in cell 2.0
 DEAL:2d/3d::     at location 0.150000 0.150000 0.150000
 DEAL:2d/3d::     at reference location 0.600000 0.600000
-DEAL:2d/3d::Particle id 1 is in cell 2.0
+DEAL:2d/3d::Particle id 0 is in cell 2.0
 DEAL:2d/3d::     at location 0.0500000 0.0500000 0.0500000
 DEAL:2d/3d::     at reference location 0.200000 0.200000
-DEAL:2d/3d::Particle id 5 is in cell 2.3
+DEAL:2d/3d::Particle id 4 is in cell 2.3
 DEAL:2d/3d::     at location 0.450000 0.450000 0.450000
 DEAL:2d/3d::     at reference location 0.800000 0.800000
-DEAL:2d/3d::Particle id 4 is in cell 2.3
+DEAL:2d/3d::Particle id 3 is in cell 2.3
 DEAL:2d/3d::     at location 0.350000 0.350000 0.350000
 DEAL:2d/3d::     at reference location 0.400000 0.400000
-DEAL:2d/3d::Particle id 8 is in cell 2.12
+DEAL:2d/3d::Particle id 7 is in cell 2.12
 DEAL:2d/3d::     at location 0.750000 0.750000 0.750000
 DEAL:2d/3d::     at reference location 1.00000 1.00000
-DEAL:2d/3d::Particle id 7 is in cell 2.12
+DEAL:2d/3d::Particle id 6 is in cell 2.12
 DEAL:2d/3d::     at location 0.650000 0.650000 0.650000
 DEAL:2d/3d::     at reference location 0.600000 0.600000
-DEAL:2d/3d::Particle id 6 is in cell 2.12
+DEAL:2d/3d::Particle id 5 is in cell 2.12
 DEAL:2d/3d::     at location 0.550000 0.550000 0.550000
 DEAL:2d/3d::     at reference location 0.200000 0.200000
-DEAL:2d/3d::Particle id 10 is in cell 2.15
+DEAL:2d/3d::Particle id 9 is in cell 2.15
 DEAL:2d/3d::     at location 0.950000 0.950000 0.950000
 DEAL:2d/3d::     at reference location 0.800000 0.800000
-DEAL:2d/3d::Particle id 9 is in cell 2.15
+DEAL:2d/3d::Particle id 8 is in cell 2.15
 DEAL:2d/3d::     at location 0.850000 0.850000 0.850000
 DEAL:2d/3d::     at reference location 0.400000 0.400000
 DEAL:2d/3d::OK
 DEAL:3d/3d::Particle number: 10
-DEAL:3d/3d::Particle id 3 is in cell 2.0
+DEAL:3d/3d::Particle id 2 is in cell 2.0
 DEAL:3d/3d::     at location 0.250000 0.250000 0.250000
 DEAL:3d/3d::     at reference location 1.00000 1.00000 1.00000
-DEAL:3d/3d::Particle id 2 is in cell 2.0
+DEAL:3d/3d::Particle id 1 is in cell 2.0
 DEAL:3d/3d::     at location 0.150000 0.150000 0.150000
 DEAL:3d/3d::     at reference location 0.600000 0.600000 0.600000
-DEAL:3d/3d::Particle id 1 is in cell 2.0
+DEAL:3d/3d::Particle id 0 is in cell 2.0
 DEAL:3d/3d::     at location 0.0500000 0.0500000 0.0500000
 DEAL:3d/3d::     at reference location 0.200000 0.200000 0.200000
-DEAL:3d/3d::Particle id 5 is in cell 2.7
+DEAL:3d/3d::Particle id 4 is in cell 2.7
 DEAL:3d/3d::     at location 0.450000 0.450000 0.450000
 DEAL:3d/3d::     at reference location 0.800000 0.800000 0.800000
-DEAL:3d/3d::Particle id 4 is in cell 2.7
+DEAL:3d/3d::Particle id 3 is in cell 2.7
 DEAL:3d/3d::     at location 0.350000 0.350000 0.350000
 DEAL:3d/3d::     at reference location 0.400000 0.400000 0.400000
-DEAL:3d/3d::Particle id 8 is in cell 2.56
+DEAL:3d/3d::Particle id 7 is in cell 2.56
 DEAL:3d/3d::     at location 0.750000 0.750000 0.750000
 DEAL:3d/3d::     at reference location 1.00000 1.00000 1.00000
-DEAL:3d/3d::Particle id 7 is in cell 2.56
+DEAL:3d/3d::Particle id 6 is in cell 2.56
 DEAL:3d/3d::     at location 0.650000 0.650000 0.650000
 DEAL:3d/3d::     at reference location 0.600000 0.600000 0.600000
-DEAL:3d/3d::Particle id 6 is in cell 2.56
+DEAL:3d/3d::Particle id 5 is in cell 2.56
 DEAL:3d/3d::     at location 0.550000 0.550000 0.550000
 DEAL:3d/3d::     at reference location 0.200000 0.200000 0.200000
-DEAL:3d/3d::Particle id 10 is in cell 2.63
+DEAL:3d/3d::Particle id 9 is in cell 2.63
 DEAL:3d/3d::     at location 0.950000 0.950000 0.950000
 DEAL:3d/3d::     at reference location 0.800000 0.800000 0.800000
-DEAL:3d/3d::Particle id 9 is in cell 2.63
+DEAL:3d/3d::Particle id 8 is in cell 2.63
 DEAL:3d/3d::     at location 0.850000 0.850000 0.850000
 DEAL:3d/3d::     at reference location 0.400000 0.400000 0.400000
 DEAL:3d/3d::OK
index 066bf60dcc54478272584f37c8ac6d6d2a6820e4..f60b28e24c776c222f9c352aba612204a33d5f35 100644 (file)
@@ -1,97 +1,97 @@
 
 DEAL:2d/2d::Particle number: 10
-DEAL:2d/2d::Particle id 3 is in cell 2.0
+DEAL:2d/2d::Particle id 2 is in cell 2.0
 DEAL:2d/2d::     at location 0.250000 0.250000
 DEAL:2d/2d::     at reference location 1.00000 1.00000
-DEAL:2d/2d::Particle id 2 is in cell 2.0
+DEAL:2d/2d::Particle id 1 is in cell 2.0
 DEAL:2d/2d::     at location 0.150000 0.150000
 DEAL:2d/2d::     at reference location 0.600000 0.600000
-DEAL:2d/2d::Particle id 1 is in cell 2.0
+DEAL:2d/2d::Particle id 0 is in cell 2.0
 DEAL:2d/2d::     at location 0.0500000 0.0500000
 DEAL:2d/2d::     at reference location 0.200000 0.200000
-DEAL:2d/2d::Particle id 5 is in cell 2.3
+DEAL:2d/2d::Particle id 4 is in cell 2.3
 DEAL:2d/2d::     at location 0.450000 0.450000
 DEAL:2d/2d::     at reference location 0.800000 0.800000
-DEAL:2d/2d::Particle id 4 is in cell 2.3
+DEAL:2d/2d::Particle id 3 is in cell 2.3
 DEAL:2d/2d::     at location 0.350000 0.350000
 DEAL:2d/2d::     at reference location 0.400000 0.400000
-DEAL:2d/2d::Particle id 8 is in cell 2.12
+DEAL:2d/2d::Particle id 7 is in cell 2.12
 DEAL:2d/2d::     at location 0.750000 0.750000
 DEAL:2d/2d::     at reference location 1.00000 1.00000
-DEAL:2d/2d::Particle id 7 is in cell 2.12
+DEAL:2d/2d::Particle id 6 is in cell 2.12
 DEAL:2d/2d::     at location 0.650000 0.650000
 DEAL:2d/2d::     at reference location 0.600000 0.600000
-DEAL:2d/2d::Particle id 6 is in cell 2.12
+DEAL:2d/2d::Particle id 5 is in cell 2.12
 DEAL:2d/2d::     at location 0.550000 0.550000
 DEAL:2d/2d::     at reference location 0.200000 0.200000
-DEAL:2d/2d::Particle id 10 is in cell 2.15
+DEAL:2d/2d::Particle id 9 is in cell 2.15
 DEAL:2d/2d::     at location 0.950000 0.950000
 DEAL:2d/2d::     at reference location 0.800000 0.800000
-DEAL:2d/2d::Particle id 9 is in cell 2.15
+DEAL:2d/2d::Particle id 8 is in cell 2.15
 DEAL:2d/2d::     at location 0.850000 0.850000
 DEAL:2d/2d::     at reference location 0.400000 0.400000
 DEAL:2d/2d::OK
 DEAL:2d/3d::Particle number: 10
-DEAL:2d/3d::Particle id 3 is in cell 2.0
+DEAL:2d/3d::Particle id 2 is in cell 2.0
 DEAL:2d/3d::     at location 0.250000 0.250000 0.250000
 DEAL:2d/3d::     at reference location 1.00000 1.00000
-DEAL:2d/3d::Particle id 2 is in cell 2.0
+DEAL:2d/3d::Particle id 1 is in cell 2.0
 DEAL:2d/3d::     at location 0.150000 0.150000 0.150000
 DEAL:2d/3d::     at reference location 0.600000 0.600000
-DEAL:2d/3d::Particle id 1 is in cell 2.0
+DEAL:2d/3d::Particle id 0 is in cell 2.0
 DEAL:2d/3d::     at location 0.0500000 0.0500000 0.0500000
 DEAL:2d/3d::     at reference location 0.200000 0.200000
-DEAL:2d/3d::Particle id 5 is in cell 2.3
+DEAL:2d/3d::Particle id 4 is in cell 2.3
 DEAL:2d/3d::     at location 0.450000 0.450000 0.450000
 DEAL:2d/3d::     at reference location 0.800000 0.800000
-DEAL:2d/3d::Particle id 4 is in cell 2.3
+DEAL:2d/3d::Particle id 3 is in cell 2.3
 DEAL:2d/3d::     at location 0.350000 0.350000 0.350000
 DEAL:2d/3d::     at reference location 0.400000 0.400000
-DEAL:2d/3d::Particle id 8 is in cell 2.12
+DEAL:2d/3d::Particle id 7 is in cell 2.12
 DEAL:2d/3d::     at location 0.750000 0.750000 0.750000
 DEAL:2d/3d::     at reference location 1.00000 1.00000
-DEAL:2d/3d::Particle id 7 is in cell 2.12
+DEAL:2d/3d::Particle id 6 is in cell 2.12
 DEAL:2d/3d::     at location 0.650000 0.650000 0.650000
 DEAL:2d/3d::     at reference location 0.600000 0.600000
-DEAL:2d/3d::Particle id 6 is in cell 2.12
+DEAL:2d/3d::Particle id 5 is in cell 2.12
 DEAL:2d/3d::     at location 0.550000 0.550000 0.550000
 DEAL:2d/3d::     at reference location 0.200000 0.200000
-DEAL:2d/3d::Particle id 10 is in cell 2.15
+DEAL:2d/3d::Particle id 9 is in cell 2.15
 DEAL:2d/3d::     at location 0.950000 0.950000 0.950000
 DEAL:2d/3d::     at reference location 0.800000 0.800000
-DEAL:2d/3d::Particle id 9 is in cell 2.15
+DEAL:2d/3d::Particle id 8 is in cell 2.15
 DEAL:2d/3d::     at location 0.850000 0.850000 0.850000
 DEAL:2d/3d::     at reference location 0.400000 0.400000
 DEAL:2d/3d::OK
 DEAL:3d/3d::Particle number: 10
-DEAL:3d/3d::Particle id 3 is in cell 2.0
+DEAL:3d/3d::Particle id 2 is in cell 2.0
 DEAL:3d/3d::     at location 0.250000 0.250000 0.250000
 DEAL:3d/3d::     at reference location 1.00000 1.00000 1.00000
-DEAL:3d/3d::Particle id 2 is in cell 2.0
+DEAL:3d/3d::Particle id 1 is in cell 2.0
 DEAL:3d/3d::     at location 0.150000 0.150000 0.150000
 DEAL:3d/3d::     at reference location 0.600000 0.600000 0.600000
-DEAL:3d/3d::Particle id 1 is in cell 2.0
+DEAL:3d/3d::Particle id 0 is in cell 2.0
 DEAL:3d/3d::     at location 0.0500000 0.0500000 0.0500000
 DEAL:3d/3d::     at reference location 0.200000 0.200000 0.200000
-DEAL:3d/3d::Particle id 5 is in cell 2.7
+DEAL:3d/3d::Particle id 4 is in cell 2.7
 DEAL:3d/3d::     at location 0.450000 0.450000 0.450000
 DEAL:3d/3d::     at reference location 0.800000 0.800000 0.800000
-DEAL:3d/3d::Particle id 4 is in cell 2.7
+DEAL:3d/3d::Particle id 3 is in cell 2.7
 DEAL:3d/3d::     at location 0.350000 0.350000 0.350000
 DEAL:3d/3d::     at reference location 0.400000 0.400000 0.400000
-DEAL:3d/3d::Particle id 8 is in cell 2.56
+DEAL:3d/3d::Particle id 7 is in cell 2.56
 DEAL:3d/3d::     at location 0.750000 0.750000 0.750000
 DEAL:3d/3d::     at reference location 1.00000 1.00000 1.00000
-DEAL:3d/3d::Particle id 7 is in cell 2.56
+DEAL:3d/3d::Particle id 6 is in cell 2.56
 DEAL:3d/3d::     at location 0.650000 0.650000 0.650000
 DEAL:3d/3d::     at reference location 0.600000 0.600000 0.600000
-DEAL:3d/3d::Particle id 6 is in cell 2.56
+DEAL:3d/3d::Particle id 5 is in cell 2.56
 DEAL:3d/3d::     at location 0.550000 0.550000 0.550000
 DEAL:3d/3d::     at reference location 0.200000 0.200000 0.200000
-DEAL:3d/3d::Particle id 10 is in cell 2.63
+DEAL:3d/3d::Particle id 9 is in cell 2.63
 DEAL:3d/3d::     at location 0.950000 0.950000 0.950000
 DEAL:3d/3d::     at reference location 0.800000 0.800000 0.800000
-DEAL:3d/3d::Particle id 9 is in cell 2.63
+DEAL:3d/3d::Particle id 8 is in cell 2.63
 DEAL:3d/3d::     at location 0.850000 0.850000 0.850000
 DEAL:3d/3d::     at reference location 0.400000 0.400000 0.400000
 DEAL:3d/3d::OK

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.