From cb87aeff7c3441fb10b02d93cc7e0d2113bc537b Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 5 Feb 2019 20:23:08 -0500 Subject: [PATCH] Fix tally nuclide indexing error --- src/tallies/tally.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tallies/tally.cpp b/src/tallies/tally.cpp index 9c38e4009..efd46e5a1 100644 --- a/src/tallies/tally.cpp +++ b/src/tallies/tally.cpp @@ -533,10 +533,9 @@ Tally::set_nuclides(pugi::xml_node node) if (get_node_value(node, "nuclides") == "all") { // This tally should bin every nuclide in the problem. It should also bin // the total material rates. To achieve this, set the nuclides_ vector to - // 1, 2, 3, ..., -1. + // 0, 1, 2, ..., -1. nuclides_.reserve(data::nuclides.size() + 1); - //TODO: off-by-one - for (auto i = 1; i < data::nuclides.size()+1; ++i) + for (auto i = 0; i < data::nuclides.size(); ++i) nuclides_.push_back(i); nuclides_.push_back(-1); all_nuclides_ = true;