Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix out of bounds access to distance_to_eb #4831

Merged
merged 7 commits into from
Apr 10, 2024
Next Next commit
Fix out of bounds access to distance_to_eb
  • Loading branch information
roelof-groenewald committed Apr 5, 2024
commit a4956b407b442c02ea3b50f7ac199072fbc264bf
6 changes: 5 additions & 1 deletion Source/Particles/WarpXParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,17 @@ WarpXParticleContainer::AddNParticles (int /*lev*/, long n,
);
}

// Move particles to their appropriate tiles
Redistribute();

// Remove particles that are inside the embedded boundaries
#ifdef AMREX_USE_EB
auto & distance_to_eb = WarpX::GetInstance().GetDistanceToEB();
scrapeParticles( *this, amrex::GetVecOfConstPtrs(distance_to_eb), ParticleBoundaryProcess::Absorb());
#endif

Redistribute();
// Call (local) redistribute again to remove particles with invalid ids
Redistribute(0, -1, 0, 1, 1);
}

/* \brief Current Deposition for thread thread_num
Expand Down
Loading