Make atomic_relaxation iterative instead of recursive

This commit is contained in:
amandalund 2021-10-03 18:35:34 -05:00
parent d939bad736
commit ba1a39e281
3 changed files with 60 additions and 45 deletions

View file

@ -326,8 +326,7 @@ void sample_photon_reaction(Particle& p)
// Allow electrons to fill orbital and produce auger electrons
// and fluorescent photons
if (i_shell >= 0) {
const auto& shell = element.shells_[i_shell];
element.atomic_relaxation(shell, p);
element.atomic_relaxation(i_shell, p);
}
phi += PI;
@ -341,7 +340,9 @@ void sample_photon_reaction(Particle& p)
// Photoelectric effect
double prob_after = prob + micro.photoelectric;
if (prob_after > cutoff) {
for (const auto& shell : element.shells_) {
for (int i_shell = 0; i_shell < element.shells_.size(); ++i_shell) {
const auto& shell {element.shells_[i_shell]};
// Get grid index and interpolation factor
int i_grid = micro.index_grid;
double f = micro.interp_factor;
@ -387,7 +388,7 @@ void sample_photon_reaction(Particle& p)
// Allow electrons to fill orbital and produce auger electrons
// and fluorescent photons
element.atomic_relaxation(shell, p);
element.atomic_relaxation(i_shell, p);
p.event() = TallyEvent::ABSORB;
p.event_mt() = 533 + shell.index_subshell;
p.alive() = false;