]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix unused-but-set-variabel warnings 12747/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Tue, 7 Sep 2021 12:16:15 +0000 (12:16 +0000)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Tue, 7 Sep 2021 12:17:26 +0000 (12:17 +0000)
include/deal.II/lac/trilinos_sparse_matrix.h
include/deal.II/matrix_free/matrix_free.templates.h
source/fe/fe_q_base.cc
source/grid/grid_generator.cc

index e2ccc18cc425e430ac2742928b97f95dc12376b6..33f40bcdeefa4887d0b2bc9b3ee4e1c3161e83a3 100644 (file)
@@ -2893,13 +2893,15 @@ namespace TrilinosWrappers
         // TODO: fix this (do not run compress here, but fail)
         if (last_action == Insert)
           {
+#      ifdef DEBUG
             int ierr;
-            ierr = matrix->GlobalAssemble(*column_space_map,
-                                          matrix->RowMap(),
-                                          false);
+            ierr =
+#      endif
+              matrix->GlobalAssemble(*column_space_map,
+                                     matrix->RowMap(),
+                                     false);
 
             Assert(ierr == 0, ExcTrilinosError(ierr));
-            (void)ierr; // removes -Wunused-but-set-variable in optimized mode
           }
 
         last_action = Add;
index 57681697ddc573bf938782f4ae9ea67b24aec851..053eef26ca09e7379828ca3afe4714f38891926d 100644 (file)
@@ -1609,6 +1609,7 @@ namespace internal
             irregular_cells.back() = task_info.n_ghost_cells % n_lanes;
           }
 
+#ifdef DEBUG
         {
           unsigned int n_cells = 0;
           for (unsigned int i = 0; i < task_info.cell_partition_data.back();
@@ -1622,6 +1623,7 @@ namespace internal
             n_cells += irregular_cells[i] > 0 ? irregular_cells[i] : n_lanes;
           AssertDimension(n_cells, task_info.n_ghost_cells);
         }
+#endif
 
         task_info.cell_partition_data.push_back(
           task_info.cell_partition_data.back() + n_ghost_slots);
index 28f809838e9e55870d15b5aa8d48a2a9c622429a..77d129d7d4b290686941d932bdeaf4dd7fae6246 100644 (file)
@@ -1520,7 +1520,9 @@ FE_Q_Base<dim, spacedim>::get_restriction_matrix(
                   }
               unsigned int j_indices[dim];
               internal::FE_Q_Base::zero_indices<dim>(j_indices);
+#ifdef DEBUG
               double sum_check = 0;
+#endif
               for (unsigned int j = 0; j < q_dofs_per_cell; j += dofs1d)
                 {
                   double val_extra_dim = 1.;
@@ -1540,7 +1542,9 @@ FE_Q_Base<dim, spacedim>::get_restriction_matrix(
                         my_restriction(mother_dof, child_dof) = 1.;
                       else if (std::fabs(val) > eps)
                         my_restriction(mother_dof, child_dof) = val;
+#ifdef DEBUG
                       sum_check += val;
+#endif
                     }
                   internal::FE_Q_Base::increment_indices<dim>(j_indices,
                                                               dofs1d);
index 2b6f26803221548e0e92af6220ae363f27623793..ba3b678b21fcf4c9d399a4f1c2f89dcfab2f1046 100644 (file)
@@ -2721,6 +2721,7 @@ namespace GridGenerator
             std::reverse(step_sizes[i].begin(), step_sizes[i].end());
           }
 
+#  ifdef DEBUG
         double x = 0;
         for (unsigned int j = 0; j < step_sizes.at(i).size(); ++j)
           x += step_sizes[i][j];
@@ -2730,6 +2731,7 @@ namespace GridGenerator
                  Utilities::int_to_string(i) +
                  " must be equal to the distance of the two given "
                  "points in this coordinate direction."));
+#  endif
       }
 
 

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.