From 69653b3336cacc4fd1c96c635375ab00b62e0180 Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Wed, 20 Nov 2024 13:07:36 +0000 Subject: [PATCH] Update thermalbalance.cc --- thermalbalance.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/thermalbalance.cc b/thermalbalance.cc index 04185e31c..871b84bab 100644 --- a/thermalbalance.cc +++ b/thermalbalance.cc @@ -7,6 +7,7 @@ #include #include +#include #include #include "artisoptions.h" @@ -278,7 +279,8 @@ void calculate_bfheatingcoeffs(int nonemptymgi, std::vector &bfheatingco const int nions = get_nions(element); for (int ion = 0; ion < nions; ion++) { const int nlevels = get_nlevels(element, ion); - for (int level = 0; level < nlevels; level++) { + const auto levels = std::ranges::iota_view{0, nlevels}; + std::for_each(EXEC_PAR levels.begin(), levels.end(), [&](const int level) { double bfheatingcoeff = 0.; if (grid::get_elem_abundance(nonemptymgi, element) > minelfrac || USE_LUT_BFHEATING) { const auto nphixstargets = get_nphixstargets(element, ion, level); @@ -306,7 +308,7 @@ void calculate_bfheatingcoeffs(int nonemptymgi, std::vector &bfheatingco } } bfheatingcoeffs[get_uniquelevelindex(element, ion, level)] = bfheatingcoeff; - } + }); } } }