From: Wolfgang Bangerth Date: Thu, 9 Feb 2023 23:55:15 +0000 (-0700) Subject: Use functionality in ReferenceCell. X-Git-Tag: v9.5.0-rc1~412^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14975%2Fhead;p=dealii.git Use functionality in ReferenceCell. --- diff --git a/source/base/qprojector.cc b/source/base/qprojector.cc index b79b62542e..20f588eb81 100644 --- a/source/base/qprojector.cc +++ b/source/base/qprojector.cc @@ -749,67 +749,21 @@ QProjector<3>::project_to_all_faces(const ReferenceCell & reference_cell, return Quadrature<3>(points, weights); }; - if (reference_cell == ReferenceCells::Tetrahedron) + if ((reference_cell == ReferenceCells::Tetrahedron) || + (reference_cell == ReferenceCells::Wedge) || + (reference_cell == ReferenceCells::Pyramid)) { - const std::vector>> face_vertex_locations = { - {{Point<3>(0.0, 0.0, 0.0), - Point<3>(1.0, 0.0, 0.0), - Point<3>(0.0, 1.0, 0.0)}}, - {{Point<3>(1.0, 0.0, 0.0), - Point<3>(0.0, 0.0, 0.0), - Point<3>(0.0, 0.0, 1.0)}}, - {{Point<3>(0.0, 0.0, 0.0), - Point<3>(0.0, 1.0, 0.0), - Point<3>(0.0, 0.0, 1.0)}}, - {{Point<3>(0.0, 1.0, 0.0), - Point<3>(1.0, 0.0, 0.0), - Point<3>(0.0, 0.0, 1.0)}}}; - - return process(face_vertex_locations); - } - else if (reference_cell == ReferenceCells::Wedge) - { - const std::vector>> face_vertex_locations = { - {{Point<3>(1.0, 0.0, 0.0), - Point<3>(0.0, 0.0, 0.0), - Point<3>(0.0, 1.0, 0.0)}}, - {{Point<3>(0.0, 0.0, 1.0), - Point<3>(1.0, 0.0, 1.0), - Point<3>(0.0, 1.0, 1.0)}}, - {{Point<3>(0.0, 0.0, 0.0), - Point<3>(1.0, 0.0, 0.0), - Point<3>(0.0, 0.0, 1.0), - Point<3>(1.0, 0.0, 1.0)}}, - {{Point<3>(1.0, 0.0, 0.0), - Point<3>(0.0, 1.0, 0.0), - Point<3>(1.0, 0.0, 1.0), - Point<3>(0.0, 1.0, 1.0)}}, - {{Point<3>(0.0, 1.0, 0.0), - Point<3>(0.0, 0.0, 0.0), - Point<3>(0.0, 1.0, 1.0), - Point<3>(0.0, 0.0, 1.0)}}}; - - return process(face_vertex_locations); - } - else if (reference_cell == ReferenceCells::Pyramid) - { - const std::vector>> face_vertex_locations = { - {{Point<3>(-1.0, -1.0, 0.0), - Point<3>(+1.0, -1.0, 0.0), - Point<3>(-1.0, +1.0, 0.0), - Point<3>(+1.0, +1.0, 0.0)}}, - {{Point<3>(-1.0, -1.0, 0.0), - Point<3>(-1.0, +1.0, 0.0), - Point<3>(+0.0, +0.0, 1.0)}}, - {{Point<3>(+1.0, +1.0, 0.0), - Point<3>(+1.0, -1.0, 0.0), - Point<3>(+0.0, +0.0, 1.0)}}, - {{Point<3>(+1.0, -1.0, 0.0), - Point<3>(-1.0, -1.0, 0.0), - Point<3>(+0.0, +0.0, 1.0)}}, - {{Point<3>(-1.0, +1.0, 0.0), - Point<3>(+1.0, +1.0, 0.0), - Point<3>(+0.0, +0.0, 1.0)}}}; + std::vector>> face_vertex_locations( + reference_cell.n_faces()); + for (unsigned int f : reference_cell.face_indices()) + { + face_vertex_locations[f].resize( + reference_cell.face_reference_cell(f).n_vertices()); + for (unsigned int v : + reference_cell.face_reference_cell(f).vertex_indices()) + face_vertex_locations[f][v] = + reference_cell.face_vertex_location<3>(f, v); + } return process(face_vertex_locations); }