Merge pull request #2075 from paulromano/infinite-loop-bugfix

Bug fix for rare infinite loop when finding cell after surface crossing
This commit is contained in:
Patrick Shriwise 2022-05-30 21:15:31 -05:00 committed by GitHub
commit ba0c193a31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -454,8 +454,7 @@ void Particle::cross_surface()
// ==========================================================================
// COULDN'T FIND PARTICLE IN NEIGHBORING CELLS, SEARCH ALL CELLS
// Remove lower coordinate levels and assignment of surface
surface() = 0;
// Remove lower coordinate levels
n_coord() = 1;
bool found = exhaustive_find_cell(*this);
@ -465,6 +464,7 @@ void Particle::cross_surface()
// the particle is really traveling tangent to a surface, if we move it
// forward a tiny bit it should fix the problem.
surface() = 0;
n_coord() = 1;
r() += TINY_BIT * u();