From 50d7658c4a6c77122df27bb0f726e94e96e57650 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 30 May 2018 20:57:21 +0200 Subject: [PATCH] Fix warnings in tests, gcc-8 --- tests/base/function_parser_04.cc | 2 +- tests/base/functions_constant_function_00.cc | 6 ++-- tests/base/utilities_pack_unpack_06.cc | 8 ++--- tests/bits/find_cell_13.cc | 2 +- ...ergrid_transfer_representation_parallel.cc | 2 +- tests/dofs/dof_tools_04.cc | 6 ++-- tests/dofs/dof_tools_04a.cc | 6 ++-- tests/dofs/range_based_for_tria.cc | 2 +- tests/fe/fe_series_04.cc | 4 +-- tests/full_matrix/full_matrix_invert_01.cc | 4 +-- tests/grid/enclosing_sphere_01.cc | 2 +- tests/grid/measure_of_3d_face_01.cc | 2 +- tests/grid/real_to_unit_cell_affine_approx.cc | 2 +- tests/grid/refine_and_coarsen_fixed_number.cc | 4 +-- tests/lac/vector_memory.cc | 2 +- tests/mappings/mapping_q_eulerian_08.cc | 4 +-- .../mapping_real_to_unit_q1_singular.cc | 2 +- tests/matrix_free/interpolate_to_mg.cc | 4 +-- tests/matrix_free/stokes_computation.cc | 2 +- tests/mpi/collective_02_dealii_vector.cc | 4 +-- .../collective_02_dealii_vector_in_place.cc | 4 +-- tests/mpi/parallel_partitioner_06.cc | 2 +- tests/mpi/parallel_partitioner_07.cc | 2 +- tests/mpi/parallel_vector_18.cc | 4 +-- tests/mpi/trilinos_ghost_03_linfty.cc | 2 +- tests/mpi/trilinos_sadd_01.cc | 8 ++--- tests/numerics/project_to_surface_02.cc | 29 ++++++++++++++--- tests/numerics/project_to_surface_03.cc | 29 ++++++++++++++--- tests/petsc_complex/vector_02.cc | 2 +- tests/trilinos/amg_nondeterministic_02.cc | 4 +-- tests/trilinos/precondition.cc | 32 +++++++++---------- 31 files changed, 115 insertions(+), 73 deletions(-) diff --git a/tests/base/function_parser_04.cc b/tests/base/function_parser_04.cc index d3a92539fc..bf3adba7a2 100644 --- a/tests/base/function_parser_04.cc +++ b/tests/base/function_parser_04.cc @@ -82,7 +82,7 @@ test2() copy_data()); std::cout << "result: " << result << std::endl; - Assert(result == v.size(), ExcMessage("uhuh!")); + Assert((unsigned int)result == v.size(), ExcMessage("uhuh!")); } diff --git a/tests/base/functions_constant_function_00.cc b/tests/base/functions_constant_function_00.cc index 5b90088c4b..bccc7ed443 100644 --- a/tests/base/functions_constant_function_00.cc +++ b/tests/base/functions_constant_function_00.cc @@ -76,14 +76,14 @@ test_one_object(const TESTEE &f, deallog << std::endl; std::vector return_values(n_points); f.value_list(points, return_values /*, component = 0*/); - for (int i = 0; i < n_points; ++i) + for (unsigned int i = 0; i < n_points; ++i) { deallog << return_values[i] << ' '; } deallog << std::endl; f.value_list(points, return_values, std::min(n_component - 1, 3u)); - for (int i = 0; i < n_points; ++i) + for (unsigned int i = 0; i < n_points; ++i) { deallog << return_values[i] << ' '; } @@ -96,7 +96,7 @@ test_one_object(const TESTEE &f, std::vector> return_values(n_points, Vector(n_component)); f.vector_value_list(points, return_values); - for (int p = 0; p < n_points; ++p) + for (unsigned int p = 0; p < n_points; ++p) { for (unsigned int c = 0; c < n_component; ++c) deallog << return_values[p][c] << ' '; diff --git a/tests/base/utilities_pack_unpack_06.cc b/tests/base/utilities_pack_unpack_06.cc index d75593708f..2a1e2a64da 100644 --- a/tests/base/utilities_pack_unpack_06.cc +++ b/tests/base/utilities_pack_unpack_06.cc @@ -120,7 +120,7 @@ check(const double (&array)[N], const Point(&point)) Point forbidden = Utilities::unpack>( point_compressed.cbegin(), point_compressed.cend(), false); } - catch (boost::archive::archive_exception) + catch (const boost::archive::archive_exception &) { deallog << "unpacking compressed point without decompression failed!" << std::endl; @@ -131,7 +131,7 @@ check(const double (&array)[N], const Point(&point)) Utilities::unpack( array_compressed.cbegin(), array_compressed.cend(), forbidden, false); } - catch (boost::archive::archive_exception) + catch (const boost::archive::archive_exception &) { deallog << "unpacking compressed array without decompression failed!" << std::endl; @@ -142,7 +142,7 @@ check(const double (&array)[N], const Point(&point)) Point forbidden = Utilities::unpack>( point_uncompressed.cbegin(), point_uncompressed.cend(), true); } - catch (boost::archive::archive_exception) + catch (const boost::archive::archive_exception &) { deallog << "unpacking uncompressed point with decompression failed!" << std::endl; @@ -155,7 +155,7 @@ check(const double (&array)[N], const Point(&point)) forbidden, true); } - catch (boost::archive::archive_exception) + catch (const boost::archive::archive_exception &) { deallog << "unpacking uncompressed array with decompression failed!" << std::endl; diff --git a/tests/bits/find_cell_13.cc b/tests/bits/find_cell_13.cc index 4629c026ed..5be937c302 100644 --- a/tests/bits/find_cell_13.cc +++ b/tests/bits/find_cell_13.cc @@ -64,7 +64,7 @@ void check(Triangulation<2> &tria) << " Point: " << p; deallog << std::endl; // Flush deallog buffer } - catch (GridTools::ExcPointNotFound<2>) + catch (const GridTools::ExcPointNotFound<2> &) { deallog << "The first call to the function find_closest_vertex() has thrown " diff --git a/tests/distributed_grids/intergrid_transfer_representation_parallel.cc b/tests/distributed_grids/intergrid_transfer_representation_parallel.cc index a58eeed826..95dceb4331 100644 --- a/tests/distributed_grids/intergrid_transfer_representation_parallel.cc +++ b/tests/distributed_grids/intergrid_transfer_representation_parallel.cc @@ -67,7 +67,7 @@ test(unsigned n_refinements) // do some local refinement Point p0; p0 *= 0.; - for (int i = 0; i < n_refinements; ++i) + for (unsigned int i = 0; i < n_refinements; ++i) { typename Triangulation::active_cell_iterator cell; for (cell = tria2.begin_active(); cell != tria2.end(); ++cell) diff --git a/tests/dofs/dof_tools_04.cc b/tests/dofs/dof_tools_04.cc index 44a438c780..8f480e5c7f 100644 --- a/tests/dofs/dof_tools_04.cc +++ b/tests/dofs/dof_tools_04.cc @@ -39,9 +39,9 @@ check_this(const DoFHandler &dof_handler) if (hanging_node_dofs[dof]) AssertThrow(constraints.is_constrained(dof), ExcInternalError()); - AssertThrow(std::count(hanging_node_dofs.begin(), - hanging_node_dofs.end(), - true) == constraints.n_constraints(), + AssertThrow((unsigned int)std::count(hanging_node_dofs.begin(), + hanging_node_dofs.end(), + true) == constraints.n_constraints(), ExcInternalError()); output_bool_vector(hanging_node_dofs); } diff --git a/tests/dofs/dof_tools_04a.cc b/tests/dofs/dof_tools_04a.cc index 4bf9e4db3f..c5d2f468b6 100644 --- a/tests/dofs/dof_tools_04a.cc +++ b/tests/dofs/dof_tools_04a.cc @@ -64,9 +64,9 @@ check_this(const DoFHandler &dof_handler) if (is_hanging_node_constrained[dof]) AssertThrow(constraints.is_constrained(dof), ExcInternalError()); - AssertThrow(std::count(is_hanging_node_constrained.begin(), - is_hanging_node_constrained.end(), - true) == constraints.n_constraints(), + AssertThrow((unsigned int)(std::count(is_hanging_node_constrained.begin(), + is_hanging_node_constrained.end(), + true)) == constraints.n_constraints(), ExcInternalError()); deallog << "OK" << std::endl; diff --git a/tests/dofs/range_based_for_tria.cc b/tests/dofs/range_based_for_tria.cc index 44bf5a5c15..c27b54c18f 100644 --- a/tests/dofs/range_based_for_tria.cc +++ b/tests/dofs/range_based_for_tria.cc @@ -61,7 +61,7 @@ check() for (auto cell : tr.cell_iterators()) AssertThrow((cell->user_flag_set() == !cell->has_children()) || - (l != cell->level()), + (l != (unsigned int)cell->level()), ExcInternalError()); } diff --git a/tests/fe/fe_series_04.cc b/tests/fe/fe_series_04.cc index fccf4e9ae6..9e3705f02c 100644 --- a/tests/fe/fe_series_04.cc +++ b/tests/fe/fe_series_04.cc @@ -165,8 +165,8 @@ test_legendre_orthonormal(const unsigned int N) QGauss quadrature(8); deallog << "orthogonality: " << std::endl; - for (int k1 = 0; k1 < N; k1++) - for (int k2 = 0; k2 < N; k2++) + for (unsigned int k1 = 0; k1 < N; k1++) + for (unsigned int k2 = 0; k2 < N; k2++) { double ortho = 0; for (unsigned int q = 0; q < quadrature.size(); ++q) diff --git a/tests/full_matrix/full_matrix_invert_01.cc b/tests/full_matrix/full_matrix_invert_01.cc index 283b71ff7e..b7a7a614bc 100644 --- a/tests/full_matrix/full_matrix_invert_01.cc +++ b/tests/full_matrix/full_matrix_invert_01.cc @@ -100,8 +100,8 @@ template void check() { - int nFails = 0; - int maxDim = 10; + unsigned int nFails = 0; + unsigned int maxDim = 10; for (unsigned int i = 1; i <= maxDim; ++i) { for (unsigned int j = 1; j <= maxDim; ++j) diff --git a/tests/grid/enclosing_sphere_01.cc b/tests/grid/enclosing_sphere_01.cc index d057035b8e..d6f69915aa 100644 --- a/tests/grid/enclosing_sphere_01.cc +++ b/tests/grid/enclosing_sphere_01.cc @@ -193,7 +193,7 @@ test() // Check that all the vertices are within the sphere // (sphere with thickness 100. *std::numeric_limits::epsilon()) - for (int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) AssertThrow(std::fabs(center.distance(tria.begin_active()->vertex(v))) < radius + 100. * std::numeric_limits::epsilon(), ExcInternalError()); diff --git a/tests/grid/measure_of_3d_face_01.cc b/tests/grid/measure_of_3d_face_01.cc index 29141f90d7..9ffa95ad9e 100644 --- a/tests/grid/measure_of_3d_face_01.cc +++ b/tests/grid/measure_of_3d_face_01.cc @@ -42,7 +42,7 @@ Point<3> distort_planar(Point<3> p) // a saddle surface Point<3> distort_twisted(Point<3> p) { - if (p(2) > 0.5 && (p(0) > 0.5 ^ p(1) > 0.5)) + if (p(2) > 0.5 && ((p(0) > 0.5) ^ (p(1) > 0.5))) { p(2) += 1; } diff --git a/tests/grid/real_to_unit_cell_affine_approx.cc b/tests/grid/real_to_unit_cell_affine_approx.cc index e82f2c68ea..575fa99f56 100644 --- a/tests/grid/real_to_unit_cell_affine_approx.cc +++ b/tests/grid/real_to_unit_cell_affine_approx.cc @@ -49,7 +49,7 @@ do_test(const Triangulation &tria, const Point &p) deallog << mapping_point[d] << " "; deallog << std::endl; } - catch (typename Mapping::ExcTransformationFailed) + catch (const typename Mapping::ExcTransformationFailed &) { deallog << "No MappingQ transform possible for this cell and point." << std::endl; diff --git a/tests/grid/refine_and_coarsen_fixed_number.cc b/tests/grid/refine_and_coarsen_fixed_number.cc index 71365944c0..aec7f0a5e9 100644 --- a/tests/grid/refine_and_coarsen_fixed_number.cc +++ b/tests/grid/refine_and_coarsen_fixed_number.cc @@ -37,7 +37,7 @@ main(int argc, const char *argv[]) tria.refine_global(4); Vector indicator(tria.n_active_cells()); - for (int i = 0; i != indicator.size(); ++i) + for (unsigned int i = 0; i != indicator.size(); ++i) { indicator[i] = i; } @@ -50,7 +50,7 @@ main(int argc, const char *argv[]) deallog << "n_active_cells: " << tria.n_active_cells() << std::endl; indicator.reinit(tria.n_active_cells()); - for (int i = 0; i != indicator.size(); ++i) + for (unsigned int i = 0; i != indicator.size(); ++i) { indicator[i] = i; } diff --git a/tests/lac/vector_memory.cc b/tests/lac/vector_memory.cc index 897fe2a42f..c076a2e660 100644 --- a/tests/lac/vector_memory.cc +++ b/tests/lac/vector_memory.cc @@ -81,7 +81,7 @@ main() test_leak>(); test_leak>(); } - catch (StandardExceptions::ExcMemoryLeak e) + catch (const StandardExceptions::ExcMemoryLeak &e) { deallog << "Exception: " << e.get_exc_name() << std::endl; } diff --git a/tests/mappings/mapping_q_eulerian_08.cc b/tests/mappings/mapping_q_eulerian_08.cc index 70304101db..90a229913e 100644 --- a/tests/mappings/mapping_q_eulerian_08.cc +++ b/tests/mappings/mapping_q_eulerian_08.cc @@ -139,8 +139,8 @@ test(const unsigned int n_ref = 0) cell != triangulation.end(); ++cell) if (cell->is_locally_owned() && - (cell->center().norm() < 0.5 && - (cell->level() < 5 || cell->center().norm() > 0.45) || + ((cell->center().norm() < 0.5 && + (cell->level() < 5 || cell->center().norm() > 0.45)) || (dim == 2 && cell->center().norm() > 1.2))) cell->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); diff --git a/tests/mappings/mapping_real_to_unit_q1_singular.cc b/tests/mappings/mapping_real_to_unit_q1_singular.cc index a074717dfe..a17f174a1b 100644 --- a/tests/mappings/mapping_real_to_unit_q1_singular.cc +++ b/tests/mappings/mapping_real_to_unit_q1_singular.cc @@ -49,7 +49,7 @@ test_real_to_unit_cell() { mapping.transform_real_to_unit_cell(cell, point); } - catch (typename Mapping::ExcTransformationFailed) + catch (const typename Mapping::ExcTransformationFailed &) { deallog << "Transformation for point " << point << " on cell with " << "center " << cell->center() << " is not invertible" diff --git a/tests/matrix_free/interpolate_to_mg.cc b/tests/matrix_free/interpolate_to_mg.cc index e105da5eb1..e1f50e0fa1 100644 --- a/tests/matrix_free/interpolate_to_mg.cc +++ b/tests/matrix_free/interpolate_to_mg.cc @@ -117,8 +117,8 @@ test(const unsigned int n_glob_ref = 2, const unsigned int n_ref = 0) cell != triangulation.end(); ++cell) if (cell->is_locally_owned() && - (cell->center().norm() < 0.5 && - (cell->level() < 5 || cell->center().norm() > 0.45) || + ((cell->center().norm() < 0.5 && + (cell->level() < 5 || cell->center().norm() > 0.45)) || (dim == 2 && cell->center().norm() > 1.2))) cell->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); diff --git a/tests/matrix_free/stokes_computation.cc b/tests/matrix_free/stokes_computation.cc index 8657c4c783..33dca32570 100644 --- a/tests/matrix_free/stokes_computation.cc +++ b/tests/matrix_free/stokes_computation.cc @@ -1356,7 +1356,7 @@ namespace StokesClass distributed_stokes_rhs, preconditioner_cheap); } - catch (SolverControl::NoConvergence) + catch (const SolverControl::NoConvergence &) { deallog << "********************************************************************" diff --git a/tests/mpi/collective_02_dealii_vector.cc b/tests/mpi/collective_02_dealii_vector.cc index 915b149dd7..5f40a01031 100644 --- a/tests/mpi/collective_02_dealii_vector.cc +++ b/tests/mpi/collective_02_dealii_vector.cc @@ -26,8 +26,8 @@ void test() { - unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); - const unsigned int numprocs = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); + const int numprocs = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); { Vector values(2); diff --git a/tests/mpi/collective_02_dealii_vector_in_place.cc b/tests/mpi/collective_02_dealii_vector_in_place.cc index ecb496c97b..b6e1d497a6 100644 --- a/tests/mpi/collective_02_dealii_vector_in_place.cc +++ b/tests/mpi/collective_02_dealii_vector_in_place.cc @@ -34,8 +34,8 @@ test() sums[0] = 1; sums[1] = 2; Utilities::MPI::sum(sums, MPI_COMM_WORLD, sums); - Assert(sums[0] == numprocs, ExcInternalError()); - Assert(sums[1] == 2 * numprocs, ExcInternalError()); + Assert((unsigned int)sums[0] == numprocs, ExcInternalError()); + Assert((unsigned int)sums[1] == 2 * numprocs, ExcInternalError()); if (myid == 0) deallog << sums[0] << ' ' << sums[1] << std::endl; diff --git a/tests/mpi/parallel_partitioner_06.cc b/tests/mpi/parallel_partitioner_06.cc index 2a57809a43..75884298de 100644 --- a/tests/mpi/parallel_partitioner_06.cc +++ b/tests/mpi/parallel_partitioner_06.cc @@ -83,7 +83,7 @@ test() IndexSet local_relevant_3(global_size); local_relevant_3.add_index(2); - if (myid > 0 < my_start) + if (myid > 0 && my_start > 0) local_relevant_3.add_range(my_start - 10, my_start); Utilities::MPI::Partitioner x(local_owned, MPI_COMM_WORLD); x.set_ghost_indices(local_relevant_3, v.ghost_indices()); diff --git a/tests/mpi/parallel_partitioner_07.cc b/tests/mpi/parallel_partitioner_07.cc index 28750e299c..2ccf7613cb 100644 --- a/tests/mpi/parallel_partitioner_07.cc +++ b/tests/mpi/parallel_partitioner_07.cc @@ -83,7 +83,7 @@ test() IndexSet local_relevant_3(global_size); local_relevant_3.add_index(2); - if (myid > 0 < my_start) + if (myid > 0 && my_start > 0) local_relevant_3.add_range(my_start - 10, my_start); Utilities::MPI::Partitioner x(local_owned, MPI_COMM_WORLD); x.set_ghost_indices(local_relevant_3, v.ghost_indices()); diff --git a/tests/mpi/parallel_vector_18.cc b/tests/mpi/parallel_vector_18.cc index bd045df586..2dff270855 100644 --- a/tests/mpi/parallel_vector_18.cc +++ b/tests/mpi/parallel_vector_18.cc @@ -54,8 +54,8 @@ test() // set local values if (myid < 8) { - types::global_dof_index n_elements = 2; - types::global_dof_index indices[n_elements]; + constexpr types::global_dof_index n_elements = 2; + types::global_dof_index indices[n_elements]; indices[0] = myid * 2; indices[1] = myid * 2 + 1; float values[2]; diff --git a/tests/mpi/trilinos_ghost_03_linfty.cc b/tests/mpi/trilinos_ghost_03_linfty.cc index 322a9bca5f..90ad57a236 100644 --- a/tests/mpi/trilinos_ghost_03_linfty.cc +++ b/tests/mpi/trilinos_ghost_03_linfty.cc @@ -65,7 +65,7 @@ test() { norm = v_tmp.linfty_norm(); } - catch (TrilinosWrappers::MPI::Vector::ExcTrilinosError e) + catch (const TrilinosWrappers::MPI::Vector::ExcTrilinosError &e) { deallog << e.get_exc_name() << std::endl; exc = true; diff --git a/tests/mpi/trilinos_sadd_01.cc b/tests/mpi/trilinos_sadd_01.cc index c80478cdd5..33310ecc1e 100644 --- a/tests/mpi/trilinos_sadd_01.cc +++ b/tests/mpi/trilinos_sadd_01.cc @@ -67,19 +67,19 @@ test() if (my_id == 0) { deallog << "Distributed:" << std::endl; - for (unsigned int i = begin_index; i < end_index; ++i) + for (int i = begin_index; i < end_index; ++i) deallog << i << ": " << distributed(i) << std::endl; deallog << "Ghosted:" << std::endl; - for (unsigned int i = local_begin; i < local_end; ++i) + for (int i = local_begin; i < local_end; ++i) deallog << i << ": " << ghosted(i) << std::endl; } // verify correct value - for (unsigned int i = begin_index; i < end_index; ++i) + for (int i = begin_index; i < end_index; ++i) Assert(distributed(i) == 3, ExcInternalError()); - for (unsigned int i = local_begin; i < local_end; ++i) + for (int i = local_begin; i < local_end; ++i) Assert(ghosted(i) == 3, ExcInternalError()); } diff --git a/tests/numerics/project_to_surface_02.cc b/tests/numerics/project_to_surface_02.cc index 3f3df450f9..97b8c78e32 100644 --- a/tests/numerics/project_to_surface_02.cc +++ b/tests/numerics/project_to_surface_02.cc @@ -77,6 +77,30 @@ create_triangulation(const bool rotate, Triangulation &tria) do_rotate(tria); } +template +typename Triangulation::quad_iterator +get_quad_iterator(const typename Triangulation::active_cell_iterator &cell, + const unsigned int quad); + +template <> +typename Triangulation<2>::quad_iterator +get_quad_iterator<2>( + const typename Triangulation<2>::active_cell_iterator &cell, + const unsigned int /*quad*/) +{ + return *reinterpret_cast::quad_iterator *>( + &cell); +} + +template <> +typename Triangulation<3>::quad_iterator +get_quad_iterator<3>( + const typename Triangulation<3>::active_cell_iterator &cell, + const unsigned int quad) +{ + return cell->quad(quad); +} + template void @@ -100,10 +124,7 @@ test() for (unsigned int e = 0; e < GeometryInfo::quads_per_cell; ++e) { const typename Triangulation::quad_iterator quad = - (dim > 2 ? - cell->quad(e) : - *reinterpret_cast< - const typename Triangulation::quad_iterator *>(&cell)); + get_quad_iterator(cell, e); deallog << " Quad " << e << ", projected point="; diff --git a/tests/numerics/project_to_surface_03.cc b/tests/numerics/project_to_surface_03.cc index af20d423d9..0ebeb57dbf 100644 --- a/tests/numerics/project_to_surface_03.cc +++ b/tests/numerics/project_to_surface_03.cc @@ -30,6 +30,30 @@ #include "../tests.h" +template +typename Triangulation::quad_iterator +get_quad_iterator(const typename Triangulation::active_cell_iterator &cell, + const unsigned int quad); + +template <> +typename Triangulation<2>::quad_iterator +get_quad_iterator<2>( + const typename Triangulation<2>::active_cell_iterator &cell, + const unsigned int /*quad*/) +{ + return *reinterpret_cast::quad_iterator *>( + &cell); +} + +template <> +typename Triangulation<3>::quad_iterator +get_quad_iterator<3>( + const typename Triangulation<3>::active_cell_iterator &cell, + const unsigned int quad) +{ + return cell->quad(quad); +} + template void @@ -67,10 +91,7 @@ test() for (unsigned int e = 0; e < GeometryInfo::quads_per_cell; ++e) { const typename Triangulation::quad_iterator quad = - (dim > 2 ? - cell->quad(e) : - *reinterpret_cast< - const typename Triangulation::quad_iterator *>(&cell)); + get_quad_iterator(cell, e); deallog << " Quad " << e << ", projected point="; diff --git a/tests/petsc_complex/vector_02.cc b/tests/petsc_complex/vector_02.cc index 8f03ce5197..7ccfadd414 100644 --- a/tests/petsc_complex/vector_02.cc +++ b/tests/petsc_complex/vector_02.cc @@ -37,7 +37,7 @@ test() v.compress(VectorOperation::insert); PETScWrappers::MPI::Vector v2(MPI_COMM_WORLD, s, s); - for (int k = 0; k < v2.size(); ++k) + for (int k = 0; (unsigned int)k < v2.size(); ++k) v2(k) = PetscScalar(k, -k); v2.compress(VectorOperation::insert); diff --git a/tests/trilinos/amg_nondeterministic_02.cc b/tests/trilinos/amg_nondeterministic_02.cc index 1eef81cb3c..29e28035ad 100644 --- a/tests/trilinos/amg_nondeterministic_02.cc +++ b/tests/trilinos/amg_nondeterministic_02.cc @@ -523,7 +523,7 @@ run() for (unsigned int i = 0; i < n; ++i) sp.add(mati[i], matj[i]); - for (unsigned int i = 0; i < dim; ++i) + for (int i = 0; i < dim; ++i) sp.add(i, i); sp.compress(); @@ -533,7 +533,7 @@ run() TrilinosWrappers::MPI::Vector x2(owned, MPI_COMM_WORLD); TrilinosWrappers::MPI::Vector b(owned, MPI_COMM_WORLD); - for (unsigned int i = 0; i < dim; ++i) + for (int i = 0; i < dim; ++i) mat.set(i, i, 1.0); diff --git a/tests/trilinos/precondition.cc b/tests/trilinos/precondition.cc index 2fb6980c98..2c53625abe 100644 --- a/tests/trilinos/precondition.cc +++ b/tests/trilinos/precondition.cc @@ -222,8 +222,8 @@ Step4::solve(int cycle) { deallog.push("Jacobi"); - static constexpr std::array lower{49, 100}; - TrilinosWrappers::PreconditionJacobi preconditioner; + static constexpr std::array lower{49, 100}; + TrilinosWrappers::PreconditionJacobi preconditioner; solution = 0; SolverControl solver_control(1000, 1e-10); SolverCG<> solver(solver_control); @@ -238,8 +238,8 @@ Step4::solve(int cycle) { deallog.push("SSOR"); - static constexpr std::array lower{40, 77}; - TrilinosWrappers::PreconditionSSOR preconditioner; + static constexpr std::array lower{40, 77}; + TrilinosWrappers::PreconditionSSOR preconditioner; solution = 0; SolverControl solver_control(1000, 1e-10); SolverCG<> solver(solver_control); @@ -254,8 +254,8 @@ Step4::solve(int cycle) { deallog.push("SOR"); - static constexpr std::array lower{31, 62}; - TrilinosWrappers::PreconditionSOR preconditioner; + static constexpr std::array lower{31, 62}; + TrilinosWrappers::PreconditionSOR preconditioner; solution = 0; SolverControl solver_control(1000, 1e-5); SolverBicgstab<> solver(solver_control); @@ -270,7 +270,7 @@ Step4::solve(int cycle) { deallog.push("BlockJacobi"); - static constexpr std::array lower{73, 145}; + static constexpr std::array lower{73, 145}; TrilinosWrappers::PreconditionBlockJacobi preconditioner; TrilinosWrappers::PreconditionBlockJacobi::AdditionalData data; data.block_size = 16; @@ -288,7 +288,7 @@ Step4::solve(int cycle) { deallog.push("BlockSSOR"); - static constexpr std::array lower{30, 59}; + static constexpr std::array lower{30, 59}; TrilinosWrappers::PreconditionBlockSSOR preconditioner; TrilinosWrappers::PreconditionBlockSSOR::AdditionalData data; data.block_size = 16; @@ -307,7 +307,7 @@ Step4::solve(int cycle) { deallog.push("BlockSOR"); - static constexpr std::array lower{18, 37}; + static constexpr std::array lower{18, 37}; TrilinosWrappers::PreconditionBlockSOR preconditioner; TrilinosWrappers::PreconditionBlockSOR::AdditionalData data; data.block_size = 16; @@ -326,8 +326,8 @@ Step4::solve(int cycle) { deallog.push("IC"); - static constexpr std::array lower{49, 67}; - TrilinosWrappers::PreconditionIC preconditioner; + static constexpr std::array lower{49, 67}; + TrilinosWrappers::PreconditionIC preconditioner; solution = 0; SolverControl solver_control(1000, 1e-10); SolverCG<> solver(solver_control); @@ -341,7 +341,7 @@ Step4::solve(int cycle) } { - static constexpr std::array lower{30, 56}; + static constexpr std::array lower{30, 56}; deallog.push("ILU"); TrilinosWrappers::PreconditionILU preconditioner; solution = 0; @@ -358,7 +358,7 @@ Step4::solve(int cycle) { deallog.push("ILUT"); - static constexpr std::array lower{11, 19}; + static constexpr std::array lower{11, 19}; TrilinosWrappers::PreconditionILUT preconditioner; TrilinosWrappers::PreconditionILUT::AdditionalData data; data.ilut_drop = 1e-6; @@ -377,7 +377,7 @@ Step4::solve(int cycle) { deallog.push("Chebyshev"); - static constexpr std::array lower{23, 46}; + static constexpr std::array lower{23, 46}; TrilinosWrappers::PreconditionChebyshev preconditioner; TrilinosWrappers::PreconditionChebyshev::AdditionalData data; data.max_eigenvalue = 2.5; @@ -404,8 +404,8 @@ Step4::solve(int cycle) check_solver_within_range( solver.solve(system_matrix, solution, system_rhs, preconditioner), solver_control.last_step(), - 1, - 1); + 1U, + 1U); deallog.pop(); } -- 2.39.5