Updating history reset to account for reflective boundaries. Adding mark as lost warning when no intersection is found.

This commit is contained in:
Patrick Shriwise 2020-12-06 11:36:23 -06:00
parent 0bd2f9263b
commit 9c2f9b523b

View file

@ -816,10 +816,8 @@ DAGCell::distance(Position r, Direction u, int32_t on_surface, Particle* p) cons
Expects(p);
// if we've changed direction or we're not on a surface,
// reset the history and update last direction
if (u != p->last_dir() || on_surface == 0) {
p->history().reset();
p->last_dir() = u;
}
if (u != p->last_dir()) { p->last_dir() = u; p->history().reset(); }
if (on_surface == 0) { p->history().reset(); }
const auto& univ = model::universes[p->coord_[p->n_coord_ - 1].universe];
@ -841,6 +839,7 @@ DAGCell::distance(Position r, Direction u, int32_t on_surface, Particle* p) cons
// indicate that particle is lost
surf_idx = -1;
dist = INFINITY;
p->mark_as_lost(fmt::format("No intersection found with DAGMC cell {}", id_));
}
return {dist, surf_idx};