Merge branch 'develop' into event_based_update

This commit is contained in:
John Tramm 2020-01-22 09:06:38 -06:00 committed by GitHub
commit 10a6d152de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
92 changed files with 876 additions and 905 deletions

View file

@ -110,9 +110,9 @@ int openmc_simulation_init()
// Display header
if (mpi::master) {
if (settings::run_mode == RUN_MODE_FIXEDSOURCE) {
if (settings::run_mode == RunMode::FIXED_SOURCE) {
header("FIXED SOURCE TRANSPORT SIMULATION", 3);
} else if (settings::run_mode == RUN_MODE_EIGENVALUE) {
} else if (settings::run_mode == RunMode::EIGENVALUE) {
header("K EIGENVALUE SIMULATION", 3);
if (settings::verbosity >= 7) print_columns();
}
@ -272,7 +272,7 @@ void allocate_banks()
// Allocate source bank
simulation::source_bank.resize(simulation::work_per_rank);
if (settings::run_mode == RUN_MODE_EIGENVALUE) {
if (settings::run_mode == RunMode::EIGENVALUE) {
init_fission_bank(3*simulation::work_per_rank);
}
}
@ -282,7 +282,7 @@ void initialize_batch()
// Increment current batch
++simulation::current_batch;
if (settings::run_mode == RUN_MODE_FIXEDSOURCE) {
if (settings::run_mode == RunMode::FIXED_SOURCE) {
int b = simulation::current_batch;
write_message("Simulating batch " + std::to_string(b), 6);
}
@ -329,7 +329,7 @@ void finalize_batch()
simulation::n_realizations = 0;
}
if (settings::run_mode == RUN_MODE_EIGENVALUE) {
if (settings::run_mode == RunMode::EIGENVALUE) {
// Write batch output
if (mpi::master && settings::verbosity >= 7) print_batch_keff();
}
@ -373,7 +373,7 @@ void finalize_batch()
void initialize_generation()
{
if (settings::run_mode == RUN_MODE_EIGENVALUE) {
if (settings::run_mode == RunMode::EIGENVALUE) {
// Clear out the fission bank
simulation::fission_bank_length = 0;
@ -382,7 +382,7 @@ void initialize_generation()
// Store current value of tracklength k
simulation::keff_generation = simulation::global_tallies(
K_TRACKLENGTH, RESULT_VALUE);
GlobalTally::K_TRACKLENGTH, TallyResult::VALUE);
}
}
@ -391,22 +391,22 @@ void finalize_generation()
auto& gt = simulation::global_tallies;
// Update global tallies with the accumulation variables
if (settings::run_mode == RUN_MODE_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;
if (settings::run_mode == RunMode::EIGENVALUE) {
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 == RUN_MODE_EIGENVALUE) {
if (settings::run_mode == RunMode::EIGENVALUE) {
global_tally_collision = 0.0;
global_tally_absorption = 0.0;
global_tally_tracklength = 0.0;
}
global_tally_leakage = 0.0;
if (settings::run_mode == RUN_MODE_EIGENVALUE) {
if (settings::run_mode == RunMode::EIGENVALUE) {
// If using shared memory, stable sort the fission bank (by parent IDs)
// so as to allow for reproducibility regardless of which order particles
// are run in.
@ -429,7 +429,7 @@ void finalize_generation()
}
}
} else if (settings::run_mode == RUN_MODE_FIXEDSOURCE) {
} else if (settings::run_mode == RunMode::FIXED_SOURCE) {
// For fixed-source mode, we need to sample the external source
simulation::time_sample_source.start();
fill_source_bank_fixedsource();