]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replaced void with maybe_unused
authorYi-Yung Yang <hagiasophia135@icloud.com>
Mon, 12 Aug 2024 22:17:49 +0000 (18:17 -0400)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Tue, 27 Aug 2024 15:00:55 +0000 (17:00 +0200)
tests/matrix_free/matrix_vector_hessians_cells.cc

index 6256a798fc3547b2c3180a1083b40976c0c68640..d8f4340a8a056bb6a2cc2fec9d1e6191f8238e79 100644 (file)
@@ -68,14 +68,15 @@ test_hessians(const dealii::FE_Poly<dim>                    &fe,
   additional_data.mapping_update_flags_inner_faces =
     update_values | update_gradients | update_hessians;
 
-  MatrixFree<dim, double, VectorizedArrayType> matrix_free;
+  [[maybe_unused]]MatrixFree<dim, double, VectorizedArrayType> matrix_free;
   matrix_free.reinit(mapping, dof_handler, constraints, quad, additional_data);
 
   if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
     deallog << "Working with " << fe.get_name() << " and "
             << dof_handler.n_dofs() << " dofs" << std::endl;
 
-  LinearAlgebra::distributed::Vector<double> src, dst, dst2;
+  LinearAlgebra::distributed::Vector<double> dst2;
+  [[maybe_unused]]LinearAlgebra::distributed::Vector<double> src, dst;
   matrix_free.initialize_dof_vector(src);
   for (auto &v : src)
     v = random_value<double>();
@@ -101,7 +102,7 @@ test_hessians(const dealii::FE_Poly<dim>                    &fe,
   matrix_free.template loop<LinearAlgebra::distributed::Vector<double>,
                             LinearAlgebra::distributed::Vector<double>>(
     [&](
-      const auto &matrix_free, auto &dst, const auto &src, const auto &range) {
+      const auto &matrix_free, auto &dst, const auto &src, [[maybe_unused]]const auto &range) {
       FEEvaluation<dim, -1, 0, 1, double, VectorizedArrayType> fe_eval(
         matrix_free);
       for (unsigned int cell = range.first; cell < range.second; ++cell)
@@ -185,17 +186,9 @@ test_hessians(const dealii::FE_Poly<dim>                    &fe,
     },
     [&](
       const auto &matrix_free, auto &dst, const auto &src, const auto &range) {
-      (void)matrix_free;
-      (void)dst;
-      (void)src;
-      (void)range;
     },
     [&](
       const auto &matrix_free, auto &dst, const auto &src, const auto &range) {
-      (void)matrix_free;
-      (void)dst;
-      (void)src;
-      (void)range;
     },
     dst,
     src,

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.