diff --git a/src/mesh/MeshCellZone.cpp b/src/mesh/MeshCellZone.cpp index 5b9128155783dae1a48b31116dbb5a0c4f3d5d3f..ac63998b6edc658f39b9b9a1a11cf72f3bcf1c0a 100644 --- a/src/mesh/MeshCellZone.cpp +++ b/src/mesh/MeshCellZone.cpp @@ -23,17 +23,7 @@ getMeshCellZone(const Mesh<Connectivity<Dimension>>& mesh, const IZoneDescriptor } std::ostringstream ost; - 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>() << " cell sets: "; - 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; - } + ost << "cannot find cell set with name \"" << rang::fgB::red << zone_descriptor << rang::style::reset << '\"'; throw NormalError(ost.str()); } diff --git a/src/mesh/MeshFaceBoundary.cpp b/src/mesh/MeshFaceBoundary.cpp index 5423ad639b43f8c5a7eb5d3094ecb294543b2c26..f061ed646355a76fe846546c1564efb07253123e 100644 --- a/src/mesh/MeshFaceBoundary.cpp +++ b/src/mesh/MeshFaceBoundary.cpp @@ -36,18 +36,7 @@ getMeshFaceBoundary(const Mesh<Connectivity<Dimension>>& mesh, const IBoundaryDe } std::ostringstream ost; - 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; - } + ost << "cannot find face list with name " << rang::fgB::red << boundary_descriptor << rang::style::reset; throw NormalError(ost.str()); } diff --git a/src/mesh/MeshFlatFaceBoundary.cpp b/src/mesh/MeshFlatFaceBoundary.cpp index 5759fe9e5097b59130f3579b147d46528928b1f3..cb7740c6736f507e5b3ff12b4baa93789349ca8a 100644 --- a/src/mesh/MeshFlatFaceBoundary.cpp +++ b/src/mesh/MeshFlatFaceBoundary.cpp @@ -20,18 +20,7 @@ getMeshFlatFaceBoundary(const Mesh<Connectivity<Dimension>>& mesh, const IBounda } std::ostringstream ost; - 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; - } + ost << "cannot find face list with name \"" << rang::fgB::red << boundary_descriptor << rang::style::reset << "\""; throw NormalError(ost.str()); } diff --git a/src/mesh/MeshNodeBoundary.cpp b/src/mesh/MeshNodeBoundary.cpp index 6c18637a09baddb9241b95033e729ad644259f5c..b992fc77b9cb947545e5d60f8687ee987b3b4675 100644 --- a/src/mesh/MeshNodeBoundary.cpp +++ b/src/mesh/MeshNodeBoundary.cpp @@ -176,8 +176,8 @@ MeshNodeBoundary<Dimension>::MeshNodeBoundary(const Mesh<Connectivity<Dimension> const Array<const FaceId>& face_list = ref_face_list.list(); if (not ref_face_list.isBoundary()) { std::ostringstream ost; - ost << "invalid boundary " << rang::fgB::yellow << this->m_boundary_name << rang::style::reset - << ": inner faces cannot be used to define mesh boundaries"; + ost << "invalid boundary \"" << rang::fgB::yellow << this->m_boundary_name << rang::style::reset + << "\": inner faces cannot be used to define mesh boundaries"; throw NormalError(ost.str()); } @@ -224,8 +224,8 @@ MeshNodeBoundary<Dimension>::MeshNodeBoundary(const Mesh<Connectivity<Dimension> const Array<const EdgeId>& edge_list = ref_edge_list.list(); if (not ref_edge_list.isBoundary()) { std::ostringstream ost; - ost << "invalid boundary " << rang::fgB::yellow << this->m_boundary_name << rang::style::reset - << ": inner edges cannot be used to define mesh boundaries"; + ost << "invalid boundary \"" << rang::fgB::yellow << this->m_boundary_name << rang::style::reset + << "\": inner edges cannot be used to define mesh boundaries"; throw NormalError(ost.str()); } @@ -269,8 +269,8 @@ MeshNodeBoundary<Dimension>::MeshNodeBoundary(const Mesh<Connectivity<Dimension> { if (not ref_node_list.isBoundary()) { std::ostringstream ost; - ost << "invalid boundary " << rang::fgB::yellow << this->m_boundary_name << rang::style::reset - << ": inner nodes cannot be used to define mesh boundaries"; + ost << "invalid boundary \"" << rang::fgB::yellow << this->m_boundary_name << rang::style::reset + << "\": inner nodes cannot be used to define mesh boundaries"; throw NormalError(ost.str()); } } @@ -317,7 +317,7 @@ getMeshNodeBoundary(const Mesh<Connectivity<Dimension>>& mesh, const IBoundaryDe } std::ostringstream ost; - ost << "cannot find surface with name " << rang::fgB::red << boundary_descriptor << rang::style::reset; + ost << "cannot find node list with name " << rang::fgB::red << boundary_descriptor << rang::style::reset; throw NormalError(ost.str()); } diff --git a/tests/test_MeshFaceBoundary.cpp b/tests/test_MeshFaceBoundary.cpp index 3ab99dcd35d2b90dfc632810504574a6cc95b4b1..472427aaf0c7f9c85f566dd610020e91759aad84 100644 --- a/tests/test_MeshFaceBoundary.cpp +++ b/tests/test_MeshFaceBoundary.cpp @@ -275,9 +275,7 @@ TEST_CASE("MeshFaceBoundary", "[mesh]") NamedBoundaryDescriptor named_boundary_descriptor("invalid_boundary"); REQUIRE_THROWS_WITH(getMeshFaceBoundary(mesh, named_boundary_descriptor), - "error: cannot find face list with name \"invalid_boundary\"\nThe mesh contains 8 referenced " - "face lists: XMIN(22), XMAX(23), ZMAX(24), ZMIN(25), YMAX(26), YMIN(27), INTERFACE1(55), " - "INTERFACE2(56)"); + "error: cannot find face list with name \"invalid_boundary\""); } SECTION("surface is inside") diff --git a/tests/test_MeshFlatFaceBoundary.cpp b/tests/test_MeshFlatFaceBoundary.cpp index ffd81828ed6251e30778f25ae70e03ae1bd0b174..446c9b478b5048109ee39d71449c44169ca461eb 100644 --- a/tests/test_MeshFlatFaceBoundary.cpp +++ b/tests/test_MeshFlatFaceBoundary.cpp @@ -976,7 +976,7 @@ TEST_CASE("MeshFlatFaceBoundary", "[mesh]") { NumberedBoundaryDescriptor numbered_boundary_descriptor(3); REQUIRE_THROWS_WITH(getMeshFlatFaceBoundary(mesh, numbered_boundary_descriptor), - "error: invalid boundary YMAX: boundary is not flat!"); + "error: invalid boundary \"YMAX\": boundary is not flat!"); } } @@ -1009,7 +1009,7 @@ TEST_CASE("MeshFlatFaceBoundary", "[mesh]") { NamedBoundaryDescriptor named_boundary_descriptor("YMAX"); REQUIRE_THROWS_WITH(getMeshFlatFaceBoundary(mesh, named_boundary_descriptor), - "error: invalid boundary YMAX: boundary is not flat!"); + "error: invalid boundary \"YMAX\": boundary is not flat!"); } } } @@ -1084,13 +1084,13 @@ TEST_CASE("MeshFlatFaceBoundary", "[mesh]") { NumberedBoundaryDescriptor numbered_boundary_descriptor(3); REQUIRE_THROWS_WITH(getMeshFlatFaceBoundary(mesh, numbered_boundary_descriptor), - "error: invalid boundary YMAX: boundary is not flat!"); + "error: invalid boundary \"YMAX\": boundary is not flat!"); } { NumberedBoundaryDescriptor numbered_boundary_descriptor(5); REQUIRE_THROWS_WITH(getMeshFlatFaceBoundary(mesh, numbered_boundary_descriptor), - "error: invalid boundary ZMAX: boundary is not flat!"); + "error: invalid boundary \"ZMAX\": boundary is not flat!"); } } @@ -1125,13 +1125,13 @@ TEST_CASE("MeshFlatFaceBoundary", "[mesh]") { NamedBoundaryDescriptor named_boundary_descriptor("YMAX"); REQUIRE_THROWS_WITH(getMeshFlatFaceBoundary(mesh, named_boundary_descriptor), - "error: invalid boundary YMAX: boundary is not flat!"); + "error: invalid boundary \"YMAX\": boundary is not flat!"); } { NamedBoundaryDescriptor named_boundary_descriptor("ZMAX"); REQUIRE_THROWS_WITH(getMeshFlatFaceBoundary(mesh, named_boundary_descriptor), - "error: invalid boundary ZMAX: boundary is not flat!"); + "error: invalid boundary \"ZMAX\": boundary is not flat!"); } } } @@ -1195,13 +1195,13 @@ TEST_CASE("MeshFlatFaceBoundary", "[mesh]") { NumberedBoundaryDescriptor numbered_boundary_descriptor(24); REQUIRE_THROWS_WITH(getMeshFlatFaceBoundary(mesh, numbered_boundary_descriptor), - "error: invalid boundary ZMAX: boundary is not flat!"); + "error: invalid boundary \"ZMAX\": boundary is not flat!"); } { NumberedBoundaryDescriptor numbered_boundary_descriptor(26); REQUIRE_THROWS_WITH(getMeshFlatFaceBoundary(mesh, numbered_boundary_descriptor), - "error: invalid boundary YMAX: boundary is not flat!"); + "error: invalid boundary \"YMAX\": boundary is not flat!"); } } @@ -1236,13 +1236,13 @@ TEST_CASE("MeshFlatFaceBoundary", "[mesh]") { NamedBoundaryDescriptor named_boundary_descriptor("YMAX"); REQUIRE_THROWS_WITH(getMeshFlatFaceBoundary(mesh, named_boundary_descriptor), - "error: invalid boundary YMAX: boundary is not flat!"); + "error: invalid boundary \"YMAX\": boundary is not flat!"); } { NamedBoundaryDescriptor named_boundary_descriptor("ZMAX"); REQUIRE_THROWS_WITH(getMeshFlatFaceBoundary(mesh, named_boundary_descriptor), - "error: invalid boundary ZMAX: boundary is not flat!"); + "error: invalid boundary \"ZMAX\": boundary is not flat!"); } } }