Skip to content

Commit

Permalink
Avoid const return type
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed Jul 6, 2023
1 parent 1af048d commit 599879e
Show file tree
Hide file tree
Showing 25 changed files with 51 additions and 54 deletions.
16 changes: 8 additions & 8 deletions include/deal.II/algorithms/any_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class AnyData : public Subscriptor
* use try_read() instead.
*/
template <typename type>
const type
type
entry(const std::string &name) const;

/**
Expand All @@ -91,7 +91,7 @@ class AnyData : public Subscriptor
* Use read_ptr() instead!
*/
template <typename type>
const type
type
read(const std::string &name) const;

/**
Expand Down Expand Up @@ -135,12 +135,12 @@ class AnyData : public Subscriptor

/// Read-only access to stored data object by index.
template <typename type>
const type
type
entry(const unsigned int i) const;

/// Dedicated read only access.
template <typename type>
const type
type
read(const unsigned int i) const;

/// Dedicated read only access to pointer object.
Expand Down Expand Up @@ -240,7 +240,7 @@ AnyData::entry(const unsigned int i)


template <typename type>
inline const type
inline type
AnyData::entry(const unsigned int i) const
{
AssertIndexRange(i, size());
Expand All @@ -254,7 +254,7 @@ AnyData::entry(const unsigned int i) const


template <typename type>
inline const type
inline type
AnyData::read(const unsigned int i) const
{
AssertIndexRange(i, size());
Expand Down Expand Up @@ -358,7 +358,7 @@ AnyData::entry(const std::string &n)


template <typename type>
inline const type
inline type
AnyData::entry(const std::string &n) const
{
const unsigned int i = find(n);
Expand All @@ -370,7 +370,7 @@ AnyData::entry(const std::string &n) const


template <typename type>
inline const type
inline type
AnyData::read(const std::string &n) const
{
const unsigned int i = find(n);
Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/base/job_identifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class JobIdentifier
/**
* Return the value of <tt>id</tt>.
*/
const std::string
std::string
operator()() const;

/**
Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/base/mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned int>
std::vector<unsigned int>
mpi_processes_within_communicator(const MPI_Comm comm_large,
const MPI_Comm comm_small);

Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/base/polynomials_integrated_legendre_sz.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class IntegratedLegendreSZ : public Polynomials::Polynomial<double>
/**
* Main function to compute the co-efficients of the polynomial at degree p.
*/
static const std::vector<double>
static std::vector<double>
get_coefficients(const unsigned int k);
};

Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/base/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ namespace Utilities
* </tr>
* </table>
*/
const std::string
std::string
get_current_vectorization_level();

