Skip to content

Commit

Permalink
Update input.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Sep 8, 2024
1 parent 6051b25 commit 1aa8dbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions input.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
});
Expand Down

0 comments on commit 1aa8dbd

Please sign in to comment.