From b1023a2afab5ff4a6a41ac581ddec8a7c1fa375c Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 17 Dec 2019 15:39:16 -0600 Subject: [PATCH] Correction to the check location for partial intersections with tets at the end of a track. --- src/mesh.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index f421f23001..7f451c8f2c 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1711,7 +1711,8 @@ UnstructuredMesh::bins_crossed(const Particle* p, // tally remaining portion of track after last hit if // the last segment of the track is in the mesh if (hits.back().first < track_len) { - tet = get_tet(last_r + u * (track_len + hits.back().first) / 2.0); + auto pos = (last_r + u * hits.back().first) + u * ((track_len - hits.back().first) / 2.0); + tet = get_tet(pos); if (tet) { bins.push_back(get_bin_from_ent_handle(tet)); lengths.push_back((track_len - hits.back().first) / track_len);