/**
Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/distributed/tria_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ namespace parallel
const std::set<types::subdomain_id> &
level_ghost_owners() const;

const std::weak_ptr<const Utilities::MPI::Partitioner>
std::weak_ptr<const Utilities::MPI::Partitioner>
global_active_cell_index_partitioner() const override;

const std::weak_ptr<const Utilities::MPI::Partitioner>
std::weak_ptr<const Utilities::MPI::Partitioner>
global_level_cell_index_partitioner(
const unsigned int level) const override;

Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/fe/fe_enriched.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ class FE_Enriched : public FiniteElement<dim, spacedim>
/**
* Return enrichment functions
*/
const std::vector<std::vector<std::function<const Function<spacedim> *(
std::vector<std::vector<std::function<const Function<spacedim> *(
const typename Triangulation<dim, spacedim>::cell_iterator &)>>>
get_enrichments() const;

Expand Down
12 changes: 6 additions & 6 deletions include/deal.II/fe/fe_interface_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ class FEInterfaceValues
* 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<dim, spacedim>::cell_iterator
typename Triangulation<dim, spacedim>::cell_iterator
get_cell(const unsigned int cell_index) const;

/**
Expand Down Expand Up @@ -2037,7 +2037,7 @@ class FEInterfaceValues
* The concept of views is explained in the documentation of the namespace
* FEValuesViews.
*/
const FEInterfaceViews::Scalar<dim, spacedim>
FEInterfaceViews::Scalar<dim, spacedim>
operator[](const FEValuesExtractors::Scalar &scalar) const;

/**
Expand All @@ -2046,7 +2046,7 @@ class FEInterfaceValues
* finite element. The concept of views is explained in the documentation of
* the namespace FEValuesViews.
*/
const FEInterfaceViews::Vector<dim, spacedim>
FEInterfaceViews::Vector<dim, spacedim>
operator[](const FEValuesExtractors::Vector &vector) const;

/**
Expand Down Expand Up @@ -2704,7 +2704,7 @@ FEInterfaceValues<dim, spacedim>::get_update_flags() const


template <int dim, int spacedim>
const typename Triangulation<dim, spacedim>::cell_iterator
typename Triangulation<dim, spacedim>::cell_iterator
FEInterfaceValues<dim, spacedim>::get_cell(const unsigned int cell_index) const
{
return get_fe_face_values(cell_index).get_cell();
Expand Down Expand Up @@ -3142,7 +3142,7 @@ FEInterfaceValues<dim, spacedim>::get_average_of_function_hessians(

/*------------ Inline functions: FEInterfaceValues------------*/
template <int dim, int spacedim>
inline const FEInterfaceViews::Scalar<dim, spacedim>
inline FEInterfaceViews::Scalar<dim, spacedim>
FEInterfaceValues<dim, spacedim>::operator[](
const FEValuesExtractors::Scalar &scalar) const
{
Expand All @@ -3157,7 +3157,7 @@ FEInterfaceValues<dim, spacedim>::operator[](


template <int dim, int spacedim>
inline const FEInterfaceViews::Vector<dim, spacedim>
inline FEInterfaceViews::Vector<dim, spacedim>
FEInterfaceValues<dim, spacedim>::operator[](
const FEValuesExtractors::Vector &vector) const
{
Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/fe/fe_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -3503,7 +3503,7 @@ class FEValuesBase : public Subscriptor
/**
* Return a triangulation iterator to the current cell.
*/
const typename Triangulation<dim, spacedim>::cell_iterator
typename Triangulation<dim, spacedim>::cell_iterator
get_cell() const;

/**
Expand Down
4 changes: 2 additions & 2 deletions include/deal.II/grid/tria.h
Original file line number Diff line number Diff line change
Expand Up @@ -1635,15 +1635,15 @@ class Triangulation : public Subscriptor
* level of the triangulation, which is returned by the function
* CellAccessor::global_active_cell_index().
*/
virtual const std::weak_ptr<const Utilities::MPI::Partitioner>
virtual std::weak_ptr<const Utilities::MPI::Partitioner>
global_active_cell_index_partitioner() const;

/**
* Return the partitioner for the global indices of the cells on the given @p
* level of the triangulation, which is returned by the function
* CellAccessor::global_level_cell_index().
*/
virtual const std::weak_ptr<const Utilities::MPI::Partitioner>
virtual std::weak_ptr<const Utilities::MPI::Partitioner>
global_level_cell_index_partitioner(const unsigned int level) const;

/**
Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/lac/affine_constraints.h
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,7 @@ class AffineConstraints : public Subscriptor
* @return A range object for the half open range <code>[this->begin(),
* this->end())</code> of line entries.
*/
const LineRange
LineRange
get_lines() const;

/**
Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/lac/affine_constraints.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ AffineConstraints<number>::ConstraintLine::memory_consumption() const


template <typename number>
const typename AffineConstraints<number>::LineRange
typename AffineConstraints<number>::LineRange
AffineConstraints<number>::get_lines() const
{
return boost::make_iterator_range(lines.begin(), lines.end());
Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/numerics/data_out.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ class DataOut : public DataOut_DoFData<dim, dim, spacedim, spacedim>
* 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<FirstCellFunctionType, NextCellFunctionType>
std::pair<FirstCellFunctionType, NextCellFunctionType>
get_cell_selection() const;

private:
Expand Down
6 changes: 3 additions & 3 deletions include/deal.II/particles/particle.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ namespace Particles
*
* @return An ArrayView of the properties of this particle.
*/
const ArrayView<double>
ArrayView<double>
get_properties();

/**
Expand All @@ -385,7 +385,7 @@ namespace Particles
*
* @return An ArrayView of the properties of this particle.
*/
const ArrayView<const double>
ArrayView<const double>
get_properties() const;

/**
Expand Down Expand Up @@ -624,7 +624,7 @@ namespace Particles


template <int dim, int spacedim>
inline const ArrayView<const double>
inline ArrayView<const double>
Particle<dim, spacedim>::get_properties() const
{
if (has_properties() == false)
Expand Down
8 changes: 4 additions & 4 deletions include/deal.II/particles/particle_accessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,15 @@ namespace Particles
*
* @return An ArrayView of the properties of this particle.
*/
const ArrayView<double>
ArrayView<double>
get_properties();

/**
* Get read-access to properties of this particle.
*
* @return An ArrayView of the properties of this particle.
*/
const ArrayView<const double>
ArrayView<const double>
get_properties() const;

/**
Expand Down Expand Up @@ -784,7 +784,7 @@ namespace Particles


template <int dim, int spacedim>
inline const ArrayView<const double>
inline ArrayView<const double>
ParticleAccessor<dim, spacedim>::get_properties() const
{
Assert(state() == IteratorState::valid, ExcInternalError());
Expand Down Expand Up @@ -833,7 +833,7 @@ namespace Particles


template <int dim, int spacedim>
inline const ArrayView<double>
inline ArrayView<double>
ParticleAccessor<dim, spacedim>::get_properties()
{
Assert(state() == IteratorState::valid, ExcInternalError());
Expand Down
2 changes: 1 addition & 1 deletion source/base/job_identifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ JobIdentifier::JobIdentifier()
}


const std::string
std::string
JobIdentifier::operator()() const
{
return id;
Expand Down
2 changes: 1 addition & 1 deletion source/base/mpi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ namespace Utilities



const std::vector<unsigned int>
std::vector<unsigned int>
mpi_processes_within_communicator(const MPI_Comm comm_large,
const MPI_Comm comm_small)
{
Expand Down
2 changes: 1 addition & 1 deletion source/base/polynomials_integrated_legendre_sz.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ IntegratedLegendreSZ::IntegratedLegendreSZ(const unsigned int k)



const std::vector<double>
std::vector<double>
IntegratedLegendreSZ::get_coefficients(const unsigned int k)
{
std::vector<double> coefficients(k + 1);
Expand Down
2 changes: 1 addition & 1 deletion source/base/utilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ namespace Utilities

#endif

const std::string
std::string
get_current_vectorization_level()
{
switch (DEAL_II_VECTORIZATION_WIDTH_IN_BITS)
Expand Down
9 changes: 4 additions & 5 deletions source/distributed/tria_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ namespace parallel

template <int dim, int spacedim>
DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
const std::weak_ptr<const Utilities::MPI::Partitioner> TriangulationBase<
std::weak_ptr<const Utilities::MPI::Partitioner> TriangulationBase<
dim,
spacedim>::global_active_cell_index_partitioner() const
{
Expand All @@ -645,10 +645,9 @@ namespace parallel

template <int dim, int spacedim>
DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
const std::weak_ptr<const Utilities::MPI::Partitioner> TriangulationBase<
dim,
spacedim>::global_level_cell_index_partitioner(const unsigned int level)
const
std::weak_ptr<const Utilities::MPI::Partitioner> TriangulationBase<dim,
spacedim>::
global_level_cell_index_partitioner(const unsigned int level) const
{
Assert(this->is_multilevel_hierarchy_constructed(), ExcNotImplemented());
AssertIndexRange(level, this->n_global_levels());
Expand Down
2 changes: 1 addition & 1 deletion source/fe/fe_enriched.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ FE_Enriched<dim, spacedim>::FE_Enriched(


template <int dim, int spacedim>
const std::vector<std::vector<std::function<const Function<spacedim> *(
std::vector<std::vector<std::function<const Function<spacedim> *(
const typename Triangulation<dim, spacedim>::cell_iterator &)>>>
FE_Enriched<dim, spacedim>::get_enrichments() const
{
Expand Down
2 changes: 1 addition & 1 deletion source/fe/fe_values.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3765,7 +3765,7 @@ FEValuesBase<dim, spacedim>::get_function_third_derivatives(


template <int dim, int spacedim>
const typename Triangulation<dim, spacedim>::cell_iterator
typename Triangulation<dim, spacedim>::cell_iterator
FEValuesBase<dim, spacedim>::get_cell() const
{
return present_cell;
Expand Down
10 changes: 4 additions & 6 deletions source/grid/tria.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11198,9 +11198,8 @@ MPI_Comm Triangulation<dim, spacedim>::get_communicator() const

template <int dim, int spacedim>
DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
const std::weak_ptr<const Utilities::MPI::Partitioner> Triangulation<
dim,
spacedim>::global_active_cell_index_partitioner() const
std::weak_ptr<const Utilities::MPI::Partitioner> Triangulation<dim, spacedim>::
global_active_cell_index_partitioner() const
{
return number_cache.active_cell_index_partitioner;
}
Expand All @@ -11209,9 +11208,8 @@ const std::weak_ptr<const Utilities::MPI::Partitioner> Triangulation<

template <int dim, int spacedim>
DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
const std::weak_ptr<const Utilities::MPI::Partitioner> Triangulation<
dim,
spacedim>::global_level_cell_index_partitioner(const unsigned int level) const
std::weak_ptr<const Utilities::MPI::Partitioner> Triangulation<dim, spacedim>::
global_level_cell_index_partitioner(const unsigned int level) const
{
AssertIndexRange(level, this->n_levels());

Expand Down

0 comments on commit 599879e

Please sign in to comment.