Skip to content

Commit

Permalink
reset on_face
Browse files Browse the repository at this point in the history
  • Loading branch information
esseivaju committed Jan 14, 2025
1 parent 6646ad3 commit 86cd51c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/orange/univ/SimpleUnitTracker.hh
Original file line number Diff line number Diff line change
Expand Up @@ -551,22 +551,22 @@ SimpleUnitTracker::complex_intersect(LocalState const& state,
// cross the internal surface, effectively flipping
// internal senses
axpy(distance + bump_dist, state.dir, &pos);

// reset on_face since we'll be bumping the position
on_face = {};
// evaluate senses from the new position
auto calc_senses = detail::LazySenseCalculator(
this->make_surface_visitor(), vol, pos, on_face);
this->make_surface_visitor(), vol, std::move(pos), on_face);

if (!is_inside(calc_senses))
{
// Flipping this sense puts us outside the current volume: in
// other words, only after crossing all the internal surfaces along
// this direction do we hit a surface that actually puts us
// outside.
Intersection result;
result.surface
= {vol.get_surface(face), flip_sense(calc_senses(face))};
result.distance = distance;
CELER_ENSURE(result.distance > 0 && !std::isinf(result.distance));
return result;
CELER_ENSURE(distance > 0 && !std::isinf(distance));
return {{vol.get_surface(face), flip_sense(calc_senses(face))},
distance};
}
}

Expand Down

0 comments on commit 86cd51c

Please sign in to comment.