diff --git a/rpkt.cc b/rpkt.cc index 01c0a0ef8..e8ca48d27 100644 --- a/rpkt.cc +++ b/rpkt.cc @@ -913,7 +913,8 @@ auto calculate_chi_bf_gammacontr(const int modelgridindex, const double nu, Phix const int element = globals::allcont[i].element; const int ion = globals::allcont[i].ion; const int level = globals::allcont[i].level; - const auto bfestimindex = globals::allcont[i].bfestimindex; + const auto bfestimindex = + (USECELLHISTANDUPDATEPHIXSLIST && DETAILED_BF_ESTIMATORS_ON) ? globals::allcont[i].bfestimindex : -1; // The bf process happens only if the current cell contains // the involved atomic species @@ -963,20 +964,15 @@ auto calculate_chi_bf_gammacontr(const int modelgridindex, const double nu, Phix } chi_bf_sum += nnlevel * sigma_contr; - } else if constexpr (USECELLHISTANDUPDATEPHIXSLIST && DETAILED_BF_ESTIMATORS_ON) { - // ignore this particular process - if (bfestimindex >= 0) { - phixslist->gamma_contr[bfestimindex] = 0.; - } - } - } else if constexpr (USECELLHISTANDUPDATEPHIXSLIST && DETAILED_BF_ESTIMATORS_ON) { - // no element present or not an important level - if (bfestimindex >= 0) { - phixslist->gamma_contr[bfestimindex] = 0.; } } if constexpr (USECELLHISTANDUPDATEPHIXSLIST) { phixslist->chi_bf_sum[i] = chi_bf_sum; + if constexpr (DETAILED_BF_ESTIMATORS_ON) { + if (bfestimindex >= 0) { + phixslist->gamma_contr[bfestimindex] = 0.; + } + } } }