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

openmc-dev / openmc / 21597104861

02 Feb 2026 03:53PM UTC coverage: 81.674% (-0.3%) from 81.968%
21597104861

Pull #3751

github

web-flow
Merge 4a6501226 into 6041ee6ae
Pull Request #3751: Resolve conflict with weight windows and global russian roulette

16697 of 23049 branches covered (72.44%)

Branch coverage included in aggregate %.

76 of 84 new or added lines in 5 files covered. (90.48%)

471 existing lines in 31 files now uncovered.

54833 of 64531 relevant lines covered (84.97%)

37154420.72 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,067,328✔
13
{
14
  if (weight_survive * prn(p.current_seed()) < p.wgt()) {
1,067,328✔
15
    p.wgt() = weight_survive;
188,732✔
16
  } else {
17
    p.wgt() = 0.;
878,596✔
18
  }
19
}
1,067,328✔
20

21
void apply_russian_roulette(Particle& p)
1,796,303,530✔
22
{
23
  // Exit if survival biasing is turned off
24
  if (!settings::survival_biasing)
1,796,303,530✔
25
    return;
1,792,871,378✔
26

27
  // if survival normalization is on, use normalized weight cutoff and
28
  // normalized weight survive
29
  if (settings::survival_normalization) {
3,432,152!
NEW
30
    if (p.wgt() < settings::weight_cutoff * p.wgt_born()) {
×
NEW
31
      russian_roulette(p, settings::weight_survive * p.wgt_born());
×
32
    }
33
  } else if (p.wgt() < settings::weight_cutoff) {
3,432,152✔
34
    russian_roulette(p, settings::weight_survive);
144,968✔
35
  }
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