Move check for consistent shape/lower_left on regular mesh

This commit is contained in:
Paul Romano 2020-11-10 21:43:13 -06:00
parent 4b21307128
commit d05bf7789d

View file

@ -550,6 +550,12 @@ RegularMesh::RegularMesh(pugi::xml_node node)
fatal_error("Must specify <lower_left> on a mesh.");
}
// Make sure lower_left and dimension match
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>.");
}
if (check_for_node(node, "width")) {
// Make sure both upper-right or width were specified
if (check_for_node(node, "upper_right")) {
@ -595,12 +601,6 @@ RegularMesh::RegularMesh(pugi::xml_node node)
fatal_error("Must specify either <upper_right> and <width> on a mesh.");
}
// Make sure lower_left and dimension match
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>.");
}
// Set volume fraction
volume_frac_ = 1.0/xt::prod(shape_)();
}