Use templated write_message in a few more places

From review suggestions

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Andrew Johnson 2020-08-06 08:19:03 -04:00 committed by GitHub
parent 4de893043e
commit f1b7cd7938
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View file

@ -944,7 +944,7 @@ extern "C" int openmc_load_nuclide(const char* name, const double* temps, int n)
// Get filename for library containing nuclide
int idx = it->second;
const auto& filename = data::libraries[idx].path_;
write_message(6, "Reading {} from {}", std::string{name}, filename);
write_message(6, "Reading {} from {}", name, filename);
// Open file and make sure version is sufficient
hid_t file_id = file_open(filename, 'r');

View file

@ -410,7 +410,7 @@ Particle::cross_surface()
// TODO: off-by-one
const auto& surf {model::surfaces[i_surface - 1].get()};
if (settings::verbosity >= 10 || trace_) {
write_message(fmt::format(" Crossing surface {}", surf->id_));
write_message(" Crossing surface {}", surf->id_);
}
if (surf->bc_ == Surface::BoundaryType::VACUUM && (settings::run_mode != RunMode::PLOTTING)) {
@ -437,7 +437,7 @@ Particle::cross_surface()
// Display message
if (settings::verbosity >= 10 || trace_) {
write_message(fmt::format(" Leaked out of surface {}", surf->id_));
write_message(" Leaked out of surface {}", surf->id_);
}
return;
@ -502,7 +502,7 @@ Particle::cross_surface()
// Diagnostic message
if (settings::verbosity >= 10 || trace_) {
write_message(fmt::format(" Reflected from surface {}", surf->id_));
write_message(" Reflected from surface {}", surf->id_);
}
return;
@ -556,8 +556,7 @@ Particle::cross_surface()
// Diagnostic message
if (settings::verbosity >= 10 || trace_) {
write_message(fmt::format(" Hit periodic boundary on surface {}",
surf->id_));
write_message(" Hit periodic boundary on surface {}", surf->id_);
}
return;
}

View file

@ -501,7 +501,7 @@ void initialize_history(Particle& p, int64_t index_source)
// Display message if high verbosity or trace is on
if (settings::verbosity >= 9 || p.trace_) {
write_message(fmt::format("Simulating Particle {}", p.id_));
write_message("Simulating Particle {}", p.id_);
}
// Add paricle's starting weight to count for normalizing tallies later