Skip to content

Commit

Permalink
Remove alltrans_startup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Sep 8, 2024
1 parent 6821e72 commit 412cf7a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
3 changes: 2 additions & 1 deletion atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ inline auto get_includedlevels() -> int { return includedlevels; }
}

[[nodiscard]] inline auto get_uptranslist(const int element, const int ion, const int level) -> LevelTransition * {
return globals::alltrans + globals::elements[element].ions[ion].levels[level].alltrans_startup;
const auto &levelref = globals::elements[element].ions[ion].levels[level];
return globals::alltrans + levelref.alltrans_startdown + levelref.ndowntrans;
}

[[nodiscard]] inline auto get_uptransspan(const int element, const int ion, const int level) {
Expand Down
12 changes: 5 additions & 7 deletions globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,15 @@ struct PhotoionTarget {
};

struct EnergyLevel {
double epsilon{-1}; // Excitation energy of this level relative to the neutral ground level.
int nuptrans{0};
int alltrans_startup{}; // Allowed upward transitions from this level
double epsilon{-1}; // Excitation energy of this level relative to the neutral ground level.
int alltrans_startdown{}; // Allowed downward transitions from this level
int ndowntrans{0};
int alltrans_startdown{}; // Allowed downward transitions from this level
PhotoionTarget *phixstargets{}; // pointer to table of target states and probabilities
int nuptrans{0};
int phixsstart{-1}; // index to start of photoionisation cross-sections table in global::allphixs
int nphixstargets{0}; // length of phixstargets array:
float stat_weight{0.}; // Statistical weight of this level.

int cont_index{-1}; // Index of the continuum associated to this level. Negative number.
PhotoionTarget *phixstargets{}; // pointer to table of target states and probabilities
int cont_index{-1}; // Index of the continuum associated to this level. Negative number.
int closestgroundlevelcont{-1};
};

Expand Down
17 changes: 8 additions & 9 deletions input.cc
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,6 @@ void add_transitions_to_unsorted_linelist(const int element, const int ion, cons
for (int level = 0; level < nlevelsmax; level++) {
globals::elements[element].ions[ion].levels[level].alltrans_startdown = alltransindex;
alltransindex += get_ndowntrans(element, ion, level);

globals::elements[element].ions[ion].levels[level].alltrans_startup = alltransindex;
alltransindex += get_nuptrans(element, ion, level);

set_ndowntrans(element, ion, level, 0);
Expand Down Expand Up @@ -559,13 +557,14 @@ void add_transitions_to_unsorted_linelist(const int element, const int ion, cons
.coll_str = transition.coll_str,
.osc_strength = f_ul,
.forbidden = transition.forbidden};
temp_alltranslist[globals::elements[element].ions[ion].levels[lowerlevel].alltrans_startup + nloweruptrans -
1] = {.lineindex = -1,
.targetlevelindex = level,
.einstein_A = transition.A,
.coll_str = transition.coll_str,
.osc_strength = f_ul,
.forbidden = transition.forbidden};
temp_alltranslist[globals::elements[element].ions[ion].levels[lowerlevel].alltrans_startdown +
get_ndowntrans(element, ion, lowerlevel) + nloweruptrans - 1] = {
.lineindex = -1,
.targetlevelindex = level,
.einstein_A = transition.A,
.coll_str = transition.coll_str,
.osc_strength = f_ul,
.forbidden = transition.forbidden};
}

} else if (pass == 1 && globals::rank_in_node == 0) {
Expand Down

0 comments on commit 412cf7a

Please sign in to comment.