]> https://gitweb.dealii.org/ - dealii.git/commitdiff
clang-tidy performance findings 5936/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 20 Feb 2018 23:58:02 +0000 (00:58 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 21 Feb 2018 16:23:55 +0000 (17:23 +0100)
examples/step-49/step-49.cc
include/deal.II/base/work_stream.h
include/deal.II/fe/fe_tools.templates.h
include/deal.II/lac/full_matrix.templates.h
include/deal.II/numerics/vector_tools.templates.h
source/fe/fe_dgq.cc
source/fe/fe_q_base.cc
source/grid/tria.cc

index dd977db64fe36d27b0885addcf704285055c084e..35f41ab85da9d0444040d7058cb6d6f5b1c0879e 100644 (file)
@@ -82,7 +82,7 @@ void print_mesh_info(const Triangulation<dim> &triangulation,
       }
 
     std::cout << " boundary indicators: ";
-    for (const std::pair<types::boundary_id, unsigned int> &pair : boundary_count)
+    for (const std::pair<const types::boundary_id, unsigned int> &pair : boundary_count)
       {
         std::cout << pair.first << "(" << pair.second << " times) ";
       }
index 7b846307646941b840cd147029ba6266b25c01c4..994dc1eb338bf2ecd8b864e48104268177769be2 100644 (file)
@@ -1021,7 +1021,7 @@ namespace WorkStream
       {
         // need to copy the sample since it is marked const
         ScratchData scratch_data = sample_scratch_data;
-        CopyData    copy_data    = sample_copy_data;
+        CopyData    copy_data    = sample_copy_data; // NOLINT
 
         for (Iterator i=begin; i!=end; ++i)
           {
@@ -1127,7 +1127,7 @@ namespace WorkStream
       {
         // need to copy the sample since it is marked const
         ScratchData scratch_data = sample_scratch_data;
-        CopyData    copy_data    = sample_copy_data;
+        CopyData    copy_data    = sample_copy_data; // NOLINT
 
         for (unsigned int color=0; color<colored_iterators.size(); ++color)
           for (typename std::vector<Iterator>::const_iterator p = colored_iterators[color].begin();
index 9286a882b2d5ce57e8a534f80b01b6a3bfbc33dd..0a5a3c87877c62d0595f8f80c61073a60b2ee6f6 100644 (file)
@@ -2403,6 +2403,7 @@ namespace FETools
             // this is a workaround since the constructor for FESystem
             // only accepts raw pointers.
             std::vector<const FiniteElement<dim,spacedim> *> raw_base_fes;
+            raw_base_fes.reserve(base_fes.size());
             for (const auto &base_fe: base_fes)
               raw_base_fes.push_back(base_fe.get());
 
index bedb3aa375dd11f69804ad452749bad2376393af..b511693b1f7672881e4d588a70b03940ccba6e42 100644 (file)
@@ -1319,7 +1319,7 @@ FullMatrix<number>::invert (const FullMatrix<number2> &M)
     {
       // avoid overwriting source
       // by destination matrix:
-      const FullMatrix<number2> M2 = M;
+      const FullMatrix<number2> M2 = M; // NOLINT
       invert(M2);
     }
   else
@@ -1490,7 +1490,7 @@ FullMatrix<number>::cholesky (const FullMatrix<number2> &A)
     {
       // avoid overwriting source
       // by destination matrix:
-      const FullMatrix<number2> A2 = A;
+      const FullMatrix<number2> A2 = A; // NOLINT
       cholesky(A2);
     }
   else
index 6d38fa3dcbfbb0f0362f580f3a207307fb29976f..18c5b755fbb1328b932d89007f8c142d8df20f5f 100644 (file)
@@ -2530,7 +2530,7 @@ namespace VectorTools
           // now that we have a q_collection object with all the right quadrature
           // points, create an hp::FEFaceValues object that we can use to evaluate
           // the boundary values at
-          const dealii::hp::MappingCollection<dim,spacedim> mapping_collection (mapping);
+          const dealii::hp::MappingCollection<dim,spacedim> mapping_collection (mapping); // NOLINT
           dealii::hp::FEFaceValues<dim,spacedim> x_fe_values (mapping_collection,
                                                               finite_elements,
                                                               q_collection,
index 341f3f741c6371a31daede855cd8345e479f930c..9abded35b875acf05b024c1ab8a2601507a03409 100644 (file)
@@ -698,8 +698,7 @@ FE_DGQArbitraryNodes<dim,spacedim>::FE_DGQArbitraryNodes (const Quadrature<1> &p
 {
   Assert (points.size() > 0,
           (typename FiniteElement<dim, spacedim>::ExcFEHasNoSupportPoints ()));
-  const Quadrature<dim> support_quadrature(points);
-  this->unit_support_points = support_quadrature.get_points();
+  this->unit_support_points = Quadrature<dim>(points).get_points();
 }
 
 
index 4040f6b8d0d541b10ce6184fdece1fa891d4cc96..5e435325e3b8dee6bf7aa5ce52729de11d3af8e6 100644 (file)
@@ -909,10 +909,10 @@ void FE_Q_Base<PolynomialType,dim,spacedim>::initialize_unit_support_points
     this->poly_space.get_numbering_inverse();
 
   Quadrature<1> support_1d(points);
-  const Quadrature<dim> support_quadrature(support_1d);
+  const Quadrature<dim> support_quadrature(support_1d); // NOLINT
   this->unit_support_points.resize(support_quadrature.size());
 
-  for (unsigned int k=0; k<support_quadrature.size(); k++)
+  for (unsigned int k=0; k<support_quadrature.size(); ++k)
     this->unit_support_points[index_map_inverse[k]] = support_quadrature.point(k);
 }
 
@@ -933,10 +933,10 @@ void FE_Q_Base<PolynomialType,dim,spacedim>::initialize_unit_face_support_points
   std::vector<unsigned int> face_index_map =
     internal::FE_Q_Base::face_lexicographic_to_hierarchic_numbering<dim>(q_degree);
   Quadrature<1> support_1d(points);
-  const Quadrature<codim> support_quadrature(support_1d);
+  const Quadrature<codim> support_quadrature(support_1d); // NOLINT
   this->unit_face_support_points.resize(support_quadrature.size());
 
-  for (unsigned int k=0; k<support_quadrature.size(); k++)
+  for (unsigned int k=0; k<support_quadrature.size(); ++k)
     this->unit_face_support_points[face_index_map[k]] = support_quadrature.point(k);
 }
 
index a4ea89f37aba07b0d4f5117c9175df74d48a11a3..fc7b9aa812ee3287b59b050ec74b8fd2c91b4a47 100644 (file)
@@ -9204,8 +9204,8 @@ create_triangulation_compatibility (const std::vector<Point<spacedim> > &v,
                                     const std::vector<CellData<dim> >   &cells,
                                     const SubCellData                   &subcelldata)
 {
-  std::vector<CellData<dim> > reordered_cells (cells);
-  SubCellData                 reordered_subcelldata (subcelldata);
+  std::vector<CellData<dim> > reordered_cells (cells); // NOLINT
+  SubCellData                 reordered_subcelldata (subcelldata); // NOLINT
 
   // in-place reordering of data
   reorder_compatibility (reordered_cells, reordered_subcelldata);

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.