Skip to content

Commit d140f74

Browse files
committed
address review comments
1 parent da09424 commit d140f74

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/plot.cpp

+6-8
Original file line numberDiff line numberDiff line change
@@ -1109,8 +1109,7 @@ void RayTracePlot::set_output_path(pugi::xml_node node)
11091109
// if an intersection was found.
11101110
int RayTracePlot::advance_to_boundary_from_void(Geometron& p)
11111111
{
1112-
constexpr double scoot = 1e-5;
1113-
double min_dist = {INFINITY};
1112+
double min_dist {INFINITY};
11141113
auto coord = p.coord(0);
11151114
Universe* uni = model::universes[model::root_universe].get();
11161115
int intersected_surface = -1;
@@ -1125,7 +1124,7 @@ int RayTracePlot::advance_to_boundary_from_void(Geometron& p)
11251124
return -1;
11261125
else { // advance the particle
11271126
for (int j = 0; j < p.n_coord(); ++j)
1128-
p.coord(j).r += (min_dist + scoot) * p.coord(j).u;
1127+
p.coord(j).r += (min_dist + TINY_BIT) * p.coord(j).u;
11291128
return std::abs(intersected_surface);
11301129
}
11311130
}
@@ -1632,11 +1631,10 @@ void Ray::trace()
16321631

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

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

0 commit comments

Comments
 (0)