From: Daniel Arndt Date: Fri, 7 Dec 2018 00:14:02 +0000 (+0100) Subject: Fix warnings due to conversion from floats to integers in tests X-Git-Tag: v9.1.0-rc1~503^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f041d65eedd0c0777e6e2ad22634ede2dca8eaef;p=dealii.git Fix warnings due to conversion from floats to integers in tests --- diff --git a/include/deal.II/base/patterns.h b/include/deal.II/base/patterns.h index e121391f11..a5df1a3a33 100644 --- a/include/deal.II/base/patterns.h +++ b/include/deal.II/base/patterns.h @@ -1500,7 +1500,8 @@ namespace Patterns return std_cxx14::make_unique(); else if (std::is_integral::value) return std_cxx14::make_unique( - std::numeric_limits::min(), std::numeric_limits::max()); + static_cast(std::numeric_limits::min()), + static_cast(std::numeric_limits::max())); else if (std::is_floating_point::value) return std_cxx14::make_unique( -std::numeric_limits::max(), std::numeric_limits::max()); diff --git a/tests/ad_common_tests/step-44-helper_res_lin_01.h b/tests/ad_common_tests/step-44-helper_res_lin_01.h index c1a6cdb751..75913c796e 100644 --- a/tests/ad_common_tests/step-44-helper_res_lin_01.h +++ b/tests/ad_common_tests/step-44-helper_res_lin_01.h @@ -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( + 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(tangent_matrix.block(J_dof, p_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> 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(tangent_matrix.block(u_dof, u_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> solver_K_con_inv; diff --git a/tests/ad_common_tests/step-44-helper_var_form_01.h b/tests/ad_common_tests/step-44-helper_var_form_01.h index 9a61b5a702..f8b7f1b030 100644 --- a/tests/ad_common_tests/step-44-helper_var_form_01.h +++ b/tests/ad_common_tests/step-44-helper_var_form_01.h @@ -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( + 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(tangent_matrix.block(J_dof, p_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> 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(tangent_matrix.block(u_dof, u_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> solver_K_con_inv; diff --git a/tests/arpack/parpack_advection_diffusion_petsc.cc b/tests/arpack/parpack_advection_diffusion_petsc.cc index f66bc9835c..d37e4d4a3d 100644 --- a/tests/arpack/parpack_advection_diffusion_petsc.cc +++ b/tests/arpack/parpack_advection_diffusion_petsc.cc @@ -179,7 +179,7 @@ test() const dealii::Point ¢er = cell->center(); const double x = center[0]; - const unsigned int id = std::floor((x - x0) / dL); + const auto id = static_cast((x - x0) / dL); cell->set_subdomain_id(id); } } diff --git a/tests/arpack/parpack_advection_diffusion_trilinos.cc b/tests/arpack/parpack_advection_diffusion_trilinos.cc index 671d9db0e2..e61d8c3f5a 100644 --- a/tests/arpack/parpack_advection_diffusion_trilinos.cc +++ b/tests/arpack/parpack_advection_diffusion_trilinos.cc @@ -153,7 +153,7 @@ test() const Point ¢er = cell->center(); const double x = center[0]; - const unsigned int id = std::floor((x - x0) / dL); + const auto id = static_cast((x - x0) / dL); cell->set_subdomain_id(id); } } diff --git a/tests/arpack/step-36_parpack.cc b/tests/arpack/step-36_parpack.cc index 9a54c1c7ad..c85284a47e 100644 --- a/tests/arpack/step-36_parpack.cc +++ b/tests/arpack/step-36_parpack.cc @@ -181,7 +181,7 @@ test() const dealii::Point ¢er = cell->center(); const double x = center[0]; - const unsigned int id = std::floor((x - x0) / dL); + const auto id = static_cast(std::floor((x - x0) / dL)); cell->set_subdomain_id(id); } } diff --git a/tests/arpack/step-36_parpack_trilinos.cc b/tests/arpack/step-36_parpack_trilinos.cc index 9af1726d6f..a2c08927eb 100644 --- a/tests/arpack/step-36_parpack_trilinos.cc +++ b/tests/arpack/step-36_parpack_trilinos.cc @@ -155,7 +155,7 @@ test() const Point ¢er = cell->center(); const double x = center[0]; - const unsigned int id = std::floor((x - x0) / dL); + const auto id = static_cast((x - x0) / dL); cell->set_subdomain_id(id); } } diff --git a/tests/base/utilities_11.cc b/tests/base/utilities_11.cc index f70779ce80..56f7cf3df5 100644 --- a/tests/base/utilities_11.cc +++ b/tests/base/utilities_11.cc @@ -25,18 +25,18 @@ void test() { - unsigned long long int i = std::pow(2, 33); + const auto i = static_cast(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(std::pow(2, 31)); Assert(Utilities::to_string(j) == "2147483648", ExcInternalError()); - int k = -std::pow(2, 30); + const int k = static_cast(-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(-std::pow(2, 35)); Assert(Utilities::to_string(l) == "-34359738368", ExcInternalError()); Assert(Utilities::to_string(l, 13) == "-034359738368", ExcInternalError()); diff --git a/tests/fe/fe_enriched_color_07.cc b/tests/fe/fe_enriched_color_07.cc index fb7841d65a..cb54266395 100644 --- a/tests/fe/fe_enriched_color_07.cc +++ b/tests/fe/fe_enriched_color_07.cc @@ -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) diff --git a/tests/hp/refinement_01.cc b/tests/hp/refinement_01.cc index ad632d4b96..7d33bd6968 100644 --- a/tests/hp/refinement_01.cc +++ b/tests/hp/refinement_01.cc @@ -47,7 +47,7 @@ test() hp::FECollection 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(max_degree - i)); diff --git a/tests/integrators/mesh_worker_1d_dg.cc b/tests/integrators/mesh_worker_1d_dg.cc index d7fbefc2f3..3d4f58ba59 100644 --- a/tests/integrators/mesh_worker_1d_dg.cc +++ b/tests/integrators/mesh_worker_1d_dg.cc @@ -216,7 +216,8 @@ namespace Advection AdvectionProblem::assemble_rhs(Vector &solution, Vector &residual) { - const unsigned int n_gauss_points = std::ceil(((2.0 * fe.degree) + 1) / 2); + const auto n_gauss_points = + static_cast(std::ceil(((2.0 * fe.degree) + 1) / 2)); MeshWorker::IntegrationInfoBox 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); diff --git a/tests/matrix_free/cell_categorization.cc b/tests/matrix_free/cell_categorization.cc index 45d37eaeb3..e535dba75a 100644 --- a/tests/matrix_free/cell_categorization.cc +++ b/tests/matrix_free/cell_categorization.cc @@ -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(cell->center()[1] * 10.); data.cell_vectorization_categories_strict = false; mf_data.reinit(dof, constraints, QGauss<1>(2), data); diff --git a/tests/mpi/cell_weights_05.cc b/tests/mpi/cell_weights_05.cc index 10541e7d43..430a965479 100644 --- a/tests/mpi/cell_weights_05.cc +++ b/tests/mpi/cell_weights_05.cc @@ -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); } diff --git a/tests/mpi/hp_active_fe_indices_transfer_01.cc b/tests/mpi/hp_active_fe_indices_transfer_01.cc index 15a579426e..4e0266a1b9 100644 --- a/tests/mpi/hp_active_fe_indices_transfer_01.cc +++ b/tests/mpi/hp_active_fe_indices_transfer_01.cc @@ -47,7 +47,7 @@ test() hp::FECollection 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(max_degree - i)); diff --git a/tests/mpi/hp_refinement_01.cc b/tests/mpi/hp_refinement_01.cc index 803894e8f0..610511c50a 100644 --- a/tests/mpi/hp_refinement_01.cc +++ b/tests/mpi/hp_refinement_01.cc @@ -54,7 +54,7 @@ test() hp::FECollection 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(max_degree - i)); diff --git a/tests/mpi/hp_refinement_02.cc b/tests/mpi/hp_refinement_02.cc index 4ab67ae7b3..9551770e3d 100644 --- a/tests/mpi/hp_refinement_02.cc +++ b/tests/mpi/hp_refinement_02.cc @@ -54,7 +54,7 @@ test() hp::FECollection 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(max_degree - i)); diff --git a/tests/mpi/p4est_save_06.cc b/tests/mpi/p4est_save_06.cc index 96eafd518f..446242a454 100644 --- a/tests/mpi/p4est_save_06.cc +++ b/tests/mpi/p4est_save_06.cc @@ -78,7 +78,7 @@ test() hp::FECollection 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(max_degree - i)); @@ -133,7 +133,7 @@ test() hp::FECollection 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(max_degree - i)); diff --git a/tests/mpi/refine_and_coarsen_fixed_number_07.cc b/tests/mpi/refine_and_coarsen_fixed_number_07.cc index 3a2074ce2a..85d5f912cf 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_07.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_07.cc @@ -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(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); diff --git a/tests/mpi/solution_transfer_04.cc b/tests/mpi/solution_transfer_04.cc index d8004586de..6edb651b38 100644 --- a/tests/mpi/solution_transfer_04.cc +++ b/tests/mpi/solution_transfer_04.cc @@ -52,7 +52,7 @@ test() hp::FECollection 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(max_degree - i)); diff --git a/tests/optimization/step-44.h b/tests/optimization/step-44.h index 3a454914d5..d5f27ed881 100644 --- a/tests/optimization/step-44.h +++ b/tests/optimization/step-44.h @@ -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( + 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( 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( + 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(tangent_matrix.block(J_dof, p_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> 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(tangent_matrix.block(u_dof, u_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> solver_K_con_inv; diff --git a/tests/physics/step-44-standard_tensors-material_push_forward.cc b/tests/physics/step-44-standard_tensors-material_push_forward.cc index d85406177f..dbe238c94a 100644 --- a/tests/physics/step-44-standard_tensors-material_push_forward.cc +++ b/tests/physics/step-44-standard_tensors-material_push_forward.cc @@ -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( + 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(tangent_matrix.block(J_dof, p_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> 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(tangent_matrix.block(u_dof, u_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> solver_K_con_inv; diff --git a/tests/physics/step-44-standard_tensors-spatial.cc b/tests/physics/step-44-standard_tensors-spatial.cc index b5dd3777b4..2414e99529 100644 --- a/tests/physics/step-44-standard_tensors-spatial.cc +++ b/tests/physics/step-44-standard_tensors-spatial.cc @@ -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( + 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(tangent_matrix.block(J_dof, p_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> 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(tangent_matrix.block(u_dof, u_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> solver_K_con_inv; diff --git a/tests/physics/step-44.cc b/tests/physics/step-44.cc index 4be51ee71d..250f6556a3 100644 --- a/tests/physics/step-44.cc +++ b/tests/physics/step-44.cc @@ -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( + 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(tangent_matrix.block(J_dof, p_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> 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(tangent_matrix.block(u_dof, u_dof).m() * + parameters.max_iterations_lin), 1.0e-30, parameters.tol_lin); SolverSelector> solver_K_con_inv; diff --git a/tests/sharedtria/mg_dof_01.cc b/tests/sharedtria/mg_dof_01.cc index 9961fa1192..9918d477c2 100644 --- a/tests/sharedtria/mg_dof_01.cc +++ b/tests/sharedtria/mg_dof_01.cc @@ -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(); diff --git a/tests/slepc/step-36_parallel.cc b/tests/slepc/step-36_parallel.cc index 520e6eb0c7..a25868fb6a 100644 --- a/tests/slepc/step-36_parallel.cc +++ b/tests/slepc/step-36_parallel.cc @@ -94,7 +94,7 @@ test(std::string solver_name, std::string preconditioner_name) const dealii::Point ¢er = cell->center(); const double x = center[0]; - const unsigned int id = std::floor((x - x0) / dL); + const auto id = static_cast((x - x0) / dL); cell->set_subdomain_id(id); } } diff --git a/tests/slepc/step-36_parallel_03.cc b/tests/slepc/step-36_parallel_03.cc index cdb2068806..36c5c196ec 100644 --- a/tests/slepc/step-36_parallel_03.cc +++ b/tests/slepc/step-36_parallel_03.cc @@ -94,7 +94,7 @@ test(std::string solver_name, std::string preconditioner_name) const dealii::Point ¢er = cell->center(); const double x = center[0]; - const unsigned int id = std::floor((x - x0) / dL); + const auto id = static_cast((x - x0) / dL); cell->set_subdomain_id(id); } }