Skip to content

Commit

Permalink
single species binary collisions only does a half shuffle. For slowly…
Browse files Browse the repository at this point in the history
… chaning particles in a cell, this essentially means that each particle is only sampling half the distribution function during scattering. This is now fixed to shuffle the entire list of particles.
  • Loading branch information
JustinRayAngus committed Jul 9, 2024
1 parent 402cc8e commit 81e5946
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Source/Particles/Collision/BinaryCollision/BinaryCollision.H
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ public:
// given by the `indices_1[cell_start_1:cell_stop_1]`
index_type const cell_start_1 = cell_offsets_1[i_cell];
index_type const cell_stop_1 = cell_offsets_1[i_cell+1];
index_type const cell_half_1 = (cell_start_1+cell_stop_1)/2;

// Do not collide if there is only one particle in the cell
if ( cell_stop_1 - cell_start_1 <= 1 ) { return; }
Expand All @@ -404,8 +403,7 @@ public:
}

// shuffle
ShuffleFisherYates(
indices_1, cell_start_1, cell_half_1, engine );
ShuffleFisherYates( indices_1, cell_start_1, cell_stop_1, engine );
}
);

Expand Down

0 comments on commit 81e5946

Please sign in to comment.