]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix warnings due to conversion from floats to integers in tests
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 7 Dec 2018 00:14:02 +0000 (01:14 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 7 Dec 2018 00:14:02 +0000 (01:14 +0100)
26 files changed:
include/deal.II/base/patterns.h
tests/ad_common_tests/step-44-helper_res_lin_01.h
tests/ad_common_tests/step-44-helper_var_form_01.h
tests/arpack/parpack_advection_diffusion_petsc.cc
tests/arpack/parpack_advection_diffusion_trilinos.cc
tests/arpack/step-36_parpack.cc
tests/arpack/step-36_parpack_trilinos.cc
tests/base/utilities_11.cc
tests/fe/fe_enriched_color_07.cc
tests/hp/refinement_01.cc
tests/integrators/mesh_worker_1d_dg.cc
tests/matrix_free/cell_categorization.cc
tests/mpi/cell_weights_05.cc
tests/mpi/hp_active_fe_indices_transfer_01.cc
tests/mpi/hp_refinement_01.cc
tests/mpi/hp_refinement_02.cc
tests/mpi/p4est_save_06.cc
tests/mpi/refine_and_coarsen_fixed_number_07.cc
tests/mpi/solution_transfer_04.cc
tests/optimization/step-44.h
tests/physics/step-44-standard_tensors-material_push_forward.cc
tests/physics/step-44-standard_tensors-spatial.cc
tests/physics/step-44.cc
tests/sharedtria/mg_dof_01.cc
tests/slepc/step-36_parallel.cc
tests/slepc/step-36_parallel_03.cc

index e121391f11ad89555b56c55a10b82037fa2dc824..a5df1a3a334c29d1cc55573a0eab6e7ad0291192 100644 (file)
@@ -1500,7 +1500,8 @@ namespace Patterns
           return std_cxx14::make_unique<Patterns::Bool>();
         else if (std::is_integral<T>::value)
           return std_cxx14::make_unique<Patterns::Integer>(
-            std::numeric_limits<T>::min(), std::numeric_limits<T>::max());
+            static_cast<int>(std::numeric_limits<T>::min()),
+            static_cast<int>(std::numeric_limits<T>::max()));
         else if (std::is_floating_point<T>::value)
           return std_cxx14::make_unique<Patterns::Double>(
             -std::numeric_limits<T>::max(), std::numeric_limits<T>::max());
