Removed decrease density, because already taken into account by initial particle simulation.

This commit is contained in:
Christian
2019-10-21 10:42:43 +02:00
parent 3ddf92fd75
commit 03cfdc606b
17 changed files with 13 additions and 52 deletions
-10
View File
@@ -200,9 +200,7 @@ void Simulation::sync_populations() { // Sync new densities for each species and
Population_Manager *populations = looper.get_populations();
Population_Container *container;
double *global_delta_cumulated_time_s;
double *global_delta_offset;
double *local_delta_cumulated_time_s;
double *local_delta_offset;
int array_length;
for (int i = 0; i<number_pop_species; i++) {
container = populations->find(pop_species[i])->access_container();
@@ -211,28 +209,20 @@ void Simulation::sync_populations() { // Sync new densities for each species and
continue;
}
global_delta_cumulated_time_s = new double[array_length];
global_delta_offset = new double[array_length];
local_delta_cumulated_time_s = new double[array_length];
local_delta_offset = new double[array_length];
for (int j = 0; j<array_length; j++) {
local_delta_cumulated_time_s[j] = container->cum_times_s[j] - global_cum_time_s[i][j];
local_delta_offset[j] = container->offsets[j] - global_offset[i][j];
}
MPI_Allreduce(local_delta_cumulated_time_s, global_delta_cumulated_time_s, array_length, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
MPI_Allreduce(local_delta_offset, global_delta_offset, array_length, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
for (int j = 0; j<pop_array_lengths[i]; j++) {
global_cum_time_s[i][j] += global_delta_cumulated_time_s[j];
global_offset[i][j] += global_delta_offset[j];
container->cum_times_s[j] = global_cum_time_s[i][j];
container->offsets[j] = global_offset[i][j];
}
delete[] global_delta_cumulated_time_s;
delete[] global_delta_offset;
delete[] local_delta_cumulated_time_s;
delete[] local_delta_offset;
}
}