Merge pull request #1368 from paulromano/entropy-without-dimension

Make sure Shannon entropy mesh without dimension can be assigned
This commit is contained in:
shikhar413 2019-10-01 13:03:27 -04:00 committed by GitHub
commit a4818ba921
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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