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

Improve error messages to display available item sets

parent 040fbf1c
No related branches found
No related tags found
1 merge request!140Change referenced item list policy
...@@ -9,9 +9,6 @@ MeshCellZone<Dimension>::MeshCellZone(const Mesh<Connectivity<Dimension>>&, cons ...@@ -9,9 +9,6 @@ MeshCellZone<Dimension>::MeshCellZone(const Mesh<Connectivity<Dimension>>&, cons
: m_cell_list(ref_cell_list.list()), m_zone_name(ref_cell_list.refId().tagName()) : m_cell_list(ref_cell_list.list()), m_zone_name(ref_cell_list.refId().tagName())
{} {}
template MeshCellZone<2>::MeshCellZone(const Mesh<Connectivity<2>>&, const RefCellList&);
template MeshCellZone<3>::MeshCellZone(const Mesh<Connectivity<3>>&, const RefCellList&);
template <size_t Dimension> template <size_t Dimension>
MeshCellZone<Dimension> MeshCellZone<Dimension>
getMeshCellZone(const Mesh<Connectivity<Dimension>>& mesh, const IZoneDescriptor& zone_descriptor) getMeshCellZone(const Mesh<Connectivity<Dimension>>& mesh, const IZoneDescriptor& zone_descriptor)
...@@ -26,8 +23,8 @@ getMeshCellZone(const Mesh<Connectivity<Dimension>>& mesh, const IZoneDescriptor ...@@ -26,8 +23,8 @@ 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 << '\n'; ost << "cannot find cell set with name " << rang::fgB::red << zone_descriptor << rang::style::reset << '\n';
ost << "The mesh contains " << mesh.connectivity().template numberOfRefItemList<ItemType::cell>() << " zones: "; ost << "The mesh contains " << mesh.connectivity().template numberOfRefItemList<ItemType::cell>() << " cell sets: ";
for (size_t i_ref_cell_list = 0; i_ref_cell_list < mesh.connectivity().template numberOfRefItemList<ItemType::cell>(); for (size_t i_ref_cell_list = 0; i_ref_cell_list < mesh.connectivity().template numberOfRefItemList<ItemType::cell>();
++i_ref_cell_list) { ++i_ref_cell_list) {
const auto& ref_cell_list = mesh.connectivity().template refItemList<ItemType::cell>(i_ref_cell_list); const auto& ref_cell_list = mesh.connectivity().template refItemList<ItemType::cell>(i_ref_cell_list);
......
...@@ -20,10 +20,22 @@ getMeshFlatFaceBoundary(const Mesh<Connectivity<Dimension>>& mesh, const IBounda ...@@ -20,10 +20,22 @@ getMeshFlatFaceBoundary(const Mesh<Connectivity<Dimension>>& mesh, const IBounda
} }
std::ostringstream ost; std::ostringstream ost;
ost << "cannot find surface with name " << rang::fgB::red << boundary_descriptor << rang::style::reset; ost << "cannot find face list with name " << rang::fgB::red << boundary_descriptor << rang::style::reset << '\n';
ost << "The mesh contains " << mesh.connectivity().template numberOfRefItemList<ItemType::face>()
<< " referenced face lists: ";
for (size_t i_ref_face_list = 0; i_ref_face_list < mesh.connectivity().template numberOfRefItemList<ItemType::face>();
++i_ref_face_list) {
const auto& ref_face_list = mesh.connectivity().template refItemList<ItemType::face>(i_ref_face_list);
const RefId& ref = ref_face_list.refId();
if (i_ref_face_list > 0) {
ost << ", ";
}
ost << rang::fgB::yellow << ref << rang::style::reset;
}
throw NormalError(ost.str()); throw NormalError(ost.str());
} }
template MeshFlatFaceBoundary<1> getMeshFlatFaceBoundary(const Mesh<Connectivity<1>>&, const IBoundaryDescriptor&);
template MeshFlatFaceBoundary<2> getMeshFlatFaceBoundary(const Mesh<Connectivity<2>>&, const IBoundaryDescriptor&); template MeshFlatFaceBoundary<2> getMeshFlatFaceBoundary(const Mesh<Connectivity<2>>&, const IBoundaryDescriptor&);
template MeshFlatFaceBoundary<3> getMeshFlatFaceBoundary(const Mesh<Connectivity<3>>&, const IBoundaryDescriptor&); template MeshFlatFaceBoundary<3> getMeshFlatFaceBoundary(const Mesh<Connectivity<3>>&, const IBoundaryDescriptor&);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment