]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Get rid of two lambda functions by combining their action using ReferenceCell.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 9 Feb 2023 01:10:01 +0000 (18:10 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 24 Mar 2023 20:43:27 +0000 (14:43 -0600)
source/base/qprojector.cc

index e7b59b3427a1b9427979b5edb94d4ef58b4c8ba3..35d43fb58b5d48b0c56bad4935f210ec75afd6ac 100644 (file)
@@ -643,24 +643,6 @@ Quadrature<3>
 QProjector<3>::project_to_all_faces(const ReferenceCell &     reference_cell,
                                     const hp::QCollection<2> &quadrature)
 {
-  const auto support_points_tri =
-    [](const std::vector<Point<3>> &face,
-       const unsigned char          orientation) -> std::vector<Point<3>> {
-    const boost::container::small_vector<Point<3>, 8> temp =
-      ReferenceCells::Triangle.permute_by_combined_orientation<Point<3>>(
-        face, orientation);
-    return std::vector<Point<3>>(temp.begin(), temp.end());
-  };
-
-  const auto support_points_quad =
-    [](const std::vector<Point<3>> &face,
-       const unsigned char          orientation) -> std::vector<Point<3>> {
-    const boost::container::small_vector<Point<3>, 8> temp =
-      ReferenceCells::Quadrilateral.permute_by_combined_orientation<Point<3>>(
-        face, orientation);
-    return std::vector<Point<3>>(temp.begin(), temp.end());
-  };
-
   const auto process = [&](const std::vector<std::vector<Point<3>>> &faces) {
     // new (projected) quadrature points and weights
     std::vector<Point<3>> points;
@@ -691,10 +673,9 @@ QProjector<3>::project_to_all_faces(const ReferenceCell &     reference_cell,
           {
             const auto &face = faces[face_no];
 
-            const auto support_points =
-              n_linear_shape_functions == 3 ?
-                support_points_tri(face, orientation) :
-                support_points_quad(face, orientation);
+            const boost::container::small_vector<Point<3>, 8> support_points =
+              reference_cell.face_reference_cell(face_no)
+                .permute_by_combined_orientation<Point<3>>(face, orientation);
 
             // the quadrature rule to be projected ...
             const auto &sub_quadrature_points =

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.