From 718f3ee3b8c445097e016bd06dc47f49cd865c5d Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Wed, 4 Sep 2024 08:44:29 +0100 Subject: [PATCH] Disable assertion for duplicate transitions on input (tripped on classic dataset) --- input.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/input.cc b/input.cc index b86106ef0..bcd192f6f 100644 --- a/input.cc +++ b/input.cc @@ -609,14 +609,22 @@ void add_transitions_to_unsorted_linelist(const int element, const int ion, cons const int nupperdowntrans = get_ndowntrans(element, ion, level); auto &downtransition = globals::elements[element].ions[ion].levels[level].downtrans[nupperdowntrans]; - assert_always(downtransition.targetlevelindex == lowerlevel); + + // 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, + // but the assertion tripped on C IV in the classic dataset. + // assert_always(downtransition.targetlevelindex == lowerlevel); + downtransition.einstein_A += transition.A; downtransition.osc_strength += f_ul; downtransition.coll_str = std::max(downtransition.coll_str, transition.coll_str); const int nloweruptrans = get_nuptrans(element, ion, lowerlevel); auto &uptransition = globals::elements[element].ions[ion].levels[lowerlevel].uptrans[nloweruptrans]; - assert_always(uptransition.targetlevelindex == level); + + // as above, the downtrans list should be searched to find the correct index instead of using the last one. + // assert_always(uptransition.targetlevelindex == level); + uptransition.einstein_A += transition.A; uptransition.osc_strength += f_ul; uptransition.coll_str = std::max(uptransition.coll_str, transition.coll_str);