Skip to content

Commit

Permalink
Clear the boundary particle indices' container before updating it. (#…
Browse files Browse the repository at this point in the history
…2907)

This avoids potential segmentation faults when one grid's particles all
move to other grids.
  • Loading branch information
hengjiew authored Aug 8, 2022
1 parent 103db6e commit 59b0742
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Src/Particle/AMReX_NeighborParticlesI.H
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,11 @@ selectActualNeighbors (CheckPair&& check_pair, int num_cells)

for (int lev = 0; lev < this->numLevels(); ++lev)
{
// clear previous neighbor particle ids
for (auto& keyval: m_boundary_particle_ids[lev]) {
keyval.second.clear();
}

for (MyParIter pti(*this, lev); pti.isValid(); ++pti) {
PairIndex index(pti.index(), pti.LocalTileIndex());

Expand Down

0 comments on commit 59b0742

Please sign in to comment.