change particle to using accessor methods

This commit is contained in:
Gavin Ridley 2021-04-14 17:13:59 -04:00
parent 711c60ea15
commit d5d2072266
38 changed files with 1234 additions and 1031 deletions

View file

@ -11,14 +11,14 @@ namespace openmc {
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;
}
}
}