From: Wolfgang Bangerth Date: Sat, 18 Jun 2022 01:38:33 +0000 (+0900) Subject: Can't use ReferenceCells in switch-case. X-Git-Tag: v9.4.0-rc2~4^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e11d9394fbf53eb1a92d36bd6fc67603e8ee1ec;p=dealii.git Can't use ReferenceCells in switch-case. --- diff --git a/source/cgal/surface_mesh.cc b/source/cgal/surface_mesh.cc index c4f0befdb9..da6fe521a6 100644 --- a/source/cgal/surface_mesh.cc +++ b/source/cgal/surface_mesh.cc @@ -34,27 +34,28 @@ namespace const auto reference_cell_type = face->reference_cell(); std::vector indices; - switch (reference_cell_type) + if (reference_cell_type == ReferenceCells::Line) { - case ReferenceCells::Line: - mesh.add_edge(deal2cgal.at(face->vertex_index(0)), - deal2cgal.at(face->vertex_index(1))); - break; - case ReferenceCells::Triangle: - indices = {deal2cgal.at(face->vertex_index(0)), - deal2cgal.at(face->vertex_index(1)), - deal2cgal.at(face->vertex_index(2))}; - break; - case ReferenceCells::Quadrilateral: - indices = {deal2cgal.at(face->vertex_index(0)), - deal2cgal.at(face->vertex_index(1)), - deal2cgal.at(face->vertex_index(3)), - deal2cgal.at(face->vertex_index(2))}; - break; - default: - Assert(false, ExcInternalError()); - break; + mesh.add_edge(deal2cgal.at(face->vertex_index(0)), + deal2cgal.at(face->vertex_index(1))); } + else if (reference_cell_type == ReferenceCells::Triangle) + { + indices = {deal2cgal.at(face->vertex_index(0)), + deal2cgal.at(face->vertex_index(1)), + deal2cgal.at(face->vertex_index(2))}; + } + + else if (reference_cell_type == ReferenceCells::Quadrilateral) + { + indices = {deal2cgal.at(face->vertex_index(0)), + deal2cgal.at(face->vertex_index(1)), + deal2cgal.at(face->vertex_index(3)), + deal2cgal.at(face->vertex_index(2))}; + } + else + Assert(false, ExcInternalError()); + if (clockwise_ordering == true) std::reverse(indices.begin(), indices.end());