From d426b3a24efab70d225145e0818a0a930168639a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 8 Jul 2020 15:40:42 -0500 Subject: [PATCH] Make sure using multiple S(a,b) tables doesn't break depletion --- src/material.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/material.cpp b/src/material.cpp index ea5571df8..a77d51ed8 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "xtensor/xbuilder.hpp" #include "xtensor/xoperation.hpp" @@ -412,7 +413,14 @@ void Material::init_thermal() { std::vector tables; + std::unordered_set already_checked; for (const auto& table : thermal_tables_) { + // Make sure each S(a,b) table only gets checked once + if (already_checked.find(table.index_table) != already_checked.end()) { + continue; + } + already_checked.insert(table.index_table); + // In order to know which nuclide the S(a,b) table applies to, we need // to search through the list of nuclides for one which has a matching // name