From 87f9a495ef12d911d1ada29dcc1953f5fffb7028 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 18 Dec 2019 18:25:00 -0600 Subject: [PATCH] Write files using a tally-based filename to support multiple tallies at once. --- include/openmc/mesh.h | 2 +- src/mesh.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 7c4a2dbdd0..647ed23413 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -513,7 +513,7 @@ public: void set_variable(const std::string& var_name, int bin, double value); - void write() const; + void write(const std::string& filename) const; void to_hdf5(hid_t group) const; diff --git a/src/mesh.cpp b/src/mesh.cpp index 26e8ed1f28..19b27e1cf4 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -2155,12 +2155,10 @@ LibMesh::set_variable(const std::string& var_name, int bin, double value) { (*eqn_sys.solution).set(dof_indices[0], value); } -void LibMesh::write() const { +void LibMesh::write(const std::string& filename) const { libMesh::ExodusII_IO exo(*m_); std::set systems_out = {eq_system_name_}; - std::stringstream output_filename; - output_filename << "umesh_" << id_ << ".exo"; - exo.write_discontinuous_exodusII(output_filename.str(), *equation_systems_, &systems_out); + exo.write_discontinuous_exodusII(filename, *equation_systems_, &systems_out); }