From: Daniel Arndt Date: Thu, 6 Jul 2023 18:05:10 +0000 (-0400) Subject: Avoid const return type X-Git-Tag: relicensing~724^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b5a0ffbc5346e0c0ed3cfd370a9fecc774b30c8;p=dealii.git Avoid const return type --- diff --git a/include/deal.II/algorithms/any_data.h b/include/deal.II/algorithms/any_data.h index fafba5b08d..3495852c7b 100644 --- a/include/deal.II/algorithms/any_data.h +++ b/include/deal.II/algorithms/any_data.h @@ -76,7 +76,7 @@ public: * use try_read() instead. */ template - const type + type entry(const std::string &name) const; /** @@ -91,7 +91,7 @@ public: * Use read_ptr() instead! */ template - const type + type read(const std::string &name) const; /** @@ -135,12 +135,12 @@ public: /// Read-only access to stored data object by index. template - const type + type entry(const unsigned int i) const; /// Dedicated read only access. template - const type + type read(const unsigned int i) const; /// Dedicated read only access to pointer object. @@ -240,7 +240,7 @@ AnyData::entry(const unsigned int i) template -inline const type +inline type AnyData::entry(const unsigned int i) const { AssertIndexRange(i, size()); @@ -254,7 +254,7 @@ AnyData::entry(const unsigned int i) const template -inline const type +inline type AnyData::read(const unsigned int i) const { AssertIndexRange(i, size()); @@ -358,7 +358,7 @@ AnyData::entry(const std::string &n) template -inline const type +inline type AnyData::entry(const std::string &n) const { const unsigned int i = find(n); @@ -370,7 +370,7 @@ AnyData::entry(const std::string &n) const template -inline const type +inline type AnyData::read(const std::string &n) const { const unsigned int i = find(n); diff --git a/include/deal.II/base/job_identifier.h b/include/deal.II/base/job_identifier.h index 2c583f784a..33b0ea8b31 100644 --- a/include/deal.II/base/job_identifier.h +++ b/include/deal.II/base/job_identifier.h @@ -63,7 +63,7 @@ public: /** * Return the value of id. */ - const std::string + std::string operator()() const; /** diff --git a/include/deal.II/base/mpi.h b/include/deal.II/base/mpi.h index b77fd3e7c8..af1e327252 100644 --- a/include/deal.II/base/mpi.h +++ b/include/deal.II/base/mpi.h @@ -154,7 +154,7 @@ namespace Utilities * Return a vector of the ranks (within @p comm_large) of a subset of * processes specified by @p comm_small. */ - const std::vector + std::vector mpi_processes_within_communicator(const MPI_Comm comm_large, const MPI_Comm comm_small); diff --git a/include/deal.II/base/polynomials_integrated_legendre_sz.h b/include/deal.II/base/polynomials_integrated_legendre_sz.h index 0fa756f357..0aa37b2201 100644 --- a/include/deal.II/base/polynomials_integrated_legendre_sz.h +++ b/include/deal.II/base/polynomials_integrated_legendre_sz.h @@ -63,7 +63,7 @@ private: /** * Main function to compute the co-efficients of the polynomial at degree p. */ - static const std::vector + static std::vector get_coefficients(const unsigned int k); }; diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index 35a7ea24f6..28c6ebf927 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -894,7 +894,7 @@ namespace Utilities * * */ - const std::string + std::string get_current_vectorization_level(); /** diff --git a/include/deal.II/distributed/tria_base.h b/include/deal.II/distributed/tria_base.h index 3c22c353e8..1920f63994 100644 --- a/include/deal.II/distributed/tria_base.h +++ b/include/deal.II/distributed/tria_base.h @@ -203,10 +203,10 @@ namespace parallel const std::set & level_ghost_owners() const; - const std::weak_ptr + std::weak_ptr global_active_cell_index_partitioner() const override; - const std::weak_ptr + std::weak_ptr global_level_cell_index_partitioner( const unsigned int level) const override; diff --git a/include/deal.II/fe/fe_enriched.h b/include/deal.II/fe/fe_enriched.h index 92a8ce7c9d..a09d4274ef 100644 --- a/include/deal.II/fe/fe_enriched.h +++ b/include/deal.II/fe/fe_enriched.h @@ -429,7 +429,7 @@ public: /** * Return enrichment functions */ - const std::vector *( + std::vector *( const typename Triangulation::cell_iterator &)>>> get_enrichments() const; diff --git a/include/deal.II/fe/fe_interface_values.h b/include/deal.II/fe/fe_interface_values.h index 7a46e44f13..e281f20398 100644 --- a/include/deal.II/fe/fe_interface_values.h +++ b/include/deal.II/fe/fe_interface_values.h @@ -1554,7 +1554,7 @@ public: * The @p cell_index is either 0 or 1 and corresponds to the cell index * returned by interface_dof_to_cell_and_dof_index(). */ - const typename Triangulation::cell_iterator + typename Triangulation::cell_iterator get_cell(const unsigned int cell_index) const; /** @@ -2037,7 +2037,7 @@ public: * The concept of views is explained in the documentation of the namespace * FEValuesViews. */ - const FEInterfaceViews::Scalar + FEInterfaceViews::Scalar operator[](const FEValuesExtractors::Scalar &scalar) const; /** @@ -2046,7 +2046,7 @@ public: * finite element. The concept of views is explained in the documentation of * the namespace FEValuesViews. */ - const FEInterfaceViews::Vector + FEInterfaceViews::Vector operator[](const FEValuesExtractors::Vector &vector) const; /** @@ -2704,7 +2704,7 @@ FEInterfaceValues::get_update_flags() const template -const typename Triangulation::cell_iterator +typename Triangulation::cell_iterator FEInterfaceValues::get_cell(const unsigned int cell_index) const { return get_fe_face_values(cell_index).get_cell(); @@ -3142,7 +3142,7 @@ FEInterfaceValues::get_average_of_function_hessians( /*------------ Inline functions: FEInterfaceValues------------*/ template -inline const FEInterfaceViews::Scalar +inline FEInterfaceViews::Scalar FEInterfaceValues::operator[]( const FEValuesExtractors::Scalar &scalar) const { @@ -3157,7 +3157,7 @@ FEInterfaceValues::operator[]( template -inline const FEInterfaceViews::Vector +inline FEInterfaceViews::Vector FEInterfaceValues::operator[]( const FEValuesExtractors::Vector &vector) const { diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index 369b235ca3..4e93cb514c 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -3503,7 +3503,7 @@ public: /** * Return a triangulation iterator to the current cell. */ - const typename Triangulation::cell_iterator + typename Triangulation::cell_iterator get_cell() const; /** diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index ad35295984..3566fbf641 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -1635,7 +1635,7 @@ public: * level of the triangulation, which is returned by the function * CellAccessor::global_active_cell_index(). */ - virtual const std::weak_ptr + virtual std::weak_ptr global_active_cell_index_partitioner() const; /** @@ -1643,7 +1643,7 @@ public: * level of the triangulation, which is returned by the function * CellAccessor::global_level_cell_index(). */ - virtual const std::weak_ptr + virtual std::weak_ptr global_level_cell_index_partitioner(const unsigned int level) const; /** diff --git a/include/deal.II/lac/affine_constraints.h b/include/deal.II/lac/affine_constraints.h index 874e29d9c7..49c1b64259 100644 --- a/include/deal.II/lac/affine_constraints.h +++ b/include/deal.II/lac/affine_constraints.h @@ -1727,7 +1727,7 @@ public: * @return A range object for the half open range [this->begin(), * this->end()) of line entries. */ - const LineRange + LineRange get_lines() const; /** diff --git a/include/deal.II/lac/affine_constraints.templates.h b/include/deal.II/lac/affine_constraints.templates.h index 7c78c97d08..88ef957065 100644 --- a/include/deal.II/lac/affine_constraints.templates.h +++ b/include/deal.II/lac/affine_constraints.templates.h @@ -75,7 +75,7 @@ AffineConstraints::ConstraintLine::memory_consumption() const template -const typename AffineConstraints::LineRange +typename AffineConstraints::LineRange AffineConstraints::get_lines() const { return boost::make_iterator_range(lines.begin(), lines.end()); diff --git a/include/deal.II/numerics/data_out.h b/include/deal.II/numerics/data_out.h index 66e32256f6..942d5f9987 100644 --- a/include/deal.II/numerics/data_out.h +++ b/include/deal.II/numerics/data_out.h @@ -413,7 +413,7 @@ public: * Return the two function objects that are in use for determining the first * and the next cell as set by set_cell_selection(). */ - const std::pair + std::pair get_cell_selection() const; private: diff --git a/include/deal.II/particles/particle.h b/include/deal.II/particles/particle.h index e4580047f1..56110e7857 100644 --- a/include/deal.II/particles/particle.h +++ b/include/deal.II/particles/particle.h @@ -376,7 +376,7 @@ namespace Particles * * @return An ArrayView of the properties of this particle. */ - const ArrayView + ArrayView get_properties(); /** @@ -385,7 +385,7 @@ namespace Particles * * @return An ArrayView of the properties of this particle. */ - const ArrayView + ArrayView get_properties() const; /** @@ -624,7 +624,7 @@ namespace Particles template - inline const ArrayView + inline ArrayView Particle::get_properties() const { if (has_properties() == false) diff --git a/include/deal.II/particles/particle_accessor.h b/include/deal.II/particles/particle_accessor.h index a8d41b7da1..941a04a7d7 100644 --- a/include/deal.II/particles/particle_accessor.h +++ b/include/deal.II/particles/particle_accessor.h @@ -302,7 +302,7 @@ namespace Particles * * @return An ArrayView of the properties of this particle. */ - const ArrayView + ArrayView get_properties(); /** @@ -310,7 +310,7 @@ namespace Particles * * @return An ArrayView of the properties of this particle. */ - const ArrayView + ArrayView get_properties() const; /** @@ -784,7 +784,7 @@ namespace Particles template - inline const ArrayView + inline ArrayView ParticleAccessor::get_properties() const { Assert(state() == IteratorState::valid, ExcInternalError()); @@ -833,7 +833,7 @@ namespace Particles template - inline const ArrayView + inline ArrayView ParticleAccessor::get_properties() { Assert(state() == IteratorState::valid, ExcInternalError()); diff --git a/source/base/job_identifier.cc b/source/base/job_identifier.cc index 87e7771a77..cdd287439e 100644 --- a/source/base/job_identifier.cc +++ b/source/base/job_identifier.cc @@ -50,7 +50,7 @@ JobIdentifier::JobIdentifier() } -const std::string +std::string JobIdentifier::operator()() const { return id; diff --git a/source/base/mpi.cc b/source/base/mpi.cc index 30736e44b3..909590a782 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -177,7 +177,7 @@ namespace Utilities - const std::vector + std::vector mpi_processes_within_communicator(const MPI_Comm comm_large, const MPI_Comm comm_small) { @@ -677,7 +677,7 @@ namespace Utilities - const std::vector + std::vector mpi_processes_within_communicator(const MPI_Comm, const MPI_Comm) { return std::vector{0}; diff --git a/source/base/polynomials_integrated_legendre_sz.cc b/source/base/polynomials_integrated_legendre_sz.cc index ef370bc5ca..a54460e4ae 100644 --- a/source/base/polynomials_integrated_legendre_sz.cc +++ b/source/base/polynomials_integrated_legendre_sz.cc @@ -24,7 +24,7 @@ IntegratedLegendreSZ::IntegratedLegendreSZ(const unsigned int k) -const std::vector +std::vector IntegratedLegendreSZ::get_coefficients(const unsigned int k) { std::vector coefficients(k + 1); diff --git a/source/base/utilities.cc b/source/base/utilities.cc index 6f0b287b57..80874182bb 100644 --- a/source/base/utilities.cc +++ b/source/base/utilities.cc @@ -935,7 +935,7 @@ namespace Utilities #endif - const std::string + std::string get_current_vectorization_level() { switch (DEAL_II_VECTORIZATION_WIDTH_IN_BITS) diff --git a/source/distributed/tria_base.cc b/source/distributed/tria_base.cc index 8559b14981..72a318013e 100644 --- a/source/distributed/tria_base.cc +++ b/source/distributed/tria_base.cc @@ -634,7 +634,7 @@ namespace parallel template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) - const std::weak_ptr TriangulationBase< + std::weak_ptr TriangulationBase< dim, spacedim>::global_active_cell_index_partitioner() const { @@ -645,10 +645,9 @@ namespace parallel template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) - const std::weak_ptr TriangulationBase< - dim, - spacedim>::global_level_cell_index_partitioner(const unsigned int level) - const + std::weak_ptr TriangulationBase:: + global_level_cell_index_partitioner(const unsigned int level) const { Assert(this->is_multilevel_hierarchy_constructed(), ExcNotImplemented()); AssertIndexRange(level, this->n_global_levels()); diff --git a/source/fe/fe_enriched.cc b/source/fe/fe_enriched.cc index f0ecc595ab..c8fe09fc02 100644 --- a/source/fe/fe_enriched.cc +++ b/source/fe/fe_enriched.cc @@ -258,7 +258,7 @@ FE_Enriched::FE_Enriched( template -const std::vector *( +std::vector *( const typename Triangulation::cell_iterator &)>>> FE_Enriched::get_enrichments() const { diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index 62f3fb96c8..325932363e 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -3765,7 +3765,7 @@ FEValuesBase::get_function_third_derivatives( template -const typename Triangulation::cell_iterator +typename Triangulation::cell_iterator FEValuesBase::get_cell() const { return present_cell; diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 9b8cdf61ac..e512e95cc9 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -11198,9 +11198,8 @@ MPI_Comm Triangulation::get_communicator() const template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) -const std::weak_ptr Triangulation< - dim, - spacedim>::global_active_cell_index_partitioner() const +std::weak_ptr Triangulation:: + global_active_cell_index_partitioner() const { return number_cache.active_cell_index_partitioner; } @@ -11209,9 +11208,8 @@ const std::weak_ptr Triangulation< template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) -const std::weak_ptr Triangulation< - dim, - spacedim>::global_level_cell_index_partitioner(const unsigned int level) const +std::weak_ptr Triangulation:: + global_level_cell_index_partitioner(const unsigned int level) const { AssertIndexRange(level, this->n_levels()); diff --git a/source/numerics/data_out.cc b/source/numerics/data_out.cc index 4980361119..43b062ee61 100644 --- a/source/numerics/data_out.cc +++ b/source/numerics/data_out.cc @@ -1325,8 +1325,8 @@ DataOut::set_cell_selection( template -const std::pair::FirstCellFunctionType, - typename DataOut::NextCellFunctionType> +std::pair::FirstCellFunctionType, + typename DataOut::NextCellFunctionType> DataOut::get_cell_selection() const { return std::make_pair(first_cell_function, next_cell_function); diff --git a/source/particles/particle.cc b/source/particles/particle.cc index 2783a36358..f574e4dd02 100644 --- a/source/particles/particle.cc +++ b/source/particles/particle.cc @@ -326,7 +326,7 @@ namespace Particles template - const ArrayView + ArrayView Particle::get_properties() { return property_pool->get_properties(property_pool_handle);