Correction to the check location for partial intersections with tets at the end of a track.

This commit is contained in:
Patrick Shriwise 2019-12-17 15:39:16 -06:00
parent 44083412f0
commit b1023a2afa

View file

@ -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);