From b9bf4fc65b64187401adf9e5cf911b3a53efd2da Mon Sep 17 00:00:00 2001 From: Gavin Ridley Date: Tue, 21 Jan 2020 14:52:35 -0500 Subject: [PATCH] few more changes to make the develop merge work --- src/particle.cpp | 17 +++++++++-------- src/physics.cpp | 4 ++-- src/physics_mg.cpp | 2 +- src/settings.cpp | 2 +- src/simulation.cpp | 8 ++++---- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/particle.cpp b/src/particle.cpp index 4e836a8dc..bd9a61139 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -146,7 +146,7 @@ Particle::event_calculate_xs() r_last_ = this->r(); // Reset event variables - event_ = EVENT_KILL; + event_ = TallyEvent::KILL; event_nuclide_ = NUCLIDE_NONE; event_mt_ = REACTION_NONE; @@ -225,7 +225,7 @@ Particle::event_advance() } // Score track-length estimate of k-eff - if (settings::run_mode == RUN_MODE_EIGENVALUE && + if (settings::run_mode == RunMode::EIGENVALUE && type_ == Particle::Type::neutron) { keff_tally_tracklength_ += wgt_ * distance * macro_xs_.nu_fission; } @@ -254,11 +254,11 @@ Particle::event_cross_surface() boundary_.lattice_translation[2] != 0) { // Particle crosses lattice boundary cross_lattice(this, boundary_); - event_ = EVENT_LATTICE; + event_ = TallyEvent::LATTICE; } else { // Particle crosses surface this->cross_surface(); - event_ = EVENT_SURFACE; + event_ = TallyEvent::SURFACE; } // Score cell to cell partial currents if (!model::active_surface_tallies.empty()) { @@ -270,7 +270,7 @@ void Particle::event_collide() { // Score collision estimate of keff - if (settings::run_mode == RUN_MODE_EIGENVALUE && + if (settings::run_mode == RunMode::EIGENVALUE && type_ == Particle::Type::neutron) { keff_tally_collision_ += wgt_ * macro_xs_.nu_fission / macro_xs_.total; @@ -394,7 +394,7 @@ Particle::event_death() // Record the number of progeny created by this particle. // This data will be used to efficiently sort the fission bank. - if (settings::run_mode == RUN_MODE_EIGENVALUE) { + if (settings::run_mode == RunMode::EIGENVALUE) { int64_t offset = id_ - 1 - simulation::work_index[mpi::rank]; simulation::progeny_per_particle[offset] = n_progeny_; } @@ -439,8 +439,9 @@ Particle::cross_surface() } return; - } else if ((surf->bc_ == Surface::BoundaryType::REFLECT || surf->bc_ == Surface::Bc::WHITE) - && (settings::run_mode != RunMode::PLOTTING)) { + } else if ((surf->bc_ == Surface::BoundaryType::REFLECT || + surf->bc_ == Surface::BoundaryType::WHITE) + && (settings::run_mode != RunMode::PLOTTING)) { // ======================================================================= // PARTICLE REFLECTS FROM SURFACE diff --git a/src/physics.cpp b/src/physics.cpp index b6a509bb0..30925d6dc 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -176,7 +176,7 @@ create_fission_sites(Particle* p, int i_nuclide, const Reaction* rx) // Determine whether to place fission sites into the shared fission bank // or the secondary particle bank. - bool use_fission_bank = (settings::run_mode == RUN_MODE_EIGENVALUE); + bool use_fission_bank = (settings::run_mode == RunMode::EIGENVALUE); for (int i = 0; i < nu; ++i) { Particle::Bank* site; @@ -593,7 +593,7 @@ void absorption(Particle* p, int i_nuclide) // Score implicit absorption estimate of keff if (settings::run_mode == RunMode::EIGENVALUE) { - p->keff_tally_absorption += p->wgt_absorb_ * p->neutron_xs_[ + p->keff_tally_absorption_ += p->wgt_absorb_ * p->neutron_xs_[ i_nuclide].nu_fission / p->neutron_xs_[i_nuclide].absorption; } } else { diff --git a/src/physics_mg.cpp b/src/physics_mg.cpp index 54ab4ec4b..ed9d9f180 100644 --- a/src/physics_mg.cpp +++ b/src/physics_mg.cpp @@ -122,7 +122,7 @@ create_fission_sites(Particle* p) // Determine whether to place fission sites into the shared fission bank // or the secondary particle bank. - bool use_fission_bank = (settings::run_mode == RUN_MODE_EIGENVALUE); + bool use_fission_bank = (settings::run_mode == RunMode::EIGENVALUE); for (int i = 0; i < nu; ++i) { Particle::Bank* site; diff --git a/src/settings.cpp b/src/settings.cpp index 916d07b46..cca710308 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -94,7 +94,7 @@ std::vector res_scat_nuclides; RunMode run_mode {RunMode::UNSET}; std::unordered_set sourcepoint_batch; std::unordered_set statepoint_batch; -TemperatureMethod temperature_method {TemperatureInterpolationType::NEAREST}; +TemperatureMethod temperature_method {TemperatureMethod::NEAREST}; double temperature_tolerance {10.0}; double temperature_default {293.6}; std::array temperature_range {0.0, 0.0}; diff --git a/src/simulation.cpp b/src/simulation.cpp index b3885b456..c2332c397 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -380,11 +380,11 @@ void finalize_generation() // Update global tallies with the accumulation variables if (settings::run_mode == RunMode::EIGENVALUE) { - gt(K_COLLISION, RESULT_VALUE) += global_tally_collision; - gt(K_ABSORPTION, RESULT_VALUE) += global_tally_absorption; - gt(K_TRACKLENGTH, RESULT_VALUE) += global_tally_tracklength; + gt(GlobalTally::K_COLLISION, TallyResult::VALUE) += global_tally_collision; + gt(GlobalTally::K_ABSORPTION, TallyResult::VALUE) += global_tally_absorption; + gt(GlobalTally::K_TRACKLENGTH, TallyResult::VALUE) += global_tally_tracklength; } - gt(LEAKAGE, RESULT_VALUE) += global_tally_leakage; + gt(GlobalTally::LEAKAGE, TallyResult::VALUE) += global_tally_leakage; // reset tallies if (settings::run_mode == RunMode::EIGENVALUE) {