From 24655dfd5db9fced3baad9ccc7197615e25ef520 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 31 Mar 2025 09:29:30 -0500 Subject: [PATCH] Report plot ID instead of index for unsupported plot types in random ray mode (#3361) --- src/random_ray/random_ray_simulation.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index bf01d2f57..36517bee4 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -303,20 +303,21 @@ void validate_random_ray_inputs() for (int p = 0; p < model::plots.size(); p++) { // Get handle to OpenMC plot object - Plot* openmc_plot = dynamic_cast(model::plots[p].get()); + const auto& openmc_plottable = model::plots[p]; + Plot* openmc_plot = dynamic_cast(openmc_plottable.get()); // Random ray plots only support voxel plots if (!openmc_plot) { warning(fmt::format( "Plot {} will not be used for end of simulation data plotting -- only " "voxel plotting is allowed in random ray mode.", - p)); + openmc_plottable->id())); continue; } else if (openmc_plot->type_ != Plot::PlotType::voxel) { warning(fmt::format( "Plot {} will not be used for end of simulation data plotting -- only " "voxel plotting is allowed in random ray mode.", - p)); + openmc_plottable->id())); continue; } }