]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Some code clean-ups. 18157/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 21 Feb 2025 19:04:35 +0000 (12:04 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 21 Feb 2025 19:04:35 +0000 (12:04 -0700)
source/fe/mapping_q.cc
source/grid/tria_accessor.cc

index 40e4b358a191f6a9539aa117eac6204e879854be..6b00d4aa191ce478af234720198e03cd637343e5 100644 (file)
@@ -1702,8 +1702,8 @@ MappingQ<2, 3>::add_quad_support_points(
   for (unsigned int q = 0, q2 = 0; q2 < polynomial_degree - 1; ++q2)
     for (unsigned int q1 = 0; q1 < polynomial_degree - 1; ++q1, ++q)
       {
-        Point<2> point(line_support_points[q1 + 1][0],
-                       line_support_points[q2 + 1][0]);
+        const Point<2> point(line_support_points[q1 + 1][0],
+                             line_support_points[q2 + 1][0]);
         for (const unsigned int i : GeometryInfo<2>::vertex_indices())
           weights(q, i) = GeometryInfo<2>::d_linear_shape_function(point, i);
       }
index c7378ccfdc924d3bb4eccee1a5086b03068a2862..e15de30584daed69e2081cea22ab3a999dfb8175 100644 (file)
@@ -1411,30 +1411,6 @@ namespace
   }
 
 
-  template <int dim, int spacedim>
-  Point<spacedim>
-  get_new_point_on_object(const TriaAccessor<1, dim, spacedim> &obj)
-  {
-    TriaIterator<TriaAccessor<1, dim, spacedim>> it(obj);
-    return obj.get_manifold().get_new_point_on_line(it);
-  }
-
-  template <int dim, int spacedim>
-  Point<spacedim>
-  get_new_point_on_object(const TriaAccessor<2, dim, spacedim> &obj)
-  {
-    TriaIterator<TriaAccessor<2, dim, spacedim>> it(obj);
-    return obj.get_manifold().get_new_point_on_quad(it);
-  }
-
-  template <int dim, int spacedim>
-  Point<spacedim>
-  get_new_point_on_object(const TriaAccessor<3, dim, spacedim> &obj)
-  {
-    TriaIterator<TriaAccessor<3, dim, spacedim>> it(obj);
-    return obj.get_manifold().get_new_point_on_hex(it);
-  }
-
   template <int structdim, int dim, int spacedim>
   Point<spacedim>
   get_new_point_on_object(const TriaAccessor<structdim, dim, spacedim> &obj,
@@ -1442,7 +1418,7 @@ namespace
   {
     if (use_interpolation)
       {
-        TriaRawIterator<TriaAccessor<structdim, dim, spacedim>> it(obj);
+        const TriaRawIterator<TriaAccessor<structdim, dim, spacedim>> it(obj);
         const auto points_and_weights =
           Manifolds::get_default_points_and_weights(it, use_interpolation);
         return obj.get_manifold().get_new_point(
@@ -1453,7 +1429,17 @@ namespace
       }
     else
       {
-        return get_new_point_on_object(obj);
+        const TriaIterator<TriaAccessor<structdim, dim, spacedim>> it(obj);
+        if constexpr (structdim == 1)
+          return obj.get_manifold().get_new_point_on_line(it);
+        else if constexpr (structdim == 2)
+          return obj.get_manifold().get_new_point_on_quad(it);
+        else if constexpr (structdim == 3)
+          return obj.get_manifold().get_new_point_on_hex(it);
+        else
+          DEAL_II_ASSERT_UNREACHABLE();
+
+        return {};
       }
   }
 } // namespace

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.