diff --git a/include/openmc/output.h b/include/openmc/output.h index 6207e2eda..6d6d6ba0f 100644 --- a/include/openmc/output.h +++ b/include/openmc/output.h @@ -19,8 +19,9 @@ void header(const char* msg, int level); //============================================================================== -//! Retrieve a time stamp with the format "yyyy-mm-dd hh:mm:ss" +//! Retrieve a time stamp //! +//! \return current time stamp (format: "yyyy-mm-dd hh:mm:ss") //============================================================================== std::string time_stamp(); diff --git a/include/openmc/plot.h b/include/openmc/plot.h index 3cd81d5b4..8b5e6c19a 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -1,7 +1,7 @@ #ifndef OPENMC_PLOT_H #define OPENMC_PLOT_H -#include +#include #include #include "xtensor/xarray.hpp" @@ -24,7 +24,7 @@ constexpr int BLUE = 2; extern int PLOT_LEVEL_LOWEST; //!< lower bound on plot universe level -extern std::map plot_map; //!< map of plot ids to index +extern std::unordered_map plot_map; //!< map of plot ids to index extern "C" int32_t n_plots; //!< number of plots in openmc run diff --git a/src/plot.cpp b/src/plot.cpp index ab8db4e00..ae14ea9df 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -24,7 +24,7 @@ namespace openmc { int PLOT_LEVEL_LOWEST = -1; -std::map plot_map; +std::unordered_map plot_map; int n_plots; diff --git a/src/progress_bar.cpp b/src/progress_bar.cpp index 444dfa5ed..f412793c9 100644 --- a/src/progress_bar.cpp +++ b/src/progress_bar.cpp @@ -48,18 +48,19 @@ ProgressBar::set_value(double val) { } bar.append("% |"); - // remaining width of the bar - int remain = BAR_WIDTH - bar.size() - 2; + int remaining_width = BAR_WIDTH - bar.size() - 2; // set the bar width if (val >= 100.0) { - bar.append(remain, '='); + bar.append(remaining_width, '='); + } else if (val < 0.0) { + bar.append(remaining_width, ' '); } else { - int width = (int)((double)remain*val/100); + int width = (int)((double)remaining_width*val/100); bar.append(width, '='); bar.append(1, '>'); - bar.append(remain-width-1, ' '); + bar.append(remaining_width-width-1, ' '); } bar.append("|+");