From a70e0d2fbfaea6d852f72a18c3ae25e7f9a59f30 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 21 Aug 2023 20:43:03 -0600 Subject: [PATCH] Standardize on 'const X' instead of 'X const'. --- include/deal.II/base/cuda.h | 2 +- include/deal.II/base/partitioner.templates.h | 8 +++---- include/deal.II/base/template_constraints.h | 4 ++-- include/deal.II/fe/fe_tools.templates.h | 2 +- include/deal.II/lac/block_vector_base.h | 4 ++-- include/deal.II/lac/petsc_matrix_base.h | 8 +++---- include/deal.II/lac/precondition.h | 18 +++++++------- include/deal.II/lac/scalapack.templates.h | 2 +- include/deal.II/lac/solver_cg.h | 6 ++--- include/deal.II/lac/sparse_matrix_tools.h | 4 ++-- include/deal.II/matrix_free/type_traits.h | 10 ++++---- .../mg_transfer_global_coarsening.templates.h | 2 +- .../numerics/matrix_creator.templates.h | 24 +++++++++---------- include/deal.II/numerics/rtree.h | 16 ++++++------- .../vector_tools_boundary.templates.h | 2 +- source/base/polynomial.cc | 2 +- source/distributed/field_transfer.cc | 2 +- source/distributed/p4est_wrappers.cc | 4 ++-- source/dofs/dof_accessor_set.cc | 2 +- source/grid/grid_generator.cc | 2 +- source/grid/grid_tools.cc | 4 ++-- source/numerics/derivative_approximation.cc | 4 ++-- source/particles/generators.cc | 2 +- tests/base/graph_coloring_01.cc | 4 ++-- tests/base/graph_coloring_02.cc | 4 ++-- tests/base/graph_coloring_02a.cc | 4 ++-- tests/base/graph_coloring_03.cc | 4 ++-- tests/base/graph_coloring_05.cc | 4 ++-- tests/base/graph_coloring_06.cc | 4 ++-- tests/base/mpi_some_to_some_01.cc | 2 +- .../mappings/mapping_get_vertices_on_face.cc | 4 ++-- tests/matrix_free/matrix_vector_rt_04.cc | 2 +- tests/matrix_free/matrix_vector_rt_face_04.cc | 2 +- tests/numerics/assemble_matrix_parallel_01.cc | 6 ++--- tests/numerics/assemble_matrix_parallel_02.cc | 6 ++--- tests/numerics/assemble_matrix_parallel_03.cc | 6 ++--- tests/numerics/assemble_matrix_parallel_04.cc | 6 ++--- tests/petsc/assemble_matrix_parallel_01.cc | 6 ++--- tests/trilinos/assemble_matrix_parallel_01.cc | 6 ++--- 39 files changed, 102 insertions(+), 102 deletions(-) diff --git a/include/deal.II/base/cuda.h b/include/deal.II/base/cuda.h index 07baabae98..b85646807f 100644 --- a/include/deal.II/base/cuda.h +++ b/include/deal.II/base/cuda.h @@ -51,7 +51,7 @@ namespace Utilities /** * Copy constructor is deleted. */ - Handle(Handle const &) = delete; + Handle(const Handle &) = delete; /** * Destructor. Destroy the handles. diff --git a/include/deal.II/base/partitioner.templates.h b/include/deal.II/base/partitioner.templates.h index 978a6c4089..38db3728be 100644 --- a/include/deal.II/base/partitioner.templates.h +++ b/include/deal.II/base/partitioner.templates.h @@ -599,7 +599,7 @@ namespace Utilities { if (vector_operation == VectorOperation::add) { - for (auto const &import_indices_plain : + for (const auto &import_indices_plain : import_indices_plain_dev) { const auto chunk_size = import_indices_plain.size(); @@ -623,7 +623,7 @@ namespace Utilities } else if (vector_operation == VectorOperation::min) { - for (auto const &import_indices_plain : + for (const auto &import_indices_plain : import_indices_plain_dev) { const auto chunk_size = import_indices_plain.size(); @@ -650,7 +650,7 @@ namespace Utilities } else if (vector_operation == VectorOperation::max) { - for (auto const &import_indices_plain : + for (const auto &import_indices_plain : import_indices_plain_dev) { const auto chunk_size = import_indices_plain.size(); @@ -677,7 +677,7 @@ namespace Utilities } else { - for (auto const &import_indices_plain : + for (const auto &import_indices_plain : import_indices_plain_dev) { // We can't easily assert here, so we just move the diff --git a/include/deal.II/base/template_constraints.h b/include/deal.II/base/template_constraints.h index af593ce065..8b7cd96591 100644 --- a/include/deal.II/base/template_constraints.h +++ b/include/deal.II/base/template_constraints.h @@ -94,9 +94,9 @@ namespace internal struct nonesuch : private nonesuch_base { ~nonesuch() = delete; - nonesuch(nonesuch const &) = delete; + nonesuch(const nonesuch &) = delete; void - operator=(nonesuch const &) = delete; + operator=(const nonesuch &) = delete; }; template class Op, class... Args> diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index d20c98b433..f1798a2fc8 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -1813,7 +1813,7 @@ namespace FETools // sufficiently large so that there // are more than about 5000 // operations in the inner loop - // (which is basically const * n^2 + // (which is const basically * n^2 // operations). if (n > 30) { diff --git a/include/deal.II/lac/block_vector_base.h b/include/deal.II/lac/block_vector_base.h index 45884ba276..7be2547c0d 100644 --- a/include/deal.II/lac/block_vector_base.h +++ b/include/deal.II/lac/block_vector_base.h @@ -47,13 +47,13 @@ DEAL_II_NAMESPACE_OPEN namespace internal { template - using has_block_t = decltype(std::declval().block(0)); + using has_block_t = decltype(std::declval().block(0)); template constexpr bool has_block = internal::is_supported_operation; template - using has_n_blocks_t = decltype(std::declval().n_blocks()); + using has_n_blocks_t = decltype(std::declval().n_blocks()); template constexpr bool has_n_blocks = diff --git a/include/deal.II/lac/petsc_matrix_base.h b/include/deal.II/lac/petsc_matrix_base.h index 80e9ffca43..da3c17591b 100644 --- a/include/deal.II/lac/petsc_matrix_base.h +++ b/include/deal.II/lac/petsc_matrix_base.h @@ -1342,9 +1342,9 @@ namespace PETScWrappers prepare_action(VectorOperation::insert); const PetscInt petsc_i = row; - PetscInt const *col_index_ptr; + const PetscInt *col_index_ptr; - PetscScalar const *col_value_ptr; + const PetscScalar *col_value_ptr; int n_columns; // If we don't elide zeros, the pointers are already available... @@ -1486,9 +1486,9 @@ namespace PETScWrappers prepare_action(VectorOperation::add); const PetscInt petsc_i = row; - PetscInt const *col_index_ptr; + const PetscInt *col_index_ptr; - PetscScalar const *col_value_ptr; + const PetscScalar *col_value_ptr; int n_columns; // If we don't elide zeros, the pointers are already available... diff --git a/include/deal.II/lac/precondition.h b/include/deal.II/lac/precondition.h index a0cb0f2eec..1a5146224f 100644 --- a/include/deal.II/lac/precondition.h +++ b/include/deal.II/lac/precondition.h @@ -530,7 +530,7 @@ namespace internal // ... MatrixType::vmult(VectorType &, const VectorType&, // std::function<...>, std::function<...>) const template - using vmult_functions_t = decltype(std::declval().vmult( + using vmult_functions_t = decltype(std::declval().vmult( std::declval(), std::declval(), std::declval< @@ -560,7 +560,7 @@ namespace internal { template using Tvmult_t = decltype( - std::declval().Tvmult(std::declval(), + std::declval().Tvmult(std::declval(), std::declval())); template @@ -568,7 +568,7 @@ namespace internal template using step_t = decltype( - std::declval().step(std::declval(), + std::declval().step(std::declval(), std::declval())); template @@ -576,7 +576,7 @@ namespace internal template using step_omega_t = - decltype(std::declval().step(std::declval(), + decltype(std::declval().step(std::declval(), std::declval(), std::declval())); @@ -586,7 +586,7 @@ namespace internal template using Tstep_t = decltype( - std::declval().Tstep(std::declval(), + std::declval().Tstep(std::declval(), std::declval())); template @@ -594,7 +594,7 @@ namespace internal template using Tstep_omega_t = - decltype(std::declval().Tstep(std::declval(), + decltype(std::declval().Tstep(std::declval(), std::declval(), std::declval())); @@ -604,7 +604,7 @@ namespace internal template using jacobi_step_t = decltype( - std::declval().Jacobi_step(std::declval(), + std::declval().Jacobi_step(std::declval(), std::declval(), std::declval())); @@ -614,7 +614,7 @@ namespace internal template using SOR_step_t = decltype( - std::declval().SOR_step(std::declval(), + std::declval().SOR_step(std::declval(), std::declval(), std::declval())); @@ -624,7 +624,7 @@ namespace internal template using SSOR_step_t = decltype( - std::declval().SSOR_step(std::declval(), + std::declval().SSOR_step(std::declval(), std::declval(), std::declval())); diff --git a/include/deal.II/lac/scalapack.templates.h b/include/deal.II/lac/scalapack.templates.h index 413577eca0..f2503345bd 100644 --- a/include/deal.II/lac/scalapack.templates.h +++ b/include/deal.II/lac/scalapack.templates.h @@ -505,7 +505,7 @@ extern "C" * norm, or the element of largest absolute value of a distributed matrix */ double - pdlange_(char const * norm, + pdlange_(const char * norm, const int * m, const int * n, const double *A, diff --git a/include/deal.II/lac/solver_cg.h b/include/deal.II/lac/solver_cg.h index 8099ffbbcf..95287056f3 100644 --- a/include/deal.II/lac/solver_cg.h +++ b/include/deal.II/lac/solver_cg.h @@ -656,7 +656,7 @@ namespace internal // ... MatrixType::vmult(VectorType &, const VectorType&, // std::function<...>, std::function<...>) const template - using vmult_functions_t = decltype(std::declval().vmult( + using vmult_functions_t = decltype(std::declval().vmult( std::declval(), std::declval(), std::declval< @@ -673,7 +673,7 @@ namespace internal // unsigned int, const unsigned int, const Number*, Number*) const template using apply_to_subrange_t = - decltype(std::declval() + decltype(std::declval() .apply_to_subrange(0U, 0U, nullptr, nullptr)); template @@ -685,7 +685,7 @@ namespace internal // unsigned int, const Number) const template using apply_t = - decltype(std::declval().apply(0U, 0.0)); + decltype(std::declval().apply(0U, 0.0)); template constexpr bool has_apply = diff --git a/include/deal.II/lac/sparse_matrix_tools.h b/include/deal.II/lac/sparse_matrix_tools.h index 1e004c275f..cee81e6a05 100644 --- a/include/deal.II/lac/sparse_matrix_tools.h +++ b/include/deal.II/lac/sparse_matrix_tools.h @@ -170,14 +170,14 @@ namespace SparseMatrixTools template using get_mpi_communicator_t = - decltype(std::declval().get_mpi_communicator()); + decltype(std::declval().get_mpi_communicator()); template constexpr bool has_get_mpi_communicator = dealii::internal::is_supported_operation; template - using local_size_t = decltype(std::declval().local_size()); + using local_size_t = decltype(std::declval().local_size()); template constexpr bool has_local_size = diff --git a/include/deal.II/matrix_free/type_traits.h b/include/deal.II/matrix_free/type_traits.h index bfdfb35365..265cb73e04 100644 --- a/include/deal.II/matrix_free/type_traits.h +++ b/include/deal.II/matrix_free/type_traits.h @@ -38,7 +38,7 @@ namespace internal // a helper type-trait that leverage SFINAE to figure out if type T has // ... T::local_element() const template - using local_element_t = decltype(std::declval().local_element(0)); + using local_element_t = decltype(std::declval().local_element(0)); template constexpr bool has_local_element = is_supported_operation; @@ -74,7 +74,7 @@ namespace internal // const template using partitioners_are_compatible_t = - decltype(std::declval().partitioners_are_compatible( + decltype(std::declval().partitioners_are_compatible( std::declval())); template @@ -86,7 +86,7 @@ namespace internal // same as above to check // ... T::begin() const template - using begin_t = decltype(std::declval().begin()); + using begin_t = decltype(std::declval().begin()); template constexpr bool has_begin = is_supported_operation; @@ -97,7 +97,7 @@ namespace internal // ... T::shared_vector_data() const template using shared_vector_data_t = - decltype(std::declval().shared_vector_data()); + decltype(std::declval().shared_vector_data()); template constexpr bool has_shared_vector_data = @@ -138,7 +138,7 @@ namespace internal // void T::update_ghost_values_start(const uint) const template using update_ghost_values_start_t = - decltype(std::declval().update_ghost_values_start(0)); + decltype(std::declval().update_ghost_values_start(0)); template constexpr bool has_update_ghost_values_start = diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h index 00b982228a..68a665829c 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -2000,7 +2000,7 @@ namespace internal } // ------------------------- prolongation matrix ------------------------- - for (auto const &fe_index_pair_ : fe_index_pairs) + for (const auto &fe_index_pair_ : fe_index_pairs) { const auto &fe_index_pair = fe_index_pair_.first; const auto &fe_index_no = fe_index_pair_.second; diff --git a/include/deal.II/numerics/matrix_creator.templates.h b/include/deal.II/numerics/matrix_creator.templates.h index 645f4239fe..46d7ee87d6 100644 --- a/include/deal.II/numerics/matrix_creator.templates.h +++ b/include/deal.II/numerics/matrix_creator.templates.h @@ -982,8 +982,8 @@ namespace MatrixCreator { template void static inline create_boundary_mass_matrix_1( - typename DoFHandler::active_cell_iterator const &cell, - MatrixCreator::internal::AssemblerBoundary::Scratch const &, + const typename DoFHandler::active_cell_iterator &cell, + const MatrixCreator::internal::AssemblerBoundary::Scratch &, MatrixCreator::internal::AssemblerBoundary:: CopyData & copy_data, Mapping const & mapping, @@ -1291,8 +1291,8 @@ namespace MatrixCreator template <> void inline create_boundary_mass_matrix_1<1, 3, float>( - DoFHandler<1, 3>::active_cell_iterator const & /*cell*/, - MatrixCreator::internal::AssemblerBoundary::Scratch const &, + const DoFHandler<1, 3>::active_cell_iterator & /*cell*/, + const MatrixCreator::internal::AssemblerBoundary::Scratch &, MatrixCreator::internal::AssemblerBoundary::CopyData<1, 3, float> & /*copy_data*/, Mapping<1, 3> const &, @@ -1308,8 +1308,8 @@ namespace MatrixCreator template <> void inline create_boundary_mass_matrix_1<1, 3, double>( - DoFHandler<1, 3>::active_cell_iterator const & /*cell*/, - MatrixCreator::internal::AssemblerBoundary::Scratch const &, + const DoFHandler<1, 3>::active_cell_iterator & /*cell*/, + const MatrixCreator::internal::AssemblerBoundary::Scratch &, MatrixCreator::internal::AssemblerBoundary::CopyData<1, 3, double> & /*copy_data*/, Mapping<1, 3> const &, @@ -1381,8 +1381,8 @@ namespace MatrixCreator dof.begin_active(), dof.end(), [&mapping, &fe, &q, &boundary_functions, coefficient, &component_mapping]( - typename DoFHandler::active_cell_iterator const &cell, - MatrixCreator::internal::AssemblerBoundary::Scratch const &scratch_data, + const typename DoFHandler::active_cell_iterator &cell, + const MatrixCreator::internal::AssemblerBoundary::Scratch &scratch_data, MatrixCreator::internal::AssemblerBoundary:: CopyData ©_data) { internal::create_boundary_mass_matrix_1(cell, @@ -1415,8 +1415,8 @@ namespace MatrixCreator template void create_hp_boundary_mass_matrix_1( - typename DoFHandler::active_cell_iterator const &cell, - MatrixCreator::internal::AssemblerBoundary::Scratch const &, + const typename DoFHandler::active_cell_iterator &cell, + const MatrixCreator::internal::AssemblerBoundary::Scratch &, MatrixCreator::internal::AssemblerBoundary :: CopyData & copy_data, hp::MappingCollection const &mapping, @@ -1857,8 +1857,8 @@ namespace MatrixCreator &boundary_functions, coefficient, &component_mapping]( - typename DoFHandler::active_cell_iterator const &cell, - MatrixCreator::internal::AssemblerBoundary::Scratch const &scratch_data, + const typename DoFHandler::active_cell_iterator &cell, + const MatrixCreator::internal::AssemblerBoundary::Scratch &scratch_data, MatrixCreator::internal::AssemblerBoundary :: CopyData ©_data) { internal::create_hp_boundary_mass_matrix_1(cell, diff --git a/include/deal.II/numerics/rtree.h b/include/deal.II/numerics/rtree.h index 054104efa2..19605c65fa 100644 --- a/include/deal.II/numerics/rtree.h +++ b/include/deal.II/numerics/rtree.h @@ -216,7 +216,7 @@ public: /** * Constructor. Store a const reference to a container. */ - explicit IndexableGetterFromIndices(Container const &c) + explicit IndexableGetterFromIndices(const Container &c) : container(c) {} @@ -334,7 +334,7 @@ struct ExtractLevelVisitor * @p target_level of the tree. */ inline ExtractLevelVisitor( - Translator const & translator, + const Translator & translator, const unsigned int target_level, std::vector::value>> &boxes); @@ -364,18 +364,18 @@ struct ExtractLevelVisitor * belongs to the @p target_level, then fill the bounding box vector. */ inline void - operator()(InternalNode const &node); + operator()(const InternalNode &node); /** * Implements the visitor interface for Leaf objects. */ inline void - operator()(Leaf const &); + operator()(const Leaf &); /** * Translator interface, required by the boost implementation of the rtree. */ - Translator const &translator; + const Translator &translator; /** * Store the level we are currently visiting. @@ -683,18 +683,18 @@ struct NodeVisitor : public boost::geometry::index::detail::rtree::visitor< * belongs to the level next to @p target_level, then fill the bounding box vector for that node. */ inline void - operator()(InternalNode const &node); + operator()(const InternalNode &node); /** * Implements the visitor interface for Leaf objects. */ inline void - operator()(Leaf const &); + operator()(const Leaf &); /** * Translator interface, required by the boost implementation of the rtree. */ - Translator const &translator; + const Translator &translator; /** * Store the level we are currently visiting. diff --git a/include/deal.II/numerics/vector_tools_boundary.templates.h b/include/deal.II/numerics/vector_tools_boundary.templates.h index 4734b0cf5d..aa4366c861 100644 --- a/include/deal.II/numerics/vector_tools_boundary.templates.h +++ b/include/deal.II/numerics/vector_tools_boundary.templates.h @@ -232,7 +232,7 @@ namespace VectorTools q_collection, update_quadrature_points); - for (auto const &cell : dof.active_cell_iterators()) + for (const auto &cell : dof.active_cell_iterators()) if (!cell->is_artificial()) for (const unsigned int face_no : cell->face_indices()) { diff --git a/source/base/polynomial.cc b/source/base/polynomial.cc index 6f629182ef..8c3e153cd1 100644 --- a/source/base/polynomial.cc +++ b/source/base/polynomial.cc @@ -626,7 +626,7 @@ namespace Polynomials unsigned int n_functions = n + 1; AssertIndexRange(support_point, n_functions); - double const *x = nullptr; + const double *x = nullptr; switch (n) { diff --git a/source/distributed/field_transfer.cc b/source/distributed/field_transfer.cc index 7f362501f8..657799cbe3 100644 --- a/source/distributed/field_transfer.cc +++ b/source/distributed/field_transfer.cc @@ -191,7 +191,7 @@ namespace parallel out.local_element(i) = std::numeric_limits::infinity(); unsigned int cell_i = 0; - for (auto const &cell : dof_handler.active_cell_iterators()) + for (const auto &cell : dof_handler.active_cell_iterators()) { if ((cell->is_locally_owned()) && (transferred_data[cell_i][0] != diff --git a/source/distributed/p4est_wrappers.cc b/source/distributed/p4est_wrappers.cc index 3596ea4bc9..0afa94b222 100644 --- a/source/distributed/p4est_wrappers.cc +++ b/source/distributed/p4est_wrappers.cc @@ -908,8 +908,8 @@ namespace internal template <> bool - quadrant_is_ancestor<1>(types<1>::quadrant const &q1, - types<1>::quadrant const &q2) + quadrant_is_ancestor<1>(const types<1>::quadrant &q1, + const types<1>::quadrant &q2) { // determine level of quadrants const int level_1 = (q1 << types<1>::max_n_child_indices_bits) >> diff --git a/source/dofs/dof_accessor_set.cc b/source/dofs/dof_accessor_set.cc index 457f72a6ff..39d6d13997 100644 --- a/source/dofs/dof_accessor_set.cc +++ b/source/dofs/dof_accessor_set.cc @@ -93,7 +93,7 @@ namespace internal */ template using set_ghost_state_t = - decltype(std::declval().set_ghost_state(std::declval())); + decltype(std::declval().set_ghost_state(std::declval())); template constexpr bool has_set_ghost_state = diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 86669327c5..a3062a5910 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -6561,7 +6561,7 @@ namespace GridGenerator { for (const auto &cell : tria->cell_iterators()) { - for (auto const &f : cell->face_indices()) + for (const auto &f : cell->face_indices()) if (result_cell->face(f)->at_boundary()) result_cell->face(f)->set_boundary_id( cell->face(f)->boundary_id()); diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 17de2bbbcc..7b7ad67ad2 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -6402,7 +6402,7 @@ namespace GridTools // requested intersections are unique also the resulting quadrature // points are unique and we can simply number the points in an // ascending way. - for (auto const &recv_component : recv_components) + for (const auto &recv_component : recv_components) { // dependent on the size of the intersection an empty quadrature // is returned. Therefore, we have to compute the quadrature also @@ -6755,7 +6755,7 @@ namespace GridTools CGALWrappers::resort_dealii_vertices_to_cgal_order( structdim, requested_intersection); - auto const &try_intersection = + const auto &try_intersection = CGALWrappers::get_vertices_in_cgal_order( cell, cache.get_mapping()); diff --git a/source/numerics/derivative_approximation.cc b/source/numerics/derivative_approximation.cc index 691489c76d..d61405f461 100644 --- a/source/numerics/derivative_approximation.cc +++ b/source/numerics/derivative_approximation.cc @@ -993,12 +993,12 @@ namespace DerivativeApproximation end, [&mapping, &dof_handler, &solution, component]( SynchronousIterators const &cell, - Assembler::Scratch const &, + const Assembler::Scratch &, Assembler::CopyData &) { approximate( cell, mapping, dof_handler, solution, component); }, - std::function(), + std::function(), internal::Assembler::Scratch(), internal::Assembler::CopyData()); } diff --git a/source/particles/generators.cc b/source/particles/generators.cc index 409ea4b2db..7e500d4a4b 100644 --- a/source/particles/generators.cc +++ b/source/particles/generators.cc @@ -476,7 +476,7 @@ namespace Particles // Memory is reserved for efficiency reasons std::vector> support_points_vec; support_points_vec.reserve(support_points_map.size()); - for (auto const &element : support_points_map) + for (const auto &element : support_points_map) support_points_vec.push_back(element.second); particle_handler.insert_global_particles(support_points_vec, diff --git a/tests/base/graph_coloring_01.cc b/tests/base/graph_coloring_01.cc index d05ba170cf..b2dfd42218 100644 --- a/tests/base/graph_coloring_01.cc +++ b/tests/base/graph_coloring_01.cc @@ -38,7 +38,7 @@ template std::vector get_conflict_indices_cfem( - typename DoFHandler::active_cell_iterator const &it) + typename DoFHandler::active_cell_const iterator &it) { std::vector local_dof_indices( it->get_fe().dofs_per_cell); @@ -67,7 +67,7 @@ check() cell, dof_handler.end(), std::function( - typename DoFHandler::active_cell_iterator const &)>( + typename DoFHandler::active_cell_const iterator &)>( &get_conflict_indices_cfem))); // Output the coloring diff --git a/tests/base/graph_coloring_02.cc b/tests/base/graph_coloring_02.cc index 1a5afed726..7febd009c3 100644 --- a/tests/base/graph_coloring_02.cc +++ b/tests/base/graph_coloring_02.cc @@ -38,7 +38,7 @@ template std::vector get_conflict_indices_cfem( - typename DoFHandler::active_cell_iterator const &it) + typename DoFHandler::active_cell_const iterator &it) { std::vector local_dof_indices( it->get_fe().dofs_per_cell); @@ -76,7 +76,7 @@ check() dof_handler.begin_active(), dof_handler.end(), std::function( - typename DoFHandler::active_cell_iterator const &)>( + typename DoFHandler::active_cell_const iterator &)>( &get_conflict_indices_cfem))); // Output the coloring diff --git a/tests/base/graph_coloring_02a.cc b/tests/base/graph_coloring_02a.cc index 2be3e18926..bc3bfb0e99 100644 --- a/tests/base/graph_coloring_02a.cc +++ b/tests/base/graph_coloring_02a.cc @@ -38,7 +38,7 @@ template std::vector get_conflict_indices_cfem( - typename DoFHandler::active_cell_iterator const &it) + typename DoFHandler::active_cell_const iterator &it) { std::vector local_dof_indices( it->get_fe().dofs_per_cell); @@ -78,7 +78,7 @@ check() dof_handler.begin_active(), dof_handler.end(), std::function( - typename DoFHandler::active_cell_iterator const &)>( + typename DoFHandler::active_cell_const iterator &)>( &get_conflict_indices_cfem))); // verify that within each color, there is no conflict diff --git a/tests/base/graph_coloring_03.cc b/tests/base/graph_coloring_03.cc index 9437102452..7543c9b3df 100644 --- a/tests/base/graph_coloring_03.cc +++ b/tests/base/graph_coloring_03.cc @@ -38,7 +38,7 @@ template std::vector get_conflict_indices_cfem( - typename DoFHandler::active_cell_iterator const &it) + typename DoFHandler::active_cell_const iterator &it) { std::vector local_dof_indices( it->get_fe().dofs_per_cell); @@ -79,7 +79,7 @@ check() dof_handler.begin_active(), dof_handler.end(), std::function( - typename DoFHandler::active_cell_iterator const &)>( + typename DoFHandler::active_cell_const iterator &)>( &get_conflict_indices_cfem))); // Output the coloring diff --git a/tests/base/graph_coloring_05.cc b/tests/base/graph_coloring_05.cc index 53d3febe06..c71be40045 100644 --- a/tests/base/graph_coloring_05.cc +++ b/tests/base/graph_coloring_05.cc @@ -39,7 +39,7 @@ template std::vector get_conflict_indices_cfem( - typename DoFHandler::active_cell_iterator const &it) + typename DoFHandler::active_cell_const iterator &it) { std::vector local_dof_indices( it->get_fe().dofs_per_cell); @@ -77,7 +77,7 @@ check() dof_handler.begin_active(), dof_handler.end(), std::function( - typename DoFHandler::active_cell_iterator const &)>( + typename DoFHandler::active_cell_const iterator &)>( &get_conflict_indices_cfem))); // Check that a color does not contain a conflict index twice diff --git a/tests/base/graph_coloring_06.cc b/tests/base/graph_coloring_06.cc index ce5b10cbf6..02357f59e5 100644 --- a/tests/base/graph_coloring_06.cc +++ b/tests/base/graph_coloring_06.cc @@ -38,7 +38,7 @@ template std::vector get_conflict_indices_cfem( - typename DoFHandler::active_cell_iterator const &it) + typename DoFHandler::active_cell_const iterator &it) { std::vector local_dof_indices( it->get_fe().dofs_per_cell); @@ -82,7 +82,7 @@ check() dof_handler.begin_active(), dof_handler.end(), std::function( - typename DoFHandler::active_cell_iterator const &)>( + typename DoFHandler::active_cell_const iterator &)>( &get_conflict_indices_cfem)); for (unsigned int color = 0; color < coloring.size(); ++color) diff --git a/tests/base/mpi_some_to_some_01.cc b/tests/base/mpi_some_to_some_01.cc index c43eaedadc..36b63f8567 100644 --- a/tests/base/mpi_some_to_some_01.cc +++ b/tests/base/mpi_some_to_some_01.cc @@ -41,7 +41,7 @@ main(int argc, char *argv[]) auto received_pts = Utilities::MPI::some_to_some(MPI_COMM_WORLD, m); bool test_passed = true; - for (auto const &pt : received_pts) + for (const auto &pt : received_pts) if (std::abs(pt.first - pt.second[0][0]) > 1e-12 || std::abs(2.0 * pt.first + pt.second[0][1]) > 1e-12) { diff --git a/tests/mappings/mapping_get_vertices_on_face.cc b/tests/mappings/mapping_get_vertices_on_face.cc index 941e73c7a6..76a6a01227 100644 --- a/tests/mappings/mapping_get_vertices_on_face.cc +++ b/tests/mappings/mapping_get_vertices_on_face.cc @@ -54,9 +54,9 @@ test_vertex_order() for (const auto &cell : tria.active_cell_iterators()) for (unsigned int f = 0; f < cell->n_faces(); ++f) { - auto const &vertices_detour = + const auto &vertices_detour = get_vertices(cell, cell->face(f), mapping); - auto const &vertices = mapping.get_vertices(cell, f); + const auto &vertices = mapping.get_vertices(cell, f); AssertDimension(vertices_detour.size(), vertices.size()); diff --git a/tests/matrix_free/matrix_vector_rt_04.cc b/tests/matrix_free/matrix_vector_rt_04.cc index 567f829ce9..fe11677863 100644 --- a/tests/matrix_free/matrix_vector_rt_04.cc +++ b/tests/matrix_free/matrix_vector_rt_04.cc @@ -140,7 +140,7 @@ test() for (auto cell : tria.cell_iterators()) { - for (auto const &v : cell->vertex_indices()) + for (const auto &v : cell->vertex_indices()) { if (vertex_touched[cell->vertex_index(v)] == false) { diff --git a/tests/matrix_free/matrix_vector_rt_face_04.cc b/tests/matrix_free/matrix_vector_rt_face_04.cc index cc4ee5ada1..9f100a4b0a 100644 --- a/tests/matrix_free/matrix_vector_rt_face_04.cc +++ b/tests/matrix_free/matrix_vector_rt_face_04.cc @@ -141,7 +141,7 @@ test() for (auto cell : tria.cell_iterators()) { - for (auto const &v : cell->vertex_indices()) + for (const auto &v : cell->vertex_indices()) { if (vertex_touched[cell->vertex_index(v)] == false) { diff --git a/tests/numerics/assemble_matrix_parallel_01.cc b/tests/numerics/assemble_matrix_parallel_01.cc index 9ecf93ae9a..1e385bc37d 100644 --- a/tests/numerics/assemble_matrix_parallel_01.cc +++ b/tests/numerics/assemble_matrix_parallel_01.cc @@ -128,7 +128,7 @@ private: std::vector get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const; + typename DoFHandler::active_cell_const iterator &cell) const; Triangulation triangulation; @@ -238,7 +238,7 @@ LaplaceProblem::~LaplaceProblem() template std::vector LaplaceProblem::get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const + typename DoFHandler::active_cell_const iterator &cell) const { std::vector local_dof_indices( cell->get_fe().dofs_per_cell); @@ -278,7 +278,7 @@ LaplaceProblem::setup_system() dof_handler.begin_active(), dof_handler.end(), static_cast( - typename DoFHandler::active_cell_iterator const &)>>( + typename DoFHandler::active_cell_const iterator &)>>( std::bind(&LaplaceProblem::get_conflict_indices, this, std::placeholders::_1))); diff --git a/tests/numerics/assemble_matrix_parallel_02.cc b/tests/numerics/assemble_matrix_parallel_02.cc index 2ca3fed1e0..86e9c3c547 100644 --- a/tests/numerics/assemble_matrix_parallel_02.cc +++ b/tests/numerics/assemble_matrix_parallel_02.cc @@ -143,7 +143,7 @@ private: std::vector get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const; + typename DoFHandler::active_cell_const iterator &cell) const; Triangulation triangulation; @@ -255,7 +255,7 @@ LaplaceProblem::~LaplaceProblem() template std::vector LaplaceProblem::get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const + typename DoFHandler::active_cell_const iterator &cell) const { std::vector local_dof_indices( cell->get_fe().dofs_per_cell); @@ -296,7 +296,7 @@ LaplaceProblem::setup_system() dof_handler.begin_active(), dof_handler.end(), static_cast( - typename DoFHandler::active_cell_iterator const &)>>( + typename DoFHandler::active_cell_const iterator &)>>( std::bind(&LaplaceProblem::get_conflict_indices, this, std::placeholders::_1))); diff --git a/tests/numerics/assemble_matrix_parallel_03.cc b/tests/numerics/assemble_matrix_parallel_03.cc index 32ae6f59cc..452f0ef839 100644 --- a/tests/numerics/assemble_matrix_parallel_03.cc +++ b/tests/numerics/assemble_matrix_parallel_03.cc @@ -128,7 +128,7 @@ private: std::vector get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const; + typename DoFHandler::active_cell_const iterator &cell) const; Triangulation triangulation; @@ -238,7 +238,7 @@ LaplaceProblem::~LaplaceProblem() template std::vector LaplaceProblem::get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const + typename DoFHandler::active_cell_const iterator &cell) const { std::vector local_dof_indices( cell->get_fe().dofs_per_cell); @@ -278,7 +278,7 @@ LaplaceProblem::setup_system() dof_handler.begin_active(), dof_handler.end(), static_cast( - typename DoFHandler::active_cell_iterator const &)>>( + typename DoFHandler::active_cell_const iterator &)>>( std::bind(&LaplaceProblem::get_conflict_indices, this, std::placeholders::_1))); diff --git a/tests/numerics/assemble_matrix_parallel_04.cc b/tests/numerics/assemble_matrix_parallel_04.cc index 90ebbc0c84..81c93ce19b 100644 --- a/tests/numerics/assemble_matrix_parallel_04.cc +++ b/tests/numerics/assemble_matrix_parallel_04.cc @@ -142,7 +142,7 @@ private: std::vector get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const; + typename DoFHandler::active_cell_const iterator &cell) const; Triangulation triangulation; @@ -254,7 +254,7 @@ LaplaceProblem::~LaplaceProblem() template std::vector LaplaceProblem::get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const + typename DoFHandler::active_cell_const iterator &cell) const { std::vector local_dof_indices( cell->get_fe().dofs_per_cell); @@ -308,7 +308,7 @@ LaplaceProblem::setup_system() dof_handler.begin_active(), dof_handler.end(), static_cast( - typename DoFHandler::active_cell_iterator const &)>>( + typename DoFHandler::active_cell_const iterator &)>>( std::bind(&LaplaceProblem::get_conflict_indices, this, std::placeholders::_1))); diff --git a/tests/petsc/assemble_matrix_parallel_01.cc b/tests/petsc/assemble_matrix_parallel_01.cc index 714d4f67e7..a028c9a85e 100644 --- a/tests/petsc/assemble_matrix_parallel_01.cc +++ b/tests/petsc/assemble_matrix_parallel_01.cc @@ -127,7 +127,7 @@ private: std::vector get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const; + typename DoFHandler::active_cell_const iterator &cell) const; Triangulation triangulation; @@ -235,7 +235,7 @@ LaplaceProblem::~LaplaceProblem() template std::vector LaplaceProblem::get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const + typename DoFHandler::active_cell_const iterator &cell) const { std::vector local_dof_indices( cell->get_fe().dofs_per_cell); @@ -271,7 +271,7 @@ LaplaceProblem::setup_system() dof_handler.begin_active(), dof_handler.end(), static_cast( - typename DoFHandler::active_cell_iterator const &)>>( + typename DoFHandler::active_cell_const iterator &)>>( std::bind(&LaplaceProblem::get_conflict_indices, this, std::placeholders::_1))); diff --git a/tests/trilinos/assemble_matrix_parallel_01.cc b/tests/trilinos/assemble_matrix_parallel_01.cc index ccbfc0e7c7..71441e6370 100644 --- a/tests/trilinos/assemble_matrix_parallel_01.cc +++ b/tests/trilinos/assemble_matrix_parallel_01.cc @@ -124,7 +124,7 @@ private: std::vector get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const; + typename DoFHandler::active_cell_const iterator &cell) const; Triangulation triangulation; @@ -232,7 +232,7 @@ LaplaceProblem::~LaplaceProblem() template std::vector LaplaceProblem::get_conflict_indices( - typename DoFHandler::active_cell_iterator const &cell) const + typename DoFHandler::active_cell_const iterator &cell) const { std::vector local_dof_indices( cell->get_fe().dofs_per_cell); @@ -271,7 +271,7 @@ LaplaceProblem::setup_system() dof_handler.begin_active(), dof_handler.end(), static_cast( - typename DoFHandler::active_cell_iterator const &)>>( + typename DoFHandler::active_cell_const iterator &)>>( std::bind(&LaplaceProblem::get_conflict_indices, this, std::placeholders::_1))); -- 2.39.5