• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmc-dev / openmc / 21389510982

27 Jan 2026 08:12AM UTC coverage: 81.991% (+0.01%) from 81.979%
21389510982

Pull #3751

github

web-flow
Merge 29801645c into db426b66c
Pull Request #3751: Resolve conflict with weight windows and global russian roulette

17220 of 23973 branches covered (71.83%)

Branch coverage included in aggregate %.

15 of 17 new or added lines in 4 files covered. (88.24%)

52 existing lines in 3 files now uncovered.

55703 of 64967 relevant lines covered (85.74%)

44149488.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.26
/src/physics_common.cpp
1
#include "openmc/physics_common.h"
2

3
#include "openmc/random_lcg.h"
4
#include "openmc/settings.h"
5

6
namespace openmc {
7

8
//==============================================================================
9
// RUSSIAN_ROULETTE
10
//==============================================================================
11

12
void russian_roulette(Particle& p, double weight_survive)
1,467,509✔
13
{
14
  if (weight_survive * prn(p.current_seed()) < p.wgt()) {
1,467,509✔
15
    p.wgt() = weight_survive;
259,673✔
16
  } else {
17
    p.wgt() = 0.;
1,207,836✔
18
  }
19
}
1,467,509✔
20

21
void apply_neutron_russian_roulette(Particle& p)
2,147,483,647✔
22
{
23
  // Play russian roulette if survival biasing is turned on
24
  if (settings::survival_biasing) {
2,147,483,647✔
25
    // if survival normalization is on, use normalized weight cutoff and
26
    // normalized weight survive
27
    if (settings::survival_normalization) {
4,719,209!
NEW
28
      if (p.wgt() < settings::weight_cutoff * p.wgt_born()) {
×
NEW
29
        russian_roulette(p, settings::weight_survive * p.wgt_born());
×
30
      }
31
    } else if (p.wgt() < settings::weight_cutoff) {
4,719,209✔
32
      russian_roulette(p, settings::weight_survive);
199,331✔
33
    }
34
  }
35
}
2,147,483,647✔
36

37
} // namespace openmc
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc