Skip to content

Commit

Permalink
Update macroatom.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Sep 8, 2024
1 parent 12a4d5c commit cd727f3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions macroatom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ constexpr bool LOG_MACROATOM = false;

FILE *macroatom_file{};

void calculate_macroatom_transitionrates(const int modelgridindex, const int element, const int ion, const int level,
auto calculate_macroatom_transitionrates(const int modelgridindex, const int element, const int ion, const int level,
const double t_mid, CellCacheLevels &chlevel) {
// printout("Calculating transition rates for element %d ion %d level %d\n", element, ion, level);
auto &processrates = chlevel.processrates;
auto processrates = std::array<double, MA_ACTION_COUNT>{};

const auto T_e = grid::get_Te(modelgridindex);
const auto nne = grid::get_nne(modelgridindex);
const double epsilon_current = epsilon(element, ion, level);
Expand Down Expand Up @@ -150,6 +151,8 @@ void calculate_macroatom_transitionrates(const int modelgridindex, const int ele
}
processrates[MA_ACTION_INTERNALUPHIGHERNT] = sum_up_highernt;
processrates[MA_ACTION_INTERNALUPHIGHER] = sum_up_higher;

return processrates;
}

auto do_macroatom_internal_down_same(const int element, const int ion, const int level) -> int {
Expand Down Expand Up @@ -370,7 +373,7 @@ __host__ __device__ void do_macroatom(Packet &pkt, const MacroAtomState &pktmast

// If there are no precalculated rates available then calculate them
if (chlevel.processrates[MA_ACTION_INTERNALUPHIGHER] < 0) {
calculate_macroatom_transitionrates(modelgridindex, element, ion, level, t_mid, chlevel);
chlevel.processrates = calculate_macroatom_transitionrates(modelgridindex, element, ion, level, t_mid, chlevel);
}
}

Expand Down

0 comments on commit cd727f3

Please sign in to comment.