Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gridley committed Sep 9, 2023
1 parent 8fd3010 commit 8a6da9b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/plot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1109,8 +1109,7 @@ void RayTracePlot::set_output_path(pugi::xml_node node)
// if an intersection was found.
int RayTracePlot::advance_to_boundary_from_void(Geometron& p)
{
constexpr double scoot = 1e-5;
double min_dist = {INFINITY};
double min_dist {INFINITY};
auto coord = p.coord(0);
Universe* uni = model::universes[model::root_universe].get();
int intersected_surface = -1;
Expand All @@ -1125,7 +1124,7 @@ int RayTracePlot::advance_to_boundary_from_void(Geometron& p)
return -1;
else { // advance the particle
for (int j = 0; j < p.n_coord(); ++j)
p.coord(j).r += (min_dist + scoot) * p.coord(j).u;
p.coord(j).r += (min_dist + TINY_BIT) * p.coord(j).u;
return std::abs(intersected_surface);
}
}
Expand Down Expand Up @@ -1632,11 +1631,10 @@ void Ray::trace()

i_surface_ = std::abs(surface()) - 1;

// This means no surface was intersected.
if (i_surface_ == 2147483646) {
std::cout << "lost a particle, u,r=!" << std::endl;
std::cout << r() << std::endl;
std::cout << u() << std::endl;
// This means no surface was intersected. See cell.cpp
// and search for numeric_limits to see where we return it.
if (surface() == std::numeric_limits<int>::max()) {
warning(fmt::format("Lost a ray, r = {}, u = {}", u, r));
return;
}

Expand Down

0 comments on commit 8a6da9b

Please sign in to comment.