From 1aa8dbd9b94c412ab8dcf4731271858fb0c7a8c6 Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Sun, 8 Sep 2024 17:31:42 +0100 Subject: [PATCH] Update input.cc --- input.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/input.cc b/input.cc index eb7abfabf..34e5bbc55 100644 --- a/input.cc +++ b/input.cc @@ -608,7 +608,7 @@ void add_transitions_to_unsorted_linelist(const int element, const int ion, cons const float f_ul = g_ratio * ME * pow(CLIGHT, 3) / (8 * pow(QE * nu_trans * PI, 2)) * transition.A; const int nupperdowntrans = get_ndowntrans(element, ion, level); - auto &downtransition = globals::elements[element].ions[ion].levels[level].downtrans[nupperdowntrans]; + auto &downtransition = get_downtranslist(element, ion, level)[nupperdowntrans]; // this is what classic did, but it is not quite correct. The downtrans list should be searched to find the // correct index, not just using the last one. It probably works for the case where the transitions are sorted, @@ -1275,7 +1275,7 @@ void read_atomicdata_files() { // so find the first matching the upper and lower transition const int nupperdowntrans = get_ndowntrans(element, ion, upperlevel); - auto &downtranslist = globals::elements[element].ions[ion].levels[upperlevel].downtrans; + auto *downtranslist = get_downtranslist(element, ion, upperlevel); auto *downtransition = std::find_if(downtranslist, downtranslist + nupperdowntrans, [=](const auto &downtrans) { return downtrans.targetlevelindex == lowerlevel; });