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); }