From 727cbbf65737cda69465f4cd71cd13503dde46c0 Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Mon, 20 Apr 2026 11:37:46 -0500 Subject: [PATCH 1/2] Fix get_info()/print_info() on unprepared meshes These are const methods, so we can't update caches on the fly, but we can note that the cached data may be outdated rather than failing assertions in the queries. --- src/mesh/mesh_base.C | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/mesh/mesh_base.C b/src/mesh/mesh_base.C index ceb6db0c0a..b1012daad7 100644 --- a/src/mesh/mesh_base.C +++ b/src/mesh/mesh_base.C @@ -1285,7 +1285,10 @@ std::string MeshBase::get_info(const unsigned int verbosity /* = 0 */, const boo --_elem_dims.end(), // --end() is valid if the set is non-empty std::ostream_iterator(oss, ", ")); oss << cast_int(*_elem_dims.rbegin()); - oss << "}\n"; + oss << "}"; + if (!this->preparation().has_cached_elem_data) + oss << " (may be out of date)"; + oss << '\n'; } if (!_elem_default_orders.empty()) @@ -1297,12 +1300,23 @@ std::string MeshBase::get_info(const unsigned int verbosity /* = 0 */, const boo [](Order o) { return Utility::enum_to_string(o); }); oss << Utility::enum_to_string(*_elem_default_orders.rbegin()); - oss << "}\n"; + oss << "}"; + if (!this->preparation().has_cached_elem_data) + oss << " (may be out of date)"; + oss << '\n'; } - oss << " supported_nodal_order()=" << this->supported_nodal_order() << '\n' - << " spatial_dimension()=" << this->spatial_dimension() << '\n' - << " n_nodes()=" << this->n_nodes() << '\n' + oss << " supported_nodal_order()=" << this->_supported_nodal_order; + if (!this->preparation().has_cached_elem_data) + oss << " (may be out of date)"; + oss << '\n'; + + oss << " spatial_dimension()=" << this->_spatial_dimension; + if (!this->preparation().has_cached_elem_data) + oss << " (may be out of date)"; + oss << '\n'; + + oss << " n_nodes()=" << this->n_nodes() << '\n' << " n_local_nodes()=" << this->n_local_nodes() << '\n' << " n_elem()=" << this->n_elem() << '\n' << " n_local_elem()=" << this->n_local_elem() << '\n'; From e5bcbe48793b0b0b170c13ea623883a38f401115 Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Mon, 20 Apr 2026 11:47:21 -0500 Subject: [PATCH 2/2] Don't print an integer as a non-ASCII char! This was a pre-existing bug but we just never noticed it... --- src/mesh/mesh_base.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/mesh_base.C b/src/mesh/mesh_base.C index b1012daad7..bb0be0dee2 100644 --- a/src/mesh/mesh_base.C +++ b/src/mesh/mesh_base.C @@ -1311,7 +1311,7 @@ std::string MeshBase::get_info(const unsigned int verbosity /* = 0 */, const boo oss << " (may be out of date)"; oss << '\n'; - oss << " spatial_dimension()=" << this->_spatial_dimension; + oss << " spatial_dimension()=" << int(this->_spatial_dimension); if (!this->preparation().has_cached_elem_data) oss << " (may be out of date)"; oss << '\n';