Skip to content

Commit

Permalink
Fix conestack infinite loop
Browse files Browse the repository at this point in the history
Fix an infinite loop that could occur in long simulations with a
conestack with more than one layer. Previously, particles could get
stuck on the surface between layers of the conestack.
  • Loading branch information
rtownson authored and ftessier committed Sep 20, 2018
1 parent b4b6bc9 commit f45ff00
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions HEN_HOUSE/egs++/geometry/egs_cones/egs_cones.h
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,12 @@ class EGS_ConeStack : public EGS_BaseGeometry {
t = tp; // set t = distance to plane
}

// If we are right on a plane, return -1
if(tp < boundaryTolerance) {
t = 0;
return -1;
}

// distance to outer cone
int ir = ireg - il*nmax; // cone index in current layer
bool hitc = false; // assume we don't hit the cone
Expand Down

0 comments on commit f45ff00

Please sign in to comment.