]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a couple clang-tidy warnings 15282/head
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 30 May 2023 17:22:40 +0000 (13:22 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 30 May 2023 17:33:41 +0000 (13:33 -0400)
include/deal.II/matrix_free/hanging_nodes_internal.h
include/deal.II/optimization/line_minimization.h
include/deal.II/physics/notation.h
source/base/logstream.cc
source/base/qprojector.cc
source/hp/fe_collection.cc
source/non_matching/fe_values.cc
source/non_matching/quadrature_generator.cc

index a53ac8cea199239e9572217186357835084bdf0a..91853a0ca1a27d62f6d72b08f6b1f71da9da2a09 100644 (file)
@@ -436,10 +436,9 @@ namespace internal
             {
               const unsigned int line_idx = cell->line(line)->index();
               if (cell->is_active())
-                line_to_cells[line_idx].push_back(std::make_pair(cell, line));
+                line_to_cells[line_idx].emplace_back(cell, line);
               else
-                line_to_inactive_cells[line_idx].push_back(
-                  std::make_pair(cell, line));
+                line_to_inactive_cells[line_idx].emplace_back(cell, line);
             }
         }
 
index be571a27ab8a6441fcda122da803c60af10651d9..0d6e0f1944f3d3f75c62147950719208cfba668c 100644 (file)
@@ -480,12 +480,12 @@ namespace LineMinimization
 
   template <typename NumberType>
   NumberType
-  poly_fit_three_points(const NumberType                     x1,
-                        const NumberType                     f1,
-                        const NumberType                     g1,
-                        const NumberType                     x2,
-                        const NumberType                     f2,
-                        const NumberType                     g2,
+  poly_fit_three_points(const NumberType x1,
+                        const NumberType f1,
+                        const NumberType g1,
+                        const NumberType x2,
+                        const NumberType f2,
+                        const NumberType /*g2*/,
                         const FiniteSizeHistory<NumberType> &x_rec,
                         const FiniteSizeHistory<NumberType> &f_rec,
                         const FiniteSizeHistory<NumberType> & /*g_rec*/,
index 28d09f74b3f7b6edfed49249d90400498307ec4c..13f3cc9612e36aeaa6e43e1d9029455b47d792f8 100644 (file)
@@ -677,7 +677,7 @@ namespace Physics
 
         template <int dim>
         std::pair<unsigned int, unsigned int>
-        indices_from_component(const unsigned int component_n, const bool)
+        indices_from_component(const unsigned int /*component_n*/, const bool)
         {
           AssertThrow(false, ExcNotImplemented());
           return std::make_pair(0u, 0u);
index 3d612366be04a02b3bc025bf3cdfbb235be606f6..99ce2c7a81348688e50880969819c3828a9e68b0 100644 (file)
@@ -81,7 +81,7 @@ LogStream::LogStream()
   , print_thread_id(false)
   , at_newline(true)
 {
-  get_prefixes().push("DEAL:");
+  get_prefixes().emplace("DEAL:");
 }
 
 
index e96aed68ecf1650b576cd4592d80e83ef4200bed..115534e5f738ea1086ef0ba2c127ec20ed6f7332 100644 (file)
@@ -845,8 +845,8 @@ QProjector<2>::project_to_all_faces(const ReferenceCell &     reference_cell,
   else
     {
       AssertDimension(quadrature.size(), GeometryInfo<dim>::faces_per_cell);
-      for (unsigned int i = 0; i < quadrature.size(); ++i)
-        n_points_total += quadrature[i].size();
+      for (const auto &q : quadrature)
+        n_points_total += q.size();
     }
 
   // first fix quadrature points
@@ -1011,8 +1011,8 @@ QProjector<3>::project_to_all_faces(const ReferenceCell &     reference_cell,
       else
         {
           AssertDimension(quadrature.size(), GeometryInfo<dim>::faces_per_cell);
-          for (unsigned int i = 0; i < quadrature.size(); ++i)
-            n_points_total += quadrature[i].size();
+          for (const auto &q : quadrature)
+            n_points_total += q.size();
         }
 
       n_points_total *= 8;
index 5a45fdd2348b58563aa2407d7c2e84d66356d448..3bdc25982fd8810a886adb804612d94e0267f145 100644 (file)
@@ -388,8 +388,8 @@ namespace hp
           if (fe_index_1 != fe_index_2)
             for (const auto &identity :
                  query_identities(fe_index_1, fe_index_2))
-              identities_graph.emplace(Edge(Node(fe_index_1, identity.first),
-                                            Node(fe_index_2, identity.second)));
+              identities_graph.emplace(Node(fe_index_1, identity.first),
+                                       Node(fe_index_2, identity.second));
 
 #ifdef DEBUG
       // Now verify that indeed the graph is symmetric: If one element
index 5c8afb299be043025a03edf5ab8d819c47bc7c96..d89d075fb889db2bd8ddaec50692740fca5651e5 100644 (file)
@@ -66,8 +66,8 @@ namespace NonMatching
     // Tensor products of each quadrature in q_collection_1d. Used on the
     // non-intersected cells.
     hp::QCollection<dim> q_collection;
-    for (unsigned int i = 0; i < q_collection_1D.size(); ++i)
-      q_collection.push_back(Quadrature<dim>(q_collection_1D[i]));
+    for (const auto &quadrature : q_collection_1D)
+      q_collection.push_back(Quadrature<dim>(quadrature));
 
     initialize(q_collection);
   }
@@ -292,8 +292,8 @@ namespace NonMatching
     // Tensor products of each quadrature in q_collection_1d. Used on the
     // non-intersected cells.
     hp::QCollection<dim - 1> q_collection;
-    for (unsigned int i = 0; i < q_collection_1D.size(); ++i)
-      q_collection.push_back(Quadrature<dim - 1>(q_collection_1D[i]));
+    for (const auto &quadrature : q_collection_1D)
+      q_collection.push_back(quadrature);
 
     initialize(q_collection);
   }
index 195cdeb81857b61f5d5e67ab90026e4208909364..463b7caa53f75c01c4c1ab23567fdae7c68ca268 100644 (file)
@@ -861,8 +861,8 @@ namespace NonMatching
         , low_dim_algorithm(q_collection1D, additional_data)
         , up_through_dimension_creator(q_collection1D, additional_data)
       {
-        for (unsigned int i = 0; i < q_collection1D.size(); ++i)
-          tensor_products.push_back(Quadrature<dim>(q_collection1D[i]));
+        for (const auto &quadrature : q_collection1D)
+          tensor_products.push_back(quadrature);
       }
 
 

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.