Use references consistently in physics modules

This commit is contained in:
Paul Romano 2020-04-23 10:11:43 -05:00
parent 65c0dbfe46
commit 43eae72aeb
7 changed files with 276 additions and 277 deletions

View file

@ -9,16 +9,16 @@ namespace openmc {
// RUSSIAN_ROULETTE
//==============================================================================
void russian_roulette(Particle* p)
void russian_roulette(Particle& p)
{
if (p->wgt_ < settings::weight_cutoff) {
if (prn(p->current_seed()) < p->wgt_ / settings::weight_survive) {
p->wgt_ = settings::weight_survive;
p->wgt_last_ = p->wgt_;
if (p.wgt_ < settings::weight_cutoff) {
if (prn(p.current_seed()) < p.wgt_ / settings::weight_survive) {
p.wgt_ = settings::weight_survive;
p.wgt_last_ = p.wgt_;
} else {
p->wgt_ = 0.;
p->wgt_last_ = 0.;
p->alive_ = false;
p.wgt_ = 0.;
p.wgt_last_ = 0.;
p.alive_ = false;
}
}
}