]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move functions into an anonymous namespace to take them out of the public library... 11648/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 28 Jan 2021 21:28:47 +0000 (14:28 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 28 Jan 2021 21:28:47 +0000 (14:28 -0700)
source/base/qprojector.cc

index 6a12d014d0b22a86131114360cfe3f9763a59bac..46420af2299eeada9c4fe00d79a231976f51931e 100644 (file)
@@ -27,52 +27,55 @@ namespace internal
 {
   namespace QProjector
   {
-    Quadrature<2>
-    reflect(const Quadrature<2> &q)
+    namespace
     {
-      // Take the points and reflect them by the diagonal
-      std::vector<Point<2>> q_points(q.get_points());
-      for (Point<2> &p : q_points)
-        std::swap(p[0], p[1]);
+      Quadrature<2>
+      reflect(const Quadrature<2> &q)
+      {
+        // Take the points and reflect them by the diagonal
+        std::vector<Point<2>> q_points(q.get_points());
+        for (Point<2> &p : q_points)
+          std::swap(p[0], p[1]);
 
-      return Quadrature<2>(q_points, q.get_weights());
-    }
+        return Quadrature<2>(q_points, q.get_weights());
+      }
 
 
-    Quadrature<2>
-    rotate(const Quadrature<2> &q, const unsigned int n_times)
-    {
-      std::vector<Point<2>> q_points(q.size());
-      for (unsigned int i = 0; i < q.size(); ++i)
-        {
-          switch (n_times % 4)
-            {
-              case 0:
-                // 0 degree. the point remains as it is.
-                q_points[i] = q.point(i);
-                break;
+      Quadrature<2>
+      rotate(const Quadrature<2> &q, const unsigned int n_times)
+      {
+        std::vector<Point<2>> q_points(q.size());
+        for (unsigned int i = 0; i < q.size(); ++i)
+          {
+            switch (n_times % 4)
+              {
+                case 0:
+                  // 0 degree. the point remains as it is.
+                  q_points[i] = q.point(i);
+                  break;
 
-              case 1:
-                // 90 degree counterclockwise
-                q_points[i][0] = 1.0 - q.point(i)[1];
-                q_points[i][1] = q.point(i)[0];
-                break;
-              case 2:
-                // 180 degree counterclockwise
-                q_points[i][0] = 1.0 - q.point(i)[0];
-                q_points[i][1] = 1.0 - q.point(i)[1];
-                break;
-              case 3:
-                // 270 degree counterclockwise
-                q_points[i][0] = q.point(i)[1];
-                q_points[i][1] = 1.0 - q.point(i)[0];
-                break;
-            }
-        }
+                case 1:
+                  // 90 degree counterclockwise
+                  q_points[i][0] = 1.0 - q.point(i)[1];
+                  q_points[i][1] = q.point(i)[0];
+                  break;
+                case 2:
+                  // 180 degree counterclockwise
+                  q_points[i][0] = 1.0 - q.point(i)[0];
+                  q_points[i][1] = 1.0 - q.point(i)[1];
+                  break;
+                case 3:
+                  // 270 degree counterclockwise
+                  q_points[i][0] = q.point(i)[1];
+                  q_points[i][1] = 1.0 - q.point(i)[0];
+                  break;
+              }
+          }
 
-      return Quadrature<2>(q_points, q.get_weights());
-    }
-  } // namespace QProjector
+        return Quadrature<2>(q_points, q.get_weights());
+      }
+    } // namespace
+  }   // namespace QProjector
 } // namespace internal
 
 

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.