mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
21 lines
506 B
C++
21 lines
506 B
C++
#include "openmc/physics_common.h"
|
|
|
|
#include "openmc/random_lcg.h"
|
|
#include "openmc/settings.h"
|
|
|
|
namespace openmc {
|
|
|
|
//==============================================================================
|
|
// RUSSIAN_ROULETTE
|
|
//==============================================================================
|
|
|
|
void russian_roulette(Particle& p, double weight_survive)
|
|
{
|
|
if (weight_survive * prn(p.current_seed()) < p.wgt()) {
|
|
p.wgt() = weight_survive;
|
|
} else {
|
|
p.wgt() = 0.;
|
|
}
|
|
}
|
|
|
|
} // namespace openmc
|