Use references to Particle consistently in tally_scoring.cpp

This commit is contained in:
Paul Romano 2020-04-23 10:03:29 -05:00
parent f522f31e4b
commit 65c0dbfe46
3 changed files with 349 additions and 349 deletions

View file

@ -23,7 +23,7 @@ class FilterBinIter
public:
//! Construct an iterator over bins that match a given particle's state.
FilterBinIter(const Tally& tally, Particle* p);
FilterBinIter(const Tally& tally, Particle& p);
//! Construct an iterator over all filter bin combinations.
//
@ -41,7 +41,7 @@ public:
int index_ {1};
double weight_ {1.};
std::vector<FilterMatch>& filter_matches_;
private:
@ -63,21 +63,21 @@ private:
//! since collisions do not occur in voids.
//
//! \param p The particle being tracked
void score_collision_tally(Particle* p);
void score_collision_tally(Particle& p);
//! Score tallies based on a simple count of events (for continuous energy).
//
//! Analog tallies are triggered at every collision, not every event.
//
//! \param p The particle being tracked
void score_analog_tally_ce(Particle* p);
void score_analog_tally_ce(Particle& p);
//! Score tallies based on a simple count of events (for multigroup).
//
//! Analog tallies are triggered at every collision, not every event.
//
//! \param p The particle being tracked
void score_analog_tally_mg(Particle* p);
void score_analog_tally_mg(Particle& p);
//! Score tallies using a tracklength estimate of the flux.
//
@ -87,13 +87,13 @@ void score_analog_tally_mg(Particle* p);
//
//! \param p The particle being tracked
//! \param distance The distance in [cm] traveled by the particle
void score_tracklength_tally(Particle* p, double distance);
void score_tracklength_tally(Particle& p, double distance);
//! Score surface or mesh-surface tallies for particle currents.
//
//! \param p The particle being tracked
//! \param tallies A vector of tallies to score to
void score_surface_tally(Particle* p, const std::vector<int>& tallies);
void score_surface_tally(Particle& p, const std::vector<int>& tallies);
} // namespace openmc

View file

@ -223,7 +223,7 @@ Particle::event_advance()
// Score track-length tallies
if (!model::active_tracklength_tallies.empty()) {
score_tracklength_tally(this, distance);
score_tracklength_tally(*this, distance);
}
// Score track-length estimate of k-eff
@ -264,7 +264,7 @@ Particle::event_cross_surface()
}
// Score cell to cell partial currents
if (!model::active_surface_tallies.empty()) {
score_surface_tally(this, model::active_surface_tallies);
score_surface_tally(*this, model::active_surface_tallies);
}
}
@ -283,7 +283,7 @@ Particle::event_collide()
// pre-collision direction to figure out what mesh surfaces were crossed
if (!model::active_meshsurf_tallies.empty())
score_surface_tally(this, model::active_meshsurf_tallies);
score_surface_tally(*this, model::active_meshsurf_tallies);
// Clear surface component
surface_ = 0;
@ -297,12 +297,12 @@ Particle::event_collide()
// Score collision estimator tallies -- this is done after a collision
// has occurred rather than before because we need information on the
// outgoing energy for any tallies with an outgoing energy filter
if (!model::active_collision_tallies.empty()) score_collision_tally(this);
if (!model::active_collision_tallies.empty()) score_collision_tally(*this);
if (!model::active_analog_tallies.empty()) {
if (settings::run_CE) {
score_analog_tally_ce(this);
score_analog_tally_ce(*this);
} else {
score_analog_tally_mg(this);
score_analog_tally_mg(*this);
}
}
@ -429,7 +429,7 @@ Particle::cross_surface()
// physically moving the particle forward slightly
this->r() += TINY_BIT * this->u();
score_surface_tally(this, model::active_meshsurf_tallies);
score_surface_tally(*this, model::active_meshsurf_tallies);
}
// Score to global leakage tally
@ -462,14 +462,14 @@ Particle::cross_surface()
// with a mesh boundary
if (!model::active_surface_tallies.empty()) {
score_surface_tally(this, model::active_surface_tallies);
score_surface_tally(*this, model::active_surface_tallies);
}
if (!model::active_meshsurf_tallies.empty()) {
Position r {this->r()};
this->r() -= TINY_BIT * this->u();
score_surface_tally(this, model::active_meshsurf_tallies);
score_surface_tally(*this, model::active_meshsurf_tallies);
this->r() = r;
}
@ -524,7 +524,7 @@ Particle::cross_surface()
if (!model::active_meshsurf_tallies.empty()) {
Position r {this->r()};
this->r() -= TINY_BIT * this->u();
score_surface_tally(this, model::active_meshsurf_tallies);
score_surface_tally(*this, model::active_meshsurf_tallies);
this->r() = r;
}

File diff suppressed because it is too large Load diff