Fix tally nuclide indexing error

This commit is contained in:
Sterling Harper 2019-02-05 20:23:08 -05:00
parent 3377241f4d
commit cb87aeff7c

View file

@ -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;