diff --git a/include/openmc/xsdata.h b/include/openmc/xsdata.h index c9dbde986b2..548430f1791 100644 --- a/include/openmc/xsdata.h +++ b/include/openmc/xsdata.h @@ -87,7 +87,7 @@ class XsData { // [angle][incoming group][outgoing group] tensor::Tensor chi_prompt; // chi_delayed has the following dimensions: - // [angle][incoming group][outgoing group][delayed group] + // [angle][delayed group][incoming group][outgoing group] tensor::Tensor chi_delayed; // scatter has the following dimensions: [angle] vector> scatter; diff --git a/src/mgxs.cpp b/src/mgxs.cpp index 1dc090ab969..0c94a4846b3 100644 --- a/src/mgxs.cpp +++ b/src/mgxs.cpp @@ -490,16 +490,19 @@ double Mgxs::get_xs(MgxsType xstype, int gin, const int* gout, const double* mu, val = xs_t->chi_delayed(a, 0, gin, *gout); } } else { + // sum of chi_delayed over outgoing groups; chi_delayed has shape + // [angle][delayed group][in group][out group] (the previous code + // indexed the rank-3 delayed_nu_fission tensor with four indices) if (dg != nullptr) { val = 0.; - for (int g = 0; g < xs_t->delayed_nu_fission.shape(2); g++) { - val += xs_t->delayed_nu_fission(a, *dg, gin, g); + for (int g = 0; g < xs_t->chi_delayed.shape(3); g++) { + val += xs_t->chi_delayed(a, *dg, gin, g); } } else { val = 0.; - for (int g = 0; g < xs_t->delayed_nu_fission.shape(2); g++) { - for (int d = 0; d < xs_t->delayed_nu_fission.shape(3); d++) { - val += xs_t->delayed_nu_fission(a, d, gin, g); + for (int d = 0; d < xs_t->chi_delayed.shape(1); d++) { + for (int g = 0; g < xs_t->chi_delayed.shape(3); g++) { + val += xs_t->chi_delayed(a, d, gin, g); } } }