Skip to content

Commit 0316003

Browse files
committed
Error messages for bad sidesets in Exodus files
1 parent 09b0b49 commit 0316003

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

src/mesh/exodusII_io.C

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,11 @@ void ExodusII_IO::read (const std::string & fname)
699699
int mapped_shellface = raw_side_index;
700700

701701
// Check for errors
702-
libmesh_error_msg_if(mapped_shellface == ExodusII_IO_Helper::Conversion::invalid_id,
703-
"Invalid 1-based side id: "
702+
libmesh_error_msg_if(mapped_shellface < 0 || mapped_shellface >= 2,
703+
"Bad 0-based shellface id: "
704704
<< mapped_shellface
705-
<< " detected for "
706-
<< Utility::enum_to_string(elem.type()));
705+
<< " detected in Exodus file "
706+
<< exio_helper->current_filename);
707707

708708
// Add this (elem,shellface,id) triplet to the BoundaryInfo object.
709709
mesh.get_boundary_info().add_shellface (libmesh_elem_id,
@@ -720,7 +720,18 @@ void ExodusII_IO::read (const std::string & fname)
720720
"Invalid 1-based side id: "
721721
<< side_index
722722
<< " detected for "
723-
<< Utility::enum_to_string(elem.type()));
723+
<< Utility::enum_to_string(elem.type())
724+
<< " in Exodus file "
725+
<< exio_helper->current_filename);
726+
727+
libmesh_error_msg_if(mapped_side < 0 ||
728+
cast_int<unsigned int>(mapped_side) >= elem.n_sides(),
729+
"Bad 0-based side id: "
730+
<< mapped_side
731+
<< " detected for "
732+
<< Utility::enum_to_string(elem.type())
733+
<< " in Exodus file "
734+
<< exio_helper->current_filename);
724735

725736
// Add this (elem,side,id) triplet to the BoundaryInfo object.
726737
mesh.get_boundary_info().add_side (libmesh_elem_id,

0 commit comments

Comments
 (0)