]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a couple complaints
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 10 Jan 2023 03:55:44 +0000 (22:55 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 10 Jan 2023 03:55:44 +0000 (22:55 -0500)
15 files changed:
examples/step-18/step-18.cc
examples/step-68/step-68.cc
examples/step-69/step-69.cc
examples/step-70/step-70.cc
include/deal.II/fe/fe_tools_extrapolate.templates.h
include/deal.II/lac/affine_constraints.templates.h
include/deal.II/lac/sparse_mic.h
include/deal.II/lac/sparse_mic.templates.h
include/deal.II/matrix_free/constraint_info.h
include/deal.II/matrix_free/matrix_free.templates.h
include/deal.II/numerics/vector_tools_constraints.templates.h
source/lac/petsc_parallel_block_sparse_matrix.cc
source/lac/petsc_parallel_sparse_matrix.cc
source/lac/petsc_precondition.cc
source/lac/trilinos_sparsity_pattern.cc

index 3a1b65cac065fada39f8af659602355edea52a14..d10a7da413a205f1e4b6722d2a049a0560b078c6 100644 (file)
@@ -1265,8 +1265,7 @@ namespace Step18
         // times_and_names is declared static, so it will retain the entries
         // from the previous timesteps.
         static std::vector<std::pair<double, std::string>> times_and_names;
-        times_and_names.push_back(
-          std::pair<double, std::string>(present_time, pvtu_filename));
+        times_and_names.emplace_back(present_time, pvtu_filename);
         std::ofstream pvd_output("solution.pvd");
         DataOutBase::write_pvd_record(pvd_output, times_and_names);
       }
index d96ccb40320389280530984a325bfce4a984706e..7d0e031dbb6a8743573d59f157506106eebcbaa7 100644 (file)
@@ -615,7 +615,7 @@ namespace Step68
     Particles::DataOut<dim, dim> particle_output;
 
     std::vector<std::string> solution_names(dim, "velocity");
-    solution_names.push_back("process_id");
+    solution_names.emplace_back("process_id");
 
     std::vector<DataComponentInterpretation::DataComponentInterpretation>
       data_component_interpretation(
index f3d6dc2783a81e12a1f96448a1c1bdcf569fb2b8..e4a28b3c58b33893e0072a11ce81a79291066ad3 100644 (file)
@@ -1639,7 +1639,7 @@ namespace Step69
     /* We wire up the slot InitialValues<dim>::parse_parameters_callback to
        the ParameterAcceptor::parse_parameters_call_back signal: */
     ParameterAcceptor::parse_parameters_call_back.connect(
-      std::bind(&InitialValues<dim>::parse_parameters_callback, this));
+      [&]() { this->parse_parameters_callback(); });
 
     initial_direction[0] = 1.;
     add_parameter("initial direction",
index 879e5c164173d4bb9636a4b9f9d61c215c9d0aea..d2e6be3fc181408f13fe575479907394a6c08cf3 100644 (file)
@@ -1721,7 +1721,7 @@ namespace Step70
                                    mpi_communicator);
 
     static std::vector<std::pair<double, std::string>> times_and_names;
-    times_and_names.push_back(std::make_pair(time, filename));
+    times_and_names.emplace_back(time, filename);
     std::ofstream ofile(par.output_directory + "/" + "solution.pvd");
     DataOutBase::write_pvd_record(ofile, times_and_names);
   }
@@ -1939,7 +1939,7 @@ int main(int argc, char *argv[])
           StokesImmersedProblem<2, 3> problem(par);
           problem.run();
         }
