Skip to content

Commit

Permalink
Merge pull request #6138 from gassmoeller/make_const
Browse files Browse the repository at this point in the history
Make some functions const
  • Loading branch information
gassmoeller authored Nov 7, 2024
2 parents c3b9737 + b836cdf commit 4729969
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion include/aspect/melt.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ namespace aspect
*/
void compute_melt_variables(LinearAlgebra::BlockSparseMatrix &system_matrix,
LinearAlgebra::BlockVector &solution,
LinearAlgebra::BlockVector &system_rhs);
LinearAlgebra::BlockVector &system_rhs) const;

/**
* Return whether this object refers to the porosity field.
Expand Down
18 changes: 9 additions & 9 deletions include/aspect/simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ namespace aspect
* <code>source/simulator/helper_functions.cc</code>.
*/
void interpolate_onto_velocity_system(const TensorFunction<1,dim> &func,
LinearAlgebra::Vector &vec);
LinearAlgebra::Vector &vec) const;


/**
Expand Down Expand Up @@ -1476,7 +1476,7 @@ namespace aspect
* <code>source/simulator/nullspace.cc</code>.
*/
void remove_nullspace(LinearAlgebra::BlockVector &relevant_dst,
LinearAlgebra::BlockVector &tmp_distributed_stokes);
LinearAlgebra::BlockVector &tmp_distributed_stokes) const;

/**
* Compute the angular momentum and other rotation properties
Expand Down Expand Up @@ -1513,10 +1513,10 @@ namespace aspect
* This function is implemented in
* <code>source/simulator/nullspace.cc</code>.
*/
void remove_net_angular_momentum( const bool use_constant_density,
LinearAlgebra::BlockVector &relevant_dst,
LinearAlgebra::BlockVector &tmp_distributed_stokes,
const bool limit_to_top_faces = false);
void remove_net_angular_momentum(const bool use_constant_density,
LinearAlgebra::BlockVector &relevant_dst,
LinearAlgebra::BlockVector &tmp_distributed_stokes,
const bool limit_to_top_faces = false) const;

/**
* Offset the boundary id of all faces located on an outflow boundary
Expand Down Expand Up @@ -1549,9 +1549,9 @@ namespace aspect
* This function is implemented in
* <code>source/simulator/nullspace.cc</code>.
*/
void remove_net_linear_momentum( const bool use_constant_density,
LinearAlgebra::BlockVector &relevant_dst,
LinearAlgebra::BlockVector &tmp_distributed_stokes);
void remove_net_linear_momentum(const bool use_constant_density,
LinearAlgebra::BlockVector &relevant_dst,
LinearAlgebra::BlockVector &tmp_distributed_stokes) const;

/**
* Compute the maximal velocity throughout the domain. This is needed to
Expand Down
4 changes: 2 additions & 2 deletions source/simulator/helper_functions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ namespace aspect

template <int dim>
void Simulator<dim>::interpolate_onto_velocity_system(const TensorFunction<1,dim> &func,
LinearAlgebra::Vector &vec)
LinearAlgebra::Vector &vec) const
{
Assert(introspection.block_indices.velocities == 0, ExcNotImplemented());

Expand Down Expand Up @@ -2771,7 +2771,7 @@ namespace aspect
template double Simulator<dim>::compute_initial_stokes_residual(); \
template bool Simulator<dim>::stokes_matrix_depends_on_solution() const; \
template bool Simulator<dim>::stokes_A_block_is_symmetric() const; \
template void Simulator<dim>::interpolate_onto_velocity_system(const TensorFunction<1,dim> &func, LinearAlgebra::Vector &vec);\
template void Simulator<dim>::interpolate_onto_velocity_system(const TensorFunction<1,dim> &func, LinearAlgebra::Vector &vec) const;\
template void Simulator<dim>::apply_limiter_to_dg_solutions(const AdvectionField &advection_field); \
template void Simulator<dim>::compute_reactions(); \
template void Simulator<dim>::initialize_current_linearization_point (); \
Expand Down
2 changes: 1 addition & 1 deletion source/simulator/melt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ namespace aspect
MeltHandler<dim>::
compute_melt_variables(LinearAlgebra::BlockSparseMatrix &system_matrix,
LinearAlgebra::BlockVector &solution,
LinearAlgebra::BlockVector &system_rhs)
LinearAlgebra::BlockVector &system_rhs) const
{
if (!this->include_melt_transport())
return;
Expand Down
18 changes: 9 additions & 9 deletions source/simulator/nullspace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ namespace aspect

template <int dim>
void Simulator<dim>::remove_nullspace(LinearAlgebra::BlockVector &relevant_dst,
LinearAlgebra::BlockVector &tmp_distributed_stokes)
LinearAlgebra::BlockVector &tmp_distributed_stokes) const
{
if (parameters.nullspace_removal & NullspaceRemoval::angular_momentum)
{
Expand Down Expand Up @@ -244,9 +244,9 @@ namespace aspect
}

template <int dim>
void Simulator<dim>::remove_net_linear_momentum( const bool use_constant_density,
LinearAlgebra::BlockVector &relevant_dst,
LinearAlgebra::BlockVector &tmp_distributed_stokes )
void Simulator<dim>::remove_net_linear_momentum(const bool use_constant_density,
LinearAlgebra::BlockVector &relevant_dst,
LinearAlgebra::BlockVector &tmp_distributed_stokes) const
{
Assert(introspection.block_indices.velocities != introspection.block_indices.pressure,
ExcNotImplemented());
Expand Down Expand Up @@ -467,10 +467,10 @@ namespace aspect


template <int dim>
void Simulator<dim>::remove_net_angular_momentum( const bool use_constant_density,
LinearAlgebra::BlockVector &relevant_dst,
LinearAlgebra::BlockVector &tmp_distributed_stokes,
const bool limit_to_top_faces)
void Simulator<dim>::remove_net_angular_momentum(const bool use_constant_density,
LinearAlgebra::BlockVector &relevant_dst,
LinearAlgebra::BlockVector &tmp_distributed_stokes,
const bool limit_to_top_faces) const
{
Assert(introspection.block_indices.velocities != introspection.block_indices.pressure,
ExcNotImplemented());
Expand Down Expand Up @@ -513,7 +513,7 @@ namespace aspect
{
#define INSTANTIATE(dim) \
template struct RotationProperties<dim>; \
template void Simulator<dim>::remove_nullspace (LinearAlgebra::BlockVector &,LinearAlgebra::BlockVector &vector); \
template void Simulator<dim>::remove_nullspace (LinearAlgebra::BlockVector &,LinearAlgebra::BlockVector &vector) const; \
template void Simulator<dim>::setup_nullspace_constraints (AffineConstraints<double> &);

ASPECT_INSTANTIATE(INSTANTIATE)
Expand Down

0 comments on commit 4729969

Please sign in to comment.