From 301f15139ffcadb8adea9bf15fe79bc9cbf1cc84 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 3 Sep 2020 22:30:46 -0500 Subject: [PATCH] Correction to plot level and index check. --- include/openmc/plot.h | 2 +- src/plot.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/openmc/plot.h b/include/openmc/plot.h index c5397a3e3..28c395bca 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -184,7 +184,7 @@ T PlotBase::get_map() const { // local variables bool found_cell = find_cell(p, 0); j = p.n_coord_ - 1; - if (level >= 0) {j = level + 1;} + if (level >= 0) { j = level; } if (found_cell) { data.set_value(y, x, p, j); } diff --git a/src/plot.cpp b/src/plot.cpp index f52c2b03f..20c3c986e 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -42,7 +42,7 @@ IdData::IdData(size_t h_res, size_t v_res) void IdData::set_value(size_t y, size_t x, const Particle& p, int level) { // set cell data - if (p.n_coord_ < level) { + if (p.n_coord_ <= level) { data_(y, x, 0) = NOT_FOUND; } else { data_(y, x, 0) = model::cells.at(p.coord_.at(level).cell)->id_;