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