Skip to content

Commit

Permalink
DPS: Fix a bug whereby species with 0 particles would not be handled …
Browse files Browse the repository at this point in the history
…correctly
  • Loading branch information
lorenzo-rovigatti committed Mar 25, 2024
1 parent 9af1214 commit 2d33bcc
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,10 @@ void DetailedPatchySwapInteraction::allocate_particles(std::vector<BaseParticle*
int curr_species = 0;
for(int i = 0; i < N; i++) {
if(i == curr_limit) {
curr_species++;
curr_limit += _N_per_species[curr_species];
do {
curr_species++;
curr_limit += _N_per_species[curr_species];
} while(_N_per_species[curr_species] == 0);
}
PatchyParticle *new_particle;
if(_N_patches[curr_species] > 0 && _base_patches[curr_species].size() > 0) {
Expand Down

0 comments on commit 2d33bcc

Please sign in to comment.