-      else if (prm_file.find("3") != std::string::npos)
+      else if (prm_file.find('3') != std::string::npos)
         {
           StokesImmersedProblemParameters<3> par;
           ParameterAcceptor::initialize(prm_file);
index f7dec56da680d45992a785f53d30412b352a4f7d..9bf3e705df193fac2d3bffbfc34ed31cd950af19 100644 (file)
@@ -1128,6 +1128,7 @@ namespace FETools
       // the same process, so we have to only look at the unique set of
       // destinations:
       std::vector<types::subdomain_id> destinations;
+      destinations.reserve(cells_to_send.size());
       for (const auto &cell : cells_to_send)
         destinations.emplace_back(cell.receiver);
       std::sort(destinations.begin(), destinations.end());
index 9b2c26cf730bcbee2a5655e3ad84a2a9b84acf2d..e922a97d3710140828aa39da28625b2051617f69 100644 (file)
@@ -137,6 +137,7 @@ AffineConstraints<number>::is_consistent_in_parallel(
   // We will send all locally active dofs that are not locally owned for
   // checking. Note that we allow constraints to differ on locally_relevant (and
   // not active) DoFs.
+  // NOLINTNEXTLINE(performance-unnecessary-copy-initialization)
   IndexSet non_owned = locally_active_dofs;
   non_owned.subtract_set(locally_owned_dofs[myid]);
   for (unsigned int owner = 0; owner < nproc; ++owner)
index 8c3ba26fc7ea7c46340d3558f8a5775359ba4f68..35cf1500dff05edcc7d4535f011bf876c4a21603 100644 (file)
@@ -55,7 +55,7 @@ public:
    * Constructor. Does nothing, so you have to call @p decompose sometimes
    * afterwards.
    */
-  SparseMIC();
+  SparseMIC() = default;
 
   /**
    * Destructor.
index 666fd27304aa18ead584916c11d9718a4963bf3e..8fb32907f4d72fc9cc96a8875f7bb6c37414d0f6 100644 (file)
 
 DEAL_II_NAMESPACE_OPEN
 
-template <typename number>
-SparseMIC<number>::SparseMIC()
-  : diag(0)
-  , inv_diag(0)
-  , inner_sums(0)
-{}
-
-
-
 template <typename number>
 SparseMIC<number>::~SparseMIC()
 {
index 194afa3ebeaad2fb9542e9377ce57b69fa367a76..6bf150d581121c33943c67c59a5d725b72a4be27 100644 (file)
@@ -182,6 +182,7 @@ namespace internal
 
     // ------------------------- inline functions --------------------------
 
+    // NOLINTNEXTLINE(modernize-use-equals-default)
     template <typename Number>
     ConstraintValues<Number>::ConstraintValues()
       : constraints(FloatingPointComparator<Number>(
index f5c1baf106cb522cb2b05bcdf46d55c9328f2a1e..f2a8ce2f856d36b498b385f707643991abe8ca0f 100644 (file)
@@ -516,6 +516,7 @@ MatrixFree<dim, Number, VectorizedArrayType>::internal_reinit(
       task_info.create_blocks_serial(
         dummy, 1, false, dummy, false, dummy, dummy, dummy2);
 
+      // NOLINTNEXTLINE(modernize-loop-convert)
       for (unsigned int i = 0; i < dof_info.size(); ++i)
         {
           Assert(dof_handler[i]->get_fe_collection().size() == 1,
index 35f6e84b42b47bb5ece1b0a3ec8ab2c97cbc3484..e1361b519563c46804323eaf67f38635732e915a 100644 (file)
@@ -520,8 +520,7 @@ namespace VectorTools
       hp::FEFaceValues<dim, spacedim> &   x_fe_face_values,
       const IndexSet &                    refinement_edge_indices,
       const unsigned int                  level,
-      std::map<internal::FaceDoFInfo, std::array<unsigned int, dim>>
-        &dof_to_vector_dof)
+      std::map<FaceDoFInfo, std::array<unsigned int, dim>> &dof_to_vector_dof)
     {
       std::set<types::boundary_id>::iterator b_id;
       for (const unsigned int face_no : cell->face_indices())
@@ -556,8 +555,8 @@ namespace VectorTools
                   if (level == numbers::invalid_unsigned_int ||
                       !refinement_edge_indices.is_element(face_dofs[i]))
                     {
-                      local_vector_indices[0]                         = i;
-                      const internal::FaceDoFInfo local_face_dof_info = {
+                      local_vector_indices[0]               = i;
+                      const FaceDoFInfo local_face_dof_info = {
                         {cell->active_fe_index(), face_no, i}};
                       for (unsigned int k = 0; k < fe.n_dofs_per_face(face_no);
                            ++k)
@@ -603,26 +602,23 @@ namespace VectorTools
       const IndexSet &                 refinement_edge_indices,
       const unsigned int               level,
       std::multimap<
-        internal::VectorDoFTuple<dim>,
+        VectorDoFTuple<dim>,
         std::pair<Tensor<1, dim>,
                   typename DoFHandler<dim, spacedim>::cell_iterator>>
-        &dof_to_normals_map,
-      std::map<internal::VectorDoFTuple<dim>, Vector<double>>
-        &dof_vector_to_b_values)
+        &                                            dof_to_normals_map,
+      std::map<VectorDoFTuple<dim>, Vector<double>> &dof_vector_to_b_values)
     {
       // mapping from (active_fe_index, face_no and local
       // dof index) to dim vector indices of the same
       // supporting point.
-      std::map<internal::FaceDoFInfo, std::array<unsigned int, dim>>
-        dof_to_vector_dof;
-      internal::map_face_dof_to_vector_dof<dim, spacedim>(
-        cell,
-        first_vector_component,
-        boundary_ids,
-        x_fe_face_values,
-        refinement_edge_indices,
-        level,
-        dof_to_vector_dof);
+      std::map<FaceDoFInfo, std::array<unsigned int, dim>> dof_to_vector_dof;
+      map_face_dof_to_vector_dof<dim, spacedim>(cell,
+                                                first_vector_component,
+                                                boundary_ids,
+                                                x_fe_face_values,
+                                                refinement_edge_indices,
+                                                level,
+                                                dof_to_vector_dof);
 
 
       std::set<types::boundary_id>::iterator b_id;
@@ -660,7 +656,7 @@ namespace VectorTools
                 if (level == numbers::invalid_unsigned_int ||
                     !refinement_edge_indices.is_element(face_dofs[i]))
                   {
-                    const internal::FaceDoFInfo face_dof_info = {
+                    const FaceDoFInfo face_dof_info = {
                       {cell->active_fe_index(), face_no, i}};
                     const auto it = dof_to_vector_dof.find(face_dof_info);
                     Assert(it != dof_to_vector_dof.end(), ExcInternalError());
@@ -673,7 +669,7 @@ namespace VectorTools
                         "Error: the finite element does not have enough components "
                         "to define a normal direction."));
 
-                    internal::VectorDoFTuple<dim> vector_dofs;
+                    VectorDoFTuple<dim> vector_dofs;
                     for (unsigned int d = 0; d < dim; ++d)
                       {
                         vector_dofs.dof_indices[d] =
@@ -845,11 +841,10 @@ namespace VectorTools
       // directions* we find). consequently, we also have to store which cell a
       // normal vector was computed on
       using DoFToNormalsMap = std::multimap<
-        internal::VectorDoFTuple<dim>,
+        VectorDoFTuple<dim>,
         std::pair<Tensor<1, dim>,
                   typename DoFHandler<dim, spacedim>::cell_iterator>>;
-      std::map<internal::VectorDoFTuple<dim>, Vector<double>>
-        dof_vector_to_b_values;
+      std::map<VectorDoFTuple<dim>, Vector<double>> dof_vector_to_b_values;
 
       DoFToNormalsMap dof_to_normals_map;
 
@@ -861,7 +856,7 @@ namespace VectorTools
           for (const auto &cell : dof_handler.active_cell_iterators())
             if (!cell->is_artificial())
               {
-                internal::map_dofs_to_normal_vectors_and_normal_fluxes(
+                map_dofs_to_normal_vectors_and_normal_fluxes(
                   cell,
                   first_vector_component,
                   boundary_ids,
@@ -882,7 +877,7 @@ namespace VectorTools
                   numbers::artificial_subdomain_id &&
                 cell->level_subdomain_id() != numbers::invalid_subdomain_id)
               {
-                internal::map_dofs_to_normal_vectors_and_normal_fluxes(
+                map_dofs_to_normal_vectors_and_normal_fluxes(
                   cell,
                   first_vector_component,
                   boundary_ids,
index a290cfb602bc1cc7b9032b2aba699e769a384440..bee092b4f08597003ed232535909bbcfe61d54de 100644 (file)
@@ -130,9 +130,9 @@ namespace PETScWrappers
           psub_objects[r * n + c] = this->sub_objects[r][c]->petsc_matrix();
       ierr = MatCreateNest(get_mpi_communicator(),
                            m,
-                           NULL,
+                           nullptr,
                            n,
-                           NULL,
+                           nullptr,
                            psub_objects.data(),
                            &petsc_nest_matrix);
       AssertThrow(ierr == 0, ExcPETScError(ierr));
index 7bbd637180cc6d5e6511998dc6d9f000599e5b61..8ecfb7e40f4403ff1031328bd4afaa32f06c5bc8 100644 (file)
@@ -508,7 +508,7 @@ namespace PETScWrappers
       ierr = ISDestroy(&is_glob_row);
       AssertThrow(ierr == 0, ExcPETScError(ierr));
       ierr =
-        ISLocalToGlobalMappingViewFromOptions(l2gmap_row, NULL, "-view_map");
+        ISLocalToGlobalMappingViewFromOptions(l2gmap_row, nullptr, "-view_map");
       AssertThrow(ierr == 0, ExcPETScError(ierr));
 
       // Create column index set
@@ -524,7 +524,7 @@ namespace PETScWrappers
       ierr = ISDestroy(&is_glob_col);
       AssertThrow(ierr == 0, ExcPETScError(ierr));
       ierr =
-        ISLocalToGlobalMappingViewFromOptions(l2gmap_col, NULL, "-view_map");
+        ISLocalToGlobalMappingViewFromOptions(l2gmap_col, nullptr, "-view_map");
       AssertThrow(ierr == 0, ExcPETScError(ierr));
 
       // create the matrix with the IS constructor.
index f79e7ac1db7c1801c6ef736ee16acf4ff1aa0099..a39d482ca41d9956363e1fe8f29a72bc38d771ae 100644 (file)
@@ -1083,7 +1083,7 @@ namespace PETScWrappers
     else
       {
         set_option_value("-pc_bddc_corner_selection", "false");
-        ierr = PCSetCoordinates(pc, 0, 0, NULL);
+        ierr = PCSetCoordinates(pc, 0, 0, nullptr);
         AssertThrow(ierr == 0, ExcPETScError(ierr));
       }
 
index b84c7bc78da41baa80fda3aaa3396e75c8d9cae5..6e22d44d56071901d6a8c1582cdd85c613ce0880 100644 (file)
@@ -117,7 +117,7 @@ namespace TrilinosWrappers
 
 
   SparsityPattern::SparsityPattern(SparsityPattern &&other) noexcept
-    : SparsityPatternBase(other)
+    : SparsityPatternBase(std::move(other))
     , column_space_map(std::move(other.column_space_map))
     , graph(std::move(other.graph))
     , nonlocal_graph(std::move(other.nonlocal_graph))

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.