Skip to content

Commit

Permalink
Merge pull request openmc-dev#1300 from paulromano/mg-delayedgroup-fix
Browse files Browse the repository at this point in the history
Fix bug in Mgxs::get_xs
  • Loading branch information
nelsonag authored Jul 24, 2019
2 parents cca3012 + 020c0c3 commit b7a7277
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/mgxs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ Mgxs::get_xs(int xstype, int gin, const int* gout, const double* mu,
break;
case MG_GET_XS_DECAY_RATE:
if (dg != nullptr) {
val = xs_t->decay_rate(a, *dg + 1);
val = xs_t->decay_rate(a, *dg);
} else {
val = xs_t->decay_rate(a, 0);
}
Expand Down
20 changes: 2 additions & 18 deletions src/mgxs_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,13 @@ get_nuclide_xs(int index, int xstype, int gin, const int* gout,
{
int gout_c;
const int* gout_c_p;
int dg_c;
const int* dg_c_p;
if (gout != nullptr) {
gout_c = *gout - 1;
gout_c_p = &gout_c;
} else {
gout_c_p = gout;
}
if (dg != nullptr) {
dg_c = *dg - 1;
dg_c_p = &dg_c;
} else {
dg_c_p = dg;
}
return data::nuclides_MG[index].get_xs(xstype, gin - 1, gout_c_p, mu, dg_c_p);
return data::nuclides_MG[index].get_xs(xstype, gin - 1, gout_c_p, mu, dg);
}

//==============================================================================
Expand All @@ -288,21 +280,13 @@ get_macro_xs(int index, int xstype, int gin, const int* gout,
{
int gout_c;
const int* gout_c_p;
int dg_c;
const int* dg_c_p;
if (gout != nullptr) {
gout_c = *gout - 1;
gout_c_p = &gout_c;
} else {
gout_c_p = gout;
}
if (dg != nullptr) {
dg_c = *dg - 1;
dg_c_p = &dg_c;
} else {
dg_c_p = dg;
}
return data::macro_xs[index].get_xs(xstype, gin - 1, gout_c_p, mu, dg_c_p);
return data::macro_xs[index].get_xs(xstype, gin - 1, gout_c_p, mu, dg);
}

//==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/regression_tests/mg_tallies/results_true.dat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15e00a46742e973d7c3c5defe427e6f76a4f1b661538cf54957712751410218dc64301fe12ccb8dbed3f2d51d19b3e99d2b615a3e98c46f9954894e96667dc23
508cd056f2d9409a536e487512df34c683720ea45b9100316efb31c19927890c4cacd92f38817d74fcf491bbe4bdb78a0215a798d5a078e0575e3fd94cedf0bd

0 comments on commit b7a7277

Please sign in to comment.