From 81aa653d506bf3e9f9288679c8e92a6f21b6ad46 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 3 Nov 2022 21:22:41 -0500 Subject: [PATCH] Factoring out some common lines between reader functions --- include/openmc/initialize.h | 1 + src/initialize.cpp | 22 ++++++---------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/include/openmc/initialize.h b/include/openmc/initialize.h index 47474c986b..d3d12d45df 100644 --- a/include/openmc/initialize.h +++ b/include/openmc/initialize.h @@ -13,6 +13,7 @@ void initialize_mpi(MPI_Comm intracomm); #endif bool read_model_xml(); void read_input_xml(); +void initial_output(); } // namespace openmc diff --git a/src/initialize.cpp b/src/initialize.cpp index 254ad88da5..aa3e15efa9 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -108,6 +108,9 @@ int openmc_init(int argc, char* argv[], const void* intracomm) // Read XML input files read_input_xml(); + // Write some initial output under the header if needed + initial_output(); + // Check for particle restart run if (settings::particle_restart_run) settings::run_mode = RunMode::PARTICLE; @@ -365,22 +368,6 @@ bool read_model_xml() { if (check_for_node(root, "plots")) read_plots_xml(root.child("plots")); - if (settings::run_mode == RunMode::PLOTTING) { - // Read plots.xml if it exists - if (mpi::master && settings::verbosity >= 5) - print_plot(); - - } else { - // Write summary information - if (mpi::master && settings::output_summary) - write_summary(); - - // Warn if overlap checking is on - if (mpi::master && settings::check_overlaps) { - warning("Cell overlap checking is ON."); - } - } - return true; } @@ -408,7 +395,10 @@ void read_input_xml() // Read the plots.xml regardless of plot mode in case plots are requested // via the API read_plots_xml(); +} +void initial_output() { + // handle some final output if (settings::run_mode == RunMode::PLOTTING) { // Read plots.xml if it exists if (mpi::master && settings::verbosity >= 5)