From 1d4cd9b0aa290ef624d1689f47f2710d15e68dcc Mon Sep 17 00:00:00 2001 From: John Tramm Date: Tue, 28 Nov 2023 15:20:54 -0600 Subject: [PATCH] F90_NONE Removal (MGMC tallying optimization) (#2785) --- include/openmc/constants.h | 1 - include/openmc/particle_data.h | 8 ++++---- src/tallies/filter_energy.cpp | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/openmc/constants.h b/include/openmc/constants.h index 2b9eaca2989..ba558b04089 100644 --- a/include/openmc/constants.h +++ b/include/openmc/constants.h @@ -317,7 +317,6 @@ enum class GlobalTally { K_COLLISION, K_ABSORPTION, K_TRACKLENGTH, LEAKAGE }; // Miscellaneous constexpr int C_NONE {-1}; -constexpr int F90_NONE {0}; // TODO: replace usage of this with C_NONE // Interpolation rules enum class Interpolation { diff --git a/include/openmc/particle_data.h b/include/openmc/particle_data.h index ee34c305207..37eb05bdb04 100644 --- a/include/openmc/particle_data.h +++ b/include/openmc/particle_data.h @@ -257,10 +257,10 @@ class ParticleData { vector cell_last_; //!< coordinates for all levels // Energy data - double E_; //!< post-collision energy in eV - double E_last_; //!< pre-collision energy in eV - int g_ {0}; //!< post-collision energy group (MG only) - int g_last_; //!< pre-collision energy group (MG only) + double E_; //!< post-collision energy in eV + double E_last_; //!< pre-collision energy in eV + int g_ {C_NONE}; //!< post-collision energy group (MG only) + int g_last_; //!< pre-collision energy group (MG only) // Other physical data double wgt_ {1.0}; //!< particle weight diff --git a/src/tallies/filter_energy.cpp b/src/tallies/filter_energy.cpp index 48448cb1f05..825dd2ee571 100644 --- a/src/tallies/filter_energy.cpp +++ b/src/tallies/filter_energy.cpp @@ -59,7 +59,7 @@ void EnergyFilter::set_bins(gsl::span bins) void EnergyFilter::get_all_bins( const Particle& p, TallyEstimator estimator, FilterMatch& match) const { - if (p.g() != F90_NONE && matches_transport_groups_) { + if (p.g() != C_NONE && matches_transport_groups_) { if (estimator == TallyEstimator::TRACKLENGTH) { match.bins_.push_back(data::mg.num_energy_groups_ - p.g() - 1); } else { @@ -98,7 +98,7 @@ std::string EnergyFilter::text_label(int bin) const void EnergyoutFilter::get_all_bins( const Particle& p, TallyEstimator estimator, FilterMatch& match) const { - if (p.g() != F90_NONE && matches_transport_groups_) { + if (p.g() != C_NONE && matches_transport_groups_) { match.bins_.push_back(data::mg.num_energy_groups_ - p.g() - 1); match.weights_.push_back(1.0);