]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Pass IndexSet element by copy 6846/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 28 Jun 2018 08:05:21 +0000 (10:05 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 28 Jun 2018 08:28:49 +0000 (10:28 +0200)
include/deal.II/base/index_set.h
include/deal.II/lac/affine_constraints.templates.h
include/deal.II/lac/read_write_vector.templates.h
source/dofs/dof_renumbering.cc
source/dofs/dof_tools.cc
source/grid/grid_tools.cc
source/lac/trilinos_sparse_matrix.cc

index 68a7cad4a9885bdd92218633b1d2778603c5c8ad..42dd03323e3b3281df989fefefc3b1aa94eddf6a 100644 (file)
@@ -691,7 +691,7 @@ public:
      * Dereferencing operator. The returned value is the index of the element
      * inside the IndexSet.
      */
-    const size_type &operator*() const;
+    size_type operator*() const;
 
     /**
      * Does this iterator point to an existing element?
@@ -1283,7 +1283,7 @@ IndexSet::ElementIterator::is_valid() const
 
 
 
-inline const IndexSet::size_type &IndexSet::ElementIterator::operator*() const
+inline IndexSet::size_type IndexSet::ElementIterator::operator*() const
 {
   Assert(
     is_valid(),
index 7cd691b39b9f1a98ea5439b56101194f5dc46a17..de00d9625ebb5887260a156fd21f6234b1fd1806 100644 (file)
@@ -165,7 +165,7 @@ AffineConstraints<number>::is_consistent_in_parallel(
     {
       // find all lines to send to @p owner
       IndexSet indices_to_send = non_owned & locally_owned_dofs[owner];
-      for (const auto &row_idx : indices_to_send)
+      for (const auto row_idx : indices_to_send)
         {
           to_send[owner].push_back(get_line(row_idx));
         }
index d577e4c7c73e15af5ad38050fa78aaeac1f9cf53..05a875240cefa5290691f2d1bd5254c8b0ff778c 100644 (file)
@@ -562,7 +562,7 @@ namespace LinearAlgebra
     stored_elements.print(out);
     out << std::endl;
     unsigned int i = 0;
-    for (const auto &idx : this->stored_elements)
+    for (const auto idx : this->stored_elements)
       out << "[" << idx << "]: " << values[i++] << '\n';
     out << std::flush;
 
index d9d8a2e62655ac941cfabf1b32b8d5a7df9e219d..2fa17cbe77f98d5f0078c626751636ed3cbaa717 100644 (file)
@@ -528,7 +528,7 @@ namespace DoFRenumbering
             active_but_not_owned_dofs.subtract_set(locally_owned_dofs);
 
             std::set<types::global_dof_index> erase_these_indices;
-            for (const auto &p : active_but_not_owned_dofs)
+            for (const auto p : active_but_not_owned_dofs)
               {
                 const auto index = index_set_to_use.index_within_set(p);
                 Assert(index < index_set_to_use.n_elements(),
index 75075ab289c5d94f3db23346a8190b719a3f79fa..c6cb63c66f2b03fec08a57847264e261a2436126 100644 (file)
@@ -1040,7 +1040,7 @@ namespace DoFTools
            ExcDimensionMismatch(selected_dofs.size(), dof_handler.n_dofs()));
     // preset all values by false
     std::fill(selected_dofs.begin(), selected_dofs.end(), false);
-    for (const auto &index : selected_dofs_as_index_set)
+    for (const auto index : selected_dofs_as_index_set)
       selected_dofs[index] = true;
   }
 
index 5f00abc06ddb35e784b1fce534b7f3dd05756401..01ac23648baec88816c7563c12573907177f0967 100644 (file)
@@ -1740,7 +1740,7 @@ namespace GridTools
     // Creating a bounding box for all active cell on coarser level
 
     for (unsigned int i = 0; i < refinement_level; ++i)
-      for (typename MeshType::cell_iterator cell :
+      for (const typename MeshType::cell_iterator &cell :
            mesh.active_cell_iterators_on_level(i))
         {
           bool                  has_predicate = false;
index fe657772ef6d0225f4072c85cdbef2ae7ffb9856..5b3905e1b572954ac35cdf801c8a237ac9ebbba8 100644 (file)
@@ -411,7 +411,7 @@ namespace TrilinosWrappers
         // Try to copy all the rows of the matrix one by one. In case of error
         // (i.e., the column indices are different), we need to abort and blow
         // away the matrix.
-        for (const auto &row : locally_owned_range_indices())
+        for (const auto row : locally_owned_range_indices())
           {
             const int row_local = matrix->RowMap().LID(
               static_cast<TrilinosWrappers::types::int_type>(row));
@@ -1905,7 +1905,7 @@ namespace TrilinosWrappers
 
     const bool same_col_map = matrix->ColMap().SameAs(rhs.matrix->ColMap());
 
-    for (const auto &row : locally_owned_range_indices())
+    for (const auto row : locally_owned_range_indices())
       {
         const int row_local = matrix->RowMap().LID(
           static_cast<TrilinosWrappers::types::int_type>(row));

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.