From: Wolfgang Bangerth Date: Mon, 30 Nov 2020 05:18:44 +0000 (-0700) Subject: Mark a number of input arguments as 'const'. X-Git-Tag: v9.3.0-rc1~835^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a683e4cc1f9a2fd39603825838387108b4d86d23;p=dealii.git Mark a number of input arguments as 'const'. --- diff --git a/include/deal.II/lac/affine_constraints.h b/include/deal.II/lac/affine_constraints.h index 4be3e09e87..9bf858cdb6 100644 --- a/include/deal.II/lac/affine_constraints.h +++ b/include/deal.II/lac/affine_constraints.h @@ -1877,8 +1877,8 @@ private: const std::vector &local_dof_indices, MatrixType & global_matrix, VectorType & global_vector, - bool use_inhomogeneities_for_rhs, - std::integral_constant) const; + const bool use_inhomogeneities_for_rhs, + const std::integral_constant) const; /** * This function actually implements the local_to_global function for block @@ -1891,8 +1891,8 @@ private: const std::vector &local_dof_indices, MatrixType & global_matrix, VectorType & global_vector, - bool use_inhomogeneities_for_rhs, - std::integral_constant) const; + const bool use_inhomogeneities_for_rhs, + const std::integral_constant) const; /** * This function actually implements the local_to_global function for @@ -1904,7 +1904,7 @@ private: SparsityPatternType & sparsity_pattern, const bool keep_constrained_entries, const Table<2, bool> &dof_mask, - std::integral_constant) const; + const std::integral_constant) const; /** * This function actually implements the local_to_global function for block @@ -1916,7 +1916,7 @@ private: SparsityPatternType & sparsity_pattern, const bool keep_constrained_entries, const Table<2, bool> &dof_mask, - std::integral_constant) const; + const std::integral_constant) const; /** * Internal helper function for distribute_local_to_global function. diff --git a/include/deal.II/lac/affine_constraints.templates.h b/include/deal.II/lac/affine_constraints.templates.h index 65f3002a97..4d0c728c8c 100644 --- a/include/deal.II/lac/affine_constraints.templates.h +++ b/include/deal.II/lac/affine_constraints.templates.h @@ -3361,6 +3361,8 @@ namespace internal } // end of namespace AffineConstraints } // end of namespace internal + + // Basic idea of setting up a list of // all global dofs: first find all rows and columns // that we are going to write touch, @@ -3428,6 +3430,8 @@ AffineConstraints::make_sorted_row_list( } } + + // Same function as before, but now do only extract the global indices that // come from the local ones without storing their origin. Used for sparsity // pattern generation. @@ -3482,6 +3486,8 @@ AffineConstraints::make_sorted_row_list( } } + + // Resolve the constraints from the vector and apply inhomogeneities. template template @@ -3526,6 +3532,8 @@ AffineConstraints::resolve_vector_entry( return val; } + + // internal implementation for distribute_local_to_global for standard // (non-block) matrices template @@ -3537,8 +3545,8 @@ AffineConstraints::distribute_local_to_global( const std::vector &local_dof_indices, MatrixType & global_matrix, VectorType & global_vector, - bool use_inhomogeneities_for_rhs, - std::integral_constant) const + const bool use_inhomogeneities_for_rhs, + const std::integral_constant) const { // FIXME: static_assert MatrixType::value_type == number @@ -3681,6 +3689,8 @@ AffineConstraints::distribute_local_to_global( use_inhomogeneities_for_rhs); } + + // similar function as above, but now specialized for block matrices. See the // other function for additional comments. template @@ -3692,8 +3702,8 @@ AffineConstraints::distribute_local_to_global( const std::vector &local_dof_indices, MatrixType & global_matrix, VectorType & global_vector, - bool use_inhomogeneities_for_rhs, - std::integral_constant) const + const bool use_inhomogeneities_for_rhs, + const std::integral_constant) const { const bool use_vectors = (local_vector.size() == 0 && global_vector.size() == 0) ? false : true; @@ -3818,6 +3828,7 @@ AffineConstraints::distribute_local_to_global( } + template template void @@ -3832,6 +3843,7 @@ AffineConstraints::distribute_local_to_global( } + template template void @@ -3895,6 +3907,8 @@ AffineConstraints::distribute_local_to_global( } } + + template template void @@ -3903,7 +3917,7 @@ AffineConstraints::add_entries_local_to_global( SparsityPatternType & sparsity_pattern, const bool keep_constrained_entries, const Table<2, bool> & dof_mask, - std::integral_constant) const + const std::integral_constant) const { Assert(sparsity_pattern.n_rows() == sparsity_pattern.n_cols(), ExcNotQuadratic()); @@ -3990,6 +4004,8 @@ AffineConstraints::add_entries_local_to_global( sparsity_pattern); } + + template template void @@ -4045,6 +4061,8 @@ AffineConstraints::add_entries_local_to_global( Assert(false, ExcNotImplemented()); } + + template template void @@ -4053,7 +4071,7 @@ AffineConstraints::add_entries_local_to_global( SparsityPatternType & sparsity_pattern, const bool keep_constrained_entries, const Table<2, bool> & dof_mask, - std::integral_constant) const + const std::integral_constant) const { // just as the other add_entries_local_to_global function, but now // specialized for block matrices.