From 671f305b3e937718d067aea180aa27f5c05f5a5e Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 1 Apr 2012 14:55:25 -0400 Subject: [PATCH] Added mesh_intersects check in score_surface_current. Closes #58 on github. --- src/tally.F90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tally.F90 b/src/tally.F90 index 4ff68ff153..2169af5c14 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -1014,8 +1014,11 @@ contains call get_mesh_indices(m, xyz0, ijk0, start_in_mesh) call get_mesh_indices(m, xyz1, ijk1, end_in_mesh) - ! Check to make sure start or end is in mesh - if ((.not. start_in_mesh) .and. (.not. end_in_mesh)) cycle + ! Check to if start or end is in mesh -- if not, check if track still + ! intersects with mesh + if ((.not. start_in_mesh) .and. (.not. end_in_mesh)) then + if (.not. mesh_intersects(m, xyz0, xyz1)) cycle + end if ! Calculate number of surface crossings n_cross = sum(abs(ijk1 - ijk0))