index c1a6cdb75176e77e037938dd2733791386702032..75913c796e42229daaae13f91ea7565442a21662 100644 (file)
@@ -1574,8 +1574,9 @@ namespace Step44
           std::cout << " SLV " << std::flush;
           if (parameters.type_lin == "CG")
             {
-              const int solver_its = tangent_matrix.block(u_dof, u_dof).m() *
-                                     parameters.max_iterations_lin;
+              const auto solver_its = static_cast<unsigned int>(
+                tangent_matrix.block(u_dof, u_dof).m() *
+                parameters.max_iterations_lin);
               const double tol_sol =
                 parameters.tol_lin * system_rhs.block(u_dof).l2_norm();
               SolverControl solver_control(solver_its, tol_sol, false, false);
@@ -1656,8 +1657,8 @@ namespace Step44
             preconditioner_K_Jp_inv.use_matrix(
               tangent_matrix.block(J_dof, p_dof));
             ReductionControl solver_control_K_Jp_inv(
-              tangent_matrix.block(J_dof, p_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(J_dof, p_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_Jp_inv;
@@ -1675,8 +1676,8 @@ namespace Step44
             preconditioner_K_con_inv.use_matrix(
               tangent_matrix.block(u_dof, u_dof));
             ReductionControl solver_control_K_con_inv(
-              tangent_matrix.block(u_dof, u_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(u_dof, u_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_con_inv;
index 9a61b5a70253f94492bc47b789a3aec92e8483d8..f8b7f1b030c05e9f925ee408002061e17ea7ddfa 100644 (file)
@@ -1500,8 +1500,9 @@ namespace Step44
           std::cout << " SLV " << std::flush;
           if (parameters.type_lin == "CG")
             {
-              const int solver_its = tangent_matrix.block(u_dof, u_dof).m() *
-                                     parameters.max_iterations_lin;
+              const auto solver_its = static_cast<unsigned int>(
+                tangent_matrix.block(u_dof, u_dof).m() *
+                parameters.max_iterations_lin);
               const double tol_sol =
                 parameters.tol_lin * system_rhs.block(u_dof).l2_norm();
               SolverControl solver_control(solver_its, tol_sol, false, false);
@@ -1582,8 +1583,8 @@ namespace Step44
             preconditioner_K_Jp_inv.use_matrix(
               tangent_matrix.block(J_dof, p_dof));
             ReductionControl solver_control_K_Jp_inv(
-              tangent_matrix.block(J_dof, p_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(J_dof, p_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_Jp_inv;
@@ -1601,8 +1602,8 @@ namespace Step44
             preconditioner_K_con_inv.use_matrix(
               tangent_matrix.block(u_dof, u_dof));
             ReductionControl solver_control_K_con_inv(
-              tangent_matrix.block(u_dof, u_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(u_dof, u_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_con_inv;
index f66bc9835c8cbf9c8d011d5272eccd183c95ca54..d37e4d4a3d539130f418024fdc37eeb8c1aa8b4d 100644 (file)
@@ -179,7 +179,7 @@ test()
         const dealii::Point<dim> &center = cell->center();
         const double              x      = center[0];
 
-        const unsigned int id = std::floor((x - x0) / dL);
+        const auto id = static_cast<unsigned int>((x - x0) / dL);
         cell->set_subdomain_id(id);
       }
   }
index 671d9db0e2453935dfd54ba9d7b3aa028bd7f78a..e61d8c3f5acff4fff4074baa578e82ac246f3370 100644 (file)
@@ -153,7 +153,7 @@ test()
         const Point<dim> &center = cell->center();
         const double      x      = center[0];
 
-        const unsigned int id = std::floor((x - x0) / dL);
+        const auto id = static_cast<unsigned int>((x - x0) / dL);
         cell->set_subdomain_id(id);
       }
   }
index 9a54c1c7ad1c8c7871b5e403ec4a5dccdf7d5fd8..c85284a47e2f459858e9b7e1af0aabf25894428c 100644 (file)
@@ -181,7 +181,7 @@ test()
         const dealii::Point<dim> &center = cell->center();
         const double              x      = center[0];
 
-        const unsigned int id = std::floor((x - x0) / dL);
+        const auto id = static_cast<unsigned int>(std::floor((x - x0) / dL));
         cell->set_subdomain_id(id);
       }
   }
index 9af1726d6fcf680ab332eb3004aeb5e167f4fa41..a2c08927eb48b9d815a5388300c196a7597a571d 100644 (file)
@@ -155,7 +155,7 @@ test()
         const Point<dim> &center = cell->center();
         const double      x      = center[0];
 
-        const unsigned int id = std::floor((x - x0) / dL);
+        const auto id = static_cast<unsigned int>((x - x0) / dL);
         cell->set_subdomain_id(id);
       }
   }
index f70779ce808641a57a067e1770e23f00715f1caa..56f7cf3df5a69be4397276dd21a7d5ca97529f1b 100644 (file)
 void
 test()
 {
-  unsigned long long int i = std::pow(2, 33);
+  const auto i = static_cast<unsigned long long int>(std::pow(2, 33));
   Assert(Utilities::to_string(i) == "8589934592", ExcInternalError());
   Assert(Utilities::to_string(i, 11) == "08589934592", ExcInternalError());
 
-  unsigned long long j = std::pow(2, 31);
+  const auto j = static_cast<unsigned long long int>(std::pow(2, 31));
   Assert(Utilities::to_string(j) == "2147483648", ExcInternalError());
 
-  int k = -std::pow(2, 30);
+  const int k = static_cast<int>(-std::pow(2, 30));
   Assert(Utilities::to_string(k) == "-1073741824", ExcInternalError());
   Assert(Utilities::to_string(k, 12) == "-01073741824", ExcInternalError());
 
-  long long int l = -std::pow(2, 35);
+  const auto l = static_cast<long long int>(-std::pow(2, 35));
   Assert(Utilities::to_string(l) == "-34359738368", ExcInternalError());
   Assert(Utilities::to_string(l, 13) == "-034359738368", ExcInternalError());
 
index fb7841d65a49c4f56b960c046b7de1c551face61..cb542663952ab7d7b8c718b6395205c21381259d 100644 (file)
@@ -611,14 +611,14 @@ public:
                              const double &     sigma,
                              const std::string &rhs_expr,
                              const std::string &boundary_expr,
-                             const double &     refinement = 11);
+                             const unsigned int refinement = 11);
   EstimateEnrichmentFunction(const Point<1> &   center,
                              const double &     left_bound,
                              const double &     right_bound,
                              const double &     sigma,
                              const std::string &rhs_expr,
                              const std::string &boundary_expr,
-                             const double &     refinement = 11);
+                             const unsigned int refinement = 11);
   ~EstimateEnrichmentFunction();
   void
   run();
@@ -669,7 +669,7 @@ EstimateEnrichmentFunction::EstimateEnrichmentFunction(
   const double &     sigma,
   const std::string &rhs_expr,
   const std::string &boundary_expr,
-  const double &     refinement)
+  const unsigned int refinement)
   : center(center)
   , domain_size(domain_size)
   , sigma(sigma)
@@ -692,7 +692,7 @@ EstimateEnrichmentFunction::EstimateEnrichmentFunction(
   const double &     sigma,
   const std::string &rhs_expr,
   const std::string &boundary_expr,
-  const double &     refinement)
+  const unsigned int refinement)
   : center(center)
   , left_bound(left_bound)
   , right_bound(right_bound)
index ad632d4b96b348c80cd15d45c47ab5104c115da6..7d33bd6968391f5929b0d1394046c31c4306eaab 100644 (file)
@@ -47,7 +47,7 @@ test()
   hp::FECollection<dim> fe_collection;
 
   // prepare FECollection with arbitrary number of entries
-  const unsigned int max_degree = 1 + std::pow(2, dim);
+  const unsigned int max_degree = 1 + Utilities::pow(2, dim);
   for (unsigned int i = 0; i < max_degree; ++i)
     fe_collection.push_back(FE_Q<dim>(max_degree - i));
 
index d7fbefc2f38ca2a812e0263d918e416ef4679ac6..3d4f58ba59a18449f13a88d0b5db292f074be740 100644 (file)
@@ -216,7 +216,8 @@ namespace Advection
   AdvectionProblem<dim>::assemble_rhs(Vector<double> &solution,
                                       Vector<double> &residual)
   {
-    const unsigned int n_gauss_points = std::ceil(((2.0 * fe.degree) + 1) / 2);
+    const auto n_gauss_points =
+      static_cast<unsigned int>(std::ceil(((2.0 * fe.degree) + 1) / 2));
 
     MeshWorker::IntegrationInfoBox<dim> info_box;
 
@@ -437,8 +438,8 @@ namespace Advection
     deallog << "\tNumber of degrees of freedom: " << dof_handler.n_dofs()
             << std::endl;
 
-    const double delta_t = 0.005;
-    const double n_dt    = 10;
+    const double       delta_t = 0.005;
+    const unsigned int n_dt    = 10;
 
     double inv_cell_vol = 1.0 / std::pow(0.01, dim);
 
index 45d37eaeb30da58edb6946eed13c5af4794b583b..e535dba75a2223954548e030fc7edd9f60337276 100644 (file)
@@ -83,7 +83,7 @@ test()
   for (const auto &cell : tria.active_cell_iterators())
     if (cell->is_locally_owned())
       data.cell_vectorization_category[cell->active_cell_index()] =
-        cell->center()[1] * 10.;
+        static_cast<unsigned int>(cell->center()[1] * 10.);
 
   data.cell_vectorization_categories_strict = false;
   mf_data.reinit(dof, constraints, QGauss<1>(2), data);
index 10541e7d43eafc2183f0765b6271056e4409ecd7..430a965479486005fe5bd2d6de45a2f284491b28 100644 (file)
@@ -54,7 +54,7 @@ cell_weight(
     (cell->center()[0] < 1) && (cell->center()[1] < 1) &&
         (dim == 3 ? (cell->center()[2] < 1) : true) ?
       // one cell has more weight than all others together
-      std::pow(16, dim) * 1000 :
+      Utilities::pow(16, dim) * 1000 :
       0);
 }
 
index 15a579426e10d9e311c0fcfe2093dc5881e8852a..4e0266a1b9a67ada6ea41f5d5d08404801e366ff 100644 (file)
@@ -47,7 +47,7 @@ test()
   hp::FECollection<dim> fe_collection;
 
   // prepare FECollection with arbitrary number of entries
-  const unsigned int max_degree = 1 + std::pow(2, dim);
+  const unsigned int max_degree = 1 + Utilities::pow(2, dim);
   for (unsigned int i = 0; i < max_degree; ++i)
     fe_collection.push_back(FE_Q<dim>(max_degree - i));
 
index 803894e8f0e69f5681c488fb7500183de32d4d8e..610511c50ad9a542d196d7a410bd60ffdee6c23a 100644 (file)
@@ -54,7 +54,7 @@ test()
   hp::FECollection<dim> fe_collection;
 
   // prepare FECollection with arbitrary number of entries
-  const unsigned int max_degree = 1 + std::pow(2, dim);
+  const unsigned int max_degree = 1 + Utilities::pow(2, dim);
   for (unsigned int i = 0; i < max_degree; ++i)
     fe_collection.push_back(FE_Q<dim>(max_degree - i));
 
index 4ab67ae7b31bc157cb508f837b34479a172c1219..9551770e3d1fd4e697667cfef7ad9531e6b14e5f 100644 (file)
@@ -54,7 +54,7 @@ test()
   hp::FECollection<dim> fe_collection;
 
   // prepare FECollection with arbitrary number of entries
-  const unsigned int max_degree = 1 + std::pow(2, dim);
+  const unsigned int max_degree = 1 + Utilities::pow(2, dim);
   for (unsigned int i = 0; i < max_degree; ++i)
     fe_collection.push_back(FE_Q<dim>(max_degree - i));
 
index 96eafd518f4e4bec826e69115a7f41795a2abab7..446242a454105a4bb75f33caaa68fb9e64b0ff25 100644 (file)
@@ -78,7 +78,7 @@ test()
       hp::FECollection<dim> fe_collection;
 
       // prepare FECollection with arbitrary number of entries
-      const unsigned int max_degree = 1 + std::pow(2, dim);
+      const unsigned int max_degree = 1 + Utilities::pow(2, dim);
       for (unsigned int i = 0; i < max_degree; ++i)
         fe_collection.push_back(FE_Q<dim>(max_degree - i));
 
@@ -133,7 +133,7 @@ test()
     hp::FECollection<dim> fe_collection;
 
     // prepare FECollection with arbitrary number of entries
-    const unsigned int max_degree = 1 + std::pow(2, dim);
+    const unsigned int max_degree = 1 + Utilities::pow(2, dim);
     for (unsigned int i = 0; i < max_degree; ++i)
       fe_collection.push_back(FE_Q<dim>(max_degree - i));
 
index 3a2074ce2ab819e7bcca742f08b5184b36375a87..85d5f912cff0edca8cd8e3828a0c67535a33933b 100644 (file)
@@ -65,7 +65,8 @@ test(const double max_n_cell_ratio)
         }
   }
 
-  const unsigned int max_n_cell = max_n_cell_ratio * tr.n_global_active_cells();
+  const auto max_n_cell =
+    static_cast<unsigned int>(max_n_cell_ratio * tr.n_global_active_cells());
 
   parallel::distributed::GridRefinement ::refine_and_coarsen_fixed_number(
     tr, indicators, 0.2, 0.2, max_n_cell);
index d8004586de79d0222b81711bc361ac24ad04cfc6..6edb651b388d045d053766eee6968bd4a100ec17 100644 (file)
@@ -52,7 +52,7 @@ test()
   hp::FECollection<dim> fe_collection;
 
   // prepare FECollection with arbitrary number of entries
-  const unsigned int max_degree = 1 + std::pow(2, dim);
+  const unsigned int max_degree = 1 + Utilities::pow(2, dim);
   for (unsigned int i = 0; i < max_degree; ++i)
     fe_collection.push_back(FE_Q<dim>(max_degree - i));
 
index 3a454914d5310c211e9b637a550e14b1745478cf..d5f27ed88168b09611398d5d3e7d05a74bc748b4 100644 (file)
@@ -1402,13 +1402,13 @@ namespace Step44
 
           // The values for eta, mu are chosen such that
           // more strict convergence conditions are enforced.
-          const double a1               = 1.0;
-          const double eta              = 0.5;
-          const double mu               = 0.49;
-          const double a_max            = 1.25;
-          const double max_evals        = 20;
-          const bool   debug_linesearch = false;
-          const auto   res = (use_ptrb ? LineMinimization::line_search<double>(
+          const double       a1               = 1.0;
+          const double       eta              = 0.5;
+          const double       mu               = 0.49;
+          const double       a_max            = 1.25;
+          const unsigned int max_evals        = 20;
+          const bool         debug_linesearch = false;
+          const auto res = (use_ptrb ? LineMinimization::line_search<double>(
                                          ls_minimization_function_ptrb,
                                          res_0.first,
                                          res_0.second,
@@ -2072,8 +2072,9 @@ namespace Step44
           std::cout << " SLV " << std::flush;
           if (parameters.type_lin == "CG")
             {
-              const int solver_its = tangent_matrix.block(u_dof, u_dof).m() *
-                                     parameters.max_iterations_lin;
+              const auto solver_its = static_cast<unsigned int>(
+                tangent_matrix.block(u_dof, u_dof).m() *
+                parameters.max_iterations_lin);
               const double tol_sol =
                 parameters.tol_lin * system_rhs.block(u_dof).l2_norm();
               SolverControl solver_control(solver_its, tol_sol, false, false);
@@ -2154,8 +2155,8 @@ namespace Step44
             preconditioner_K_Jp_inv.use_matrix(
               tangent_matrix.block(J_dof, p_dof));
             ReductionControl solver_control_K_Jp_inv(
-              tangent_matrix.block(J_dof, p_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(J_dof, p_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_Jp_inv;
@@ -2173,8 +2174,8 @@ namespace Step44
             preconditioner_K_con_inv.use_matrix(
               tangent_matrix.block(u_dof, u_dof));
             ReductionControl solver_control_K_con_inv(
-              tangent_matrix.block(u_dof, u_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(u_dof, u_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_con_inv;
index d85406177f913f79393cc91cdadc11c3411ddd05..dbe238c94a7f05b4d4595fa6ee48766431387a03 100644 (file)
@@ -2099,8 +2099,9 @@ namespace Step44
           pcout << " SLV " << std::flush;
           if (parameters.type_lin == "CG")
             {
-              const int solver_its = tangent_matrix.block(u_dof, u_dof).m() *
-                                     parameters.max_iterations_lin;
+              const auto solver_its = static_cast<unsigned int>(
+                tangent_matrix.block(u_dof, u_dof).m() *
+                parameters.max_iterations_lin);
               const double tol_sol =
                 parameters.tol_lin * system_rhs.block(u_dof).l2_norm();
               SolverControl solver_control(solver_its, tol_sol, false, false);
@@ -2181,8 +2182,8 @@ namespace Step44
             preconditioner_K_Jp_inv.use_matrix(
               tangent_matrix.block(J_dof, p_dof));
             ReductionControl solver_control_K_Jp_inv(
-              tangent_matrix.block(J_dof, p_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(J_dof, p_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_Jp_inv;
@@ -2200,8 +2201,8 @@ namespace Step44
             preconditioner_K_con_inv.use_matrix(
               tangent_matrix.block(u_dof, u_dof));
             ReductionControl solver_control_K_con_inv(
-              tangent_matrix.block(u_dof, u_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(u_dof, u_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_con_inv;
index b5dd3777b44ee381914d01da7e7a3989b0c37948..2414e99529dc9c955d7a6e3d2596f4c35390316e 100644 (file)
@@ -1899,8 +1899,9 @@ namespace Step44
           pcout << " SLV " << std::flush;
           if (parameters.type_lin == "CG")
             {
-              const int solver_its = tangent_matrix.block(u_dof, u_dof).m() *
-                                     parameters.max_iterations_lin;
+              const auto solver_its = static_cast<unsigned int>(
+                tangent_matrix.block(u_dof, u_dof).m() *
+                parameters.max_iterations_lin);
               const double tol_sol =
                 parameters.tol_lin * system_rhs.block(u_dof).l2_norm();
               SolverControl solver_control(solver_its, tol_sol, false, false);
@@ -1981,8 +1982,8 @@ namespace Step44
             preconditioner_K_Jp_inv.use_matrix(
               tangent_matrix.block(J_dof, p_dof));
             ReductionControl solver_control_K_Jp_inv(
-              tangent_matrix.block(J_dof, p_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(J_dof, p_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_Jp_inv;
@@ -2000,8 +2001,8 @@ namespace Step44
             preconditioner_K_con_inv.use_matrix(
               tangent_matrix.block(u_dof, u_dof));
             ReductionControl solver_control_K_con_inv(
-              tangent_matrix.block(u_dof, u_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(u_dof, u_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_con_inv;
index 4be51ee71d465ce71cff4669db59b27f00816854..250f6556a37b7cf1961b9d05c6f935646c128d24 100644 (file)
@@ -1910,8 +1910,9 @@ namespace Step44
           pcout << " SLV " << std::flush;
           if (parameters.type_lin == "CG")
             {
-              const int solver_its = tangent_matrix.block(u_dof, u_dof).m() *
-                                     parameters.max_iterations_lin;
+              const auto solver_its = static_cast<unsigned int>(
+                tangent_matrix.block(u_dof, u_dof).m() *
+                parameters.max_iterations_lin);
               const double tol_sol =
                 parameters.tol_lin * system_rhs.block(u_dof).l2_norm();
               SolverControl solver_control(solver_its, tol_sol, false, false);
@@ -1992,8 +1993,8 @@ namespace Step44
             preconditioner_K_Jp_inv.use_matrix(
               tangent_matrix.block(J_dof, p_dof));
             ReductionControl solver_control_K_Jp_inv(
-              tangent_matrix.block(J_dof, p_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(J_dof, p_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_Jp_inv;
@@ -2011,8 +2012,8 @@ namespace Step44
             preconditioner_K_con_inv.use_matrix(
               tangent_matrix.block(u_dof, u_dof));
             ReductionControl solver_control_K_con_inv(
-              tangent_matrix.block(u_dof, u_dof).m() *
-                parameters.max_iterations_lin,
+              static_cast<unsigned int>(tangent_matrix.block(u_dof, u_dof).m() *
+                                        parameters.max_iterations_lin),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_con_inv;
index 9961fa11921df432c25431270bdd3b2628b9f381..9918d477c2413678877d3307f8e2f4dfac4b698c 100644 (file)
@@ -131,7 +131,7 @@ test()
         if (cell->center()[0] < 0.5 && cell->center()[1] < 0.5)
           cell->set_refine_flag();
       if (dim == 3)
-        if (cell->center()[0] < 0.5 && cell->center()[1] &&
+        if (cell->center()[0] < 0.5 && cell->center()[1] < 0.5 &&
             cell->center()[2] < 0.5)
           cell->set_refine_flag();
     }
@@ -153,7 +153,7 @@ test()
           cell->set_refine_flag();
       if (dim == 3)
         if (cell->is_locally_owned() && cell->center()[0] < 0.5 &&
-            cell->center()[1] && cell->center()[2] < 0.5)
+            cell->center()[1] < 0.5 && cell->center()[2] < 0.5)
           cell->set_refine_flag();
     }
   distributed_tria.execute_coarsening_and_refinement();
index 520e6eb0c76d8647541c37e841d6d2e16f1ad21a..a25868fb6ad372fd7a1ac5dc35de6f7765f4ebc7 100644 (file)
@@ -94,7 +94,7 @@ test(std::string solver_name, std::string preconditioner_name)
         const dealii::Point<dim> &center = cell->center();
         const double              x      = center[0];
 
-        const unsigned int id = std::floor((x - x0) / dL);
+        const auto id = static_cast<unsigned int>((x - x0) / dL);
         cell->set_subdomain_id(id);
       }
   }
index cdb2068806d84fd210e7b71699350162996d2811..36c5c196ec57616691c1bb9c629ca90b8c045b55 100644 (file)
@@ -94,7 +94,7 @@ test(std::string solver_name, std::string preconditioner_name)
         const dealii::Point<dim> &center = cell->center();
         const double              x      = center[0];
 
-        const unsigned int id = std::floor((x - x0) / dL);
+        const auto id = static_cast<unsigned int>((x - x0) / dL);
         cell->set_subdomain_id(id);
       }
   }

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.