Skip to content

Commit

Permalink
F90_NONE Removal (MGMC tallying optimization) (#2785)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtramm committed Nov 28, 2023
1 parent e8faccd commit 1d4cd9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion include/openmc/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions include/openmc/particle_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ class ParticleData {
vector<int> 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
Expand Down
4 changes: 2 additions & 2 deletions src/tallies/filter_energy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void EnergyFilter::set_bins(gsl::span<const double> 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 {
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 1d4cd9b

Please sign in to comment.