--- /dev/null
+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)
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;
}
}
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
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