Skip to content
Snippets Groups Projects
Commit 53b1798c authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Improve error message when a zone is not found

parent aa5ae1f2
No related branches found
No related tags found
1 merge request!138Fix a g++-9 warning
...@@ -26,7 +26,17 @@ getMeshCellZone(const Mesh<Connectivity<Dimension>>& mesh, const IZoneDescriptor ...@@ -26,7 +26,17 @@ getMeshCellZone(const Mesh<Connectivity<Dimension>>& mesh, const IZoneDescriptor
} }
std::ostringstream ost; std::ostringstream ost;
ost << "cannot find zone with name " << rang::fgB::red << zone_descriptor << rang::style::reset; ost << "cannot find zone with name " << rang::fgB::red << zone_descriptor << rang::style::reset << '\n';
ost << "The mesh contains " << mesh.connectivity().template numberOfRefItemList<ItemType::cell>() << " zones: ";
for (size_t i_ref_cell_list = 0; i_ref_cell_list < mesh.connectivity().template numberOfRefItemList<ItemType::cell>();
++i_ref_cell_list) {
const auto& ref_cell_list = mesh.connectivity().template refItemList<ItemType::cell>(i_ref_cell_list);
const RefId& ref = ref_cell_list.refId();
if (i_ref_cell_list > 0) {
ost << ", ";
}
ost << rang::fgB::yellow << ref << rang::style::reset;
}
throw NormalError(ost.str()); throw NormalError(ost.str());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment