From 3347aeaa032ffa4668e6d149e5400d9d16dd2d7e Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 21 Oct 2022 07:07:44 -0500 Subject: [PATCH] Fixes related to #2253 and #2270 --- include/openmc/constants.h | 5 ----- src/output.cpp | 7 ++++--- src/volume_calc.cpp | 11 +++++------ 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/include/openmc/constants.h b/include/openmc/constants.h index 8bb2cb1bf..a1cc2939c 100644 --- a/include/openmc/constants.h +++ b/include/openmc/constants.h @@ -340,11 +340,6 @@ enum class RunMode { enum class GeometryType { CSG, DAG }; -//============================================================================== -// Volume Calculation Constants - -constexpr uint64_t UINT64_T_MAX {std::numeric_limits::max()}; - } // namespace openmc #endif // OPENMC_CONSTANTS_H diff --git a/src/output.cpp b/src/output.cpp index 59cb15712..18efed656 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -1,8 +1,8 @@ #include "openmc/output.h" #include // for transform, max -#include // for strlen #include // for stdout +#include // for strlen #include // for time, localtime #include #include // for setw, setprecision, put_time @@ -134,9 +134,10 @@ void header(const char* msg, int level) auto out = header(msg); // Print header based on verbosity level. - if (settings::verbosity >= level) + if (settings::verbosity >= level) { fmt::print("\n{}\n\n", out); std::fflush(stdout); + } } //============================================================================== @@ -396,7 +397,7 @@ void print_build_info() fmt::print("DAGMC support: {}\n", dagmc); fmt::print("libMesh support: {}\n", libmesh); fmt::print("Coverage testing: {}\n", coverage); - fmt::print("Profiling flags: {}\n", profiling); + fmt::print("Profiling flags: {}\n", profiling); } } diff --git a/src/volume_calc.cpp b/src/volume_calc.cpp index e36b88904..0b1ea3575 100644 --- a/src/volume_calc.cpp +++ b/src/volume_calc.cpp @@ -225,12 +225,11 @@ vector VolumeCalculation::execute() const iterations++; uint64_t total_samples = iterations * n_samples_; - // warn user if total sample size is greater than what the size_t type can + // warn user if total sample size is greater than what the uin64_t type can // represent - if (total_samples == UINT64_T_MAX) { + if (total_samples == std::numeric_limits::max()) { warning("The number of samples has exceeded the type used to track hits. " - "Volume " - "results may be inaccurate."); + "Volume results may be inaccurate."); } // reset @@ -246,8 +245,8 @@ vector VolumeCalculation::execute() const // Create 2D array to store atoms/uncertainty for each nuclide. Later this // is compressed into vectors storing only those nuclides that are // non-zero - auto n_nuc = settings::run_CE ? data::nuclides.size() - : data::mg.nuclides_.size(); + auto n_nuc = + settings::run_CE ? data::nuclides.size() : data::mg.nuclides_.size(); xt::xtensor atoms({n_nuc, 2}, 0.0); #ifdef OPENMC_MPI