Make sure Shannon entropy mesh without dimension can be assigned

This commit is contained in:
Paul Romano 2019-10-01 10:31:29 -05:00
parent ae1209e283
commit 9a78836d22
2 changed files with 4 additions and 2 deletions

View file

@ -155,7 +155,8 @@ RegularMesh::RegularMesh(pugi::xml_node node)
fatal_error("Must specify either <upper_right> and <width> on a mesh.");
}
if (shape_.dimension() > 0) {
// TODO: Change to zero when xtensor is updated
if (shape_.size() > 1) {
if (shape_.size() != lower_left_.size()) {
fatal_error("Number of entries on <lower_left> must be the same "
"as the number of entries on <dimension>.");

View file

@ -512,7 +512,8 @@ void read_settings_xml()
if (!m) fatal_error("Only regular meshes can be used as an entropy mesh");
simulation::entropy_mesh = m;
if (m->shape_.dimension() == 0) {
// TODO: Change to zero when xtensor is updated
if (m->shape_.size() == 1) {
// If the user did not specify how many mesh cells are to be used in
// each direction, we automatically determine an appropriate number of
// cells