Revised MG code so that the energy group indices are 0-based instead of 1-based. Next commit will perform some code cleanup enabled by this change.

This commit is contained in:
Adam G Nelson 2019-11-11 19:50:52 -06:00
parent 677f4f7d8b
commit 05fac29164
7 changed files with 19 additions and 27 deletions

View file

@ -309,11 +309,11 @@ Particle::Bank sample_external_source()
// Sample source site from i-th source distribution
Particle::Bank site {model::external_sources[i].sample()};
// If running in MG, convert site % E to group
// If running in MG, convert site.E to group
if (!settings::run_CE) {
site.E = lower_bound_index(data::mg.rev_energy_bins_.begin(),
data::mg.rev_energy_bins_.end(), site.E);
site.E = data::mg.num_energy_groups_ - site.E;
site.E = data::mg.num_energy_groups_ - site.E - 1.;
}
// Set the random number generator back to the tracking stream.