mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
change particle to using accessor methods
This commit is contained in:
parent
711c60ea15
commit
d5d2072266
38 changed files with 1234 additions and 1031 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue