Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/openmc/xsdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class XsData {
// [angle][incoming group][outgoing group]
tensor::Tensor<double> chi_prompt;
// chi_delayed has the following dimensions:
// [angle][incoming group][outgoing group][delayed group]
// [angle][delayed group][incoming group][outgoing group]
tensor::Tensor<double> chi_delayed;
// scatter has the following dimensions: [angle]
vector<std::shared_ptr<ScattData>> scatter;
Expand Down
13 changes: 8 additions & 5 deletions src/mgxs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
Loading