]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Merge pull request #11424 from peterrum/compute_orientation
authorDavid Wells <drwells@email.unc.edu>
Tue, 29 Dec 2020 22:19:24 +0000 (17:19 -0500)
committerGitHub <noreply@github.com>
Tue, 29 Dec 2020 22:19:24 +0000 (17:19 -0500)
Introduce ReferenceCell::compute_orientation and ::permute_according_orientation

1  2 
include/deal.II/grid/reference_cell.h
source/base/qprojector.cc

Simple merge
index 3a33573303f5b165e916473b572e99d6486f9363,62604c078a5f1538e58bbb107f60b8160a6546b9..cdcef09bcd2540c75298da0d73b0cf8426a03a5e
@@@ -669,31 -657,17 +657,17 @@@ QProjector<3>::project_to_all_faces
  
    const auto support_points_quad =
      [](const auto &face, const auto &orientation) -> std::vector<Point<3>> {
-     switch (orientation)
-       {
-         case 1:
-           return {{face.first[0], face.first[1], face.first[2], face.first[3]}};
-         case 3:
-           return {{face.first[1], face.first[3], face.first[0], face.first[2]}};
-         case 5:
-           return {{face.first[3], face.first[2], face.first[1], face.first[0]}};
-         case 7:
-           return {{face.first[2], face.first[0], face.first[3], face.first[1]}};
-         case 0:
-           return {{face.first[0], face.first[2], face.first[1], face.first[3]}};
-         case 2:
-           return {{face.first[2], face.first[3], face.first[0], face.first[1]}};
-         case 4:
-           return {{face.first[3], face.first[1], face.first[2], face.first[0]}};
-         case 6:
-           return {{face.first[1], face.first[0], face.first[3], face.first[2]}};
-         default:
-           Assert(false, ExcNotImplemented());
-           return {{}};
-       }
+     std::array<Point<3>, 4> vertices;
+     std::copy_n(face.first.begin(), face.first.size(), vertices.begin());
+     const auto temp =
+       ReferenceCell::permute_according_orientation(ReferenceCell::Type::Quad,
+                                                    vertices,
+                                                    orientation);
+     return std::vector<Point<3>>(temp.begin(),
+                                  temp.begin() + face.first.size());
    };
  
 -  const auto process = [&](const auto faces) {
 +  const auto process = [&](const auto &faces) {
      // new (projected) quadrature points and weights
      std::vector<Point<3>> points;
      std::vector<double>   weights;

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.