Skip to content

Commit

Permalink
Fix geometry error in box corners
Browse files Browse the repository at this point in the history
Fix a geometry error where a particle could get stuck in the corner of a
box.
  • Loading branch information
rtownson committed Jan 21, 2019
1 parent 3f8ca80 commit 92516c3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions HEN_HOUSE/egs++/geometry/egs_box/egs_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ class EGS_BOX_EXPORT EGS_Box : public EGS_BaseGeometry {
}
if (t1 < t) {
EGS_Float y1 = xp.y + up.y*t1, z1 = xp.z + up.z*t1;
if (2*y1 + ay >= 0 && 2*y1 - ay <= 0 &&
2*z1 + az >= 0 && 2*z1 - az <= 0) {
if (2*y1 + ay > 0 && 2*y1 - ay < 0 &&
2*z1 + az > 0 && 2*z1 - az < 0) {
t = t1;
if (newmed) {
*newmed = med;
Expand Down Expand Up @@ -273,8 +273,8 @@ class EGS_BOX_EXPORT EGS_Box : public EGS_BaseGeometry {
}
if (t1 < t) {
EGS_Float x1 = xp.x + up.x*t1, z1 = xp.z + up.z*t1;
if (2*x1 + ax >= 0 && 2*x1 - ax <= 0 &&
2*z1 + az >= 0 && 2*z1 - az <= 0) {
if (2*x1 + ax > 0 && 2*x1 - ax < 0 &&
2*z1 + az > 0 && 2*z1 - az < 0) {
t = t1;
if (newmed) {
*newmed = med;
Expand Down Expand Up @@ -310,8 +310,8 @@ class EGS_BOX_EXPORT EGS_Box : public EGS_BaseGeometry {
}
if (t1 < t) {
EGS_Float x1 = xp.x + up.x*t1, y1 = xp.y + up.y*t1;
if (2*x1 + ax >= 0 && 2*x1 - ax <= 0 &&
2*y1 + ay >= 0 && 2*y1 - ay <= 0) {
if (2*x1 + ax > 0 && 2*x1 - ax < 0 &&
2*y1 + ay > 0 && 2*y1 - ay < 0) {
t = t1;
if (newmed) {
*newmed = med;
Expand Down

0 comments on commit 92516c3

Please sign in to comment.