From 41c462a0b17364fdd0b6c7feb6f7d43b32542011 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 7 Dec 2020 10:10:14 -0600 Subject: [PATCH] Using a Boolean type instead of the object pointer to dectect the surface type. --- src/particle.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/particle.cpp b/src/particle.cpp index 5c6d0d466a..817f7f60ba 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -389,8 +389,8 @@ Particle::cross_surface() // ========================================================================== // SEARCH NEIGHBOR LISTS FOR NEXT CELL - #ifdef DAGMC + // in DAGMC, we know what the next cell should be auto surfp = dynamic_cast(model::surfaces[std::abs(surface_) - 1].get()); if (surfp) { auto cellp = dynamic_cast(model::cells[cell_last_[n_coord_ - 1]].get()); @@ -512,13 +512,11 @@ Particle::cross_reflective_bc(const Surface& surf, Direction new_u) // boundary, it is necessary to redetermine the particle's coordinates in // the lower universes. // (unless we're using a dagmc model, which has exactly one universe) - if (!settings::dagmc) { - n_coord() = 1; - if (!neighbor_list_find_cell(*this)) { - mark_as_lost("Couldn't find particle after reflecting from surface " + - std::to_string(surf.id_) + "."); - return; - } + n_coord() = 1; + if (surf->geom_type_ != GeometryType::DAGMC && !neighbor_list_find_cell(*this, true)) { + this->mark_as_lost("Couldn't find particle after reflecting from surface " + + std::to_string(surf.id_) + "."); + return; } // Set previous coordinate going slightly past surface crossing