From 2ecd6446df64ff657ef8715b9f710486d6ad9878 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 8 Nov 2019 17:50:22 -0600 Subject: [PATCH] Avoid error in Shannon entropy mesh doesn't have dimension specified --- scripts/openmc-update-inputs | 2 +- src/mesh.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/openmc-update-inputs b/scripts/openmc-update-inputs index 0d25b5b974..3b4e9a3595 100755 --- a/scripts/openmc-update-inputs +++ b/scripts/openmc-update-inputs @@ -298,4 +298,4 @@ if __name__ == '__main__': move(fname, fname + '.original') # Write a new geometry file. - tree.write(fname) + tree.write(fname, xml_declaration=True) diff --git a/src/mesh.cpp b/src/mesh.cpp index 590df53e17..915679dd3d 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -149,8 +149,10 @@ RegularMesh::RegularMesh(pugi::xml_node node) "the coordinates on a tally mesh."); } - // Set width and upper right coordinate - width_ = xt::eval((upper_right_ - lower_left_) / shape_); + // Set width + if (shape_.size() > 0) { + width_ = xt::eval((upper_right_ - lower_left_) / shape_); + } } else { fatal_error("Must specify either and on a mesh."); }