mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
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:
parent
677f4f7d8b
commit
05fac29164
7 changed files with 19 additions and 27 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue