mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Address @smharper comments
This commit is contained in:
parent
83d64397d1
commit
d38b3f7714
1 changed files with 2 additions and 3 deletions
|
|
@ -304,12 +304,11 @@ Bank sample_external_source()
|
|||
total_strength += s.strength();
|
||||
|
||||
// Sample from among multiple source distributions
|
||||
auto n_source = external_sources.size();
|
||||
int i = 0;
|
||||
if (n_source > 1) {
|
||||
if (external_sources.size() > 1) {
|
||||
double xi = prn()*total_strength;
|
||||
double c = 0.0;
|
||||
for (i = 0; i < external_sources.size(); ++i) {
|
||||
for (; i < external_sources.size(); ++i) {
|
||||
c += external_sources[i].strength();
|
||||
if (xi < c) break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue