From 84441687188caa4262a690bb9b11f49e5013f7c9 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 17 May 2001 12:07:52 +0000 Subject: [PATCH] Make variables const and thus Intel C++ compiler more happy. git-svn-id: https://svn.dealii.org/trunk@4631 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe_system.h | 8 +-- .../deal.II/include/fe/mapping_cartesian.h | 7 +-- deal.II/deal.II/include/grid/tria.h | 4 +- deal.II/deal.II/source/fe/fe_system.cc | 4 +- deal.II/deal.II/source/fe/mapping_q1.cc | 2 +- deal.II/deal.II/source/grid/grid_out.cc | 4 +- .../deal.II/source/grid/grid_reordering.cc | 4 +- deal.II/deal.II/source/grid/tria.cc | 57 ++++++++++++++----- 8 files changed, 60 insertions(+), 30 deletions(-) diff --git a/deal.II/deal.II/include/fe/fe_system.h b/deal.II/deal.II/include/fe/fe_system.h index f28bf4177f..88a68da9f3 100644 --- a/deal.II/deal.II/include/fe/fe_system.h +++ b/deal.II/deal.II/include/fe/fe_system.h @@ -260,9 +260,9 @@ class FESystem : public FiniteElement * independent of the cell. */ virtual typename Mapping::InternalDataBase* - get_data (const UpdateFlags, - const Mapping& mapping, - const Quadrature& quadrature) const ; + get_data (const UpdateFlags update_flags, + const Mapping &mapping, + const Quadrature &quadrature) const ; /** * Implementation of the same @@ -574,7 +574,7 @@ class FESystem : public FiniteElement * (see e.g. @p{FE_Q} * classes). */ - void delete_fe_values_data(unsigned int base_no); + void delete_fe_values_data (const unsigned int base_no); private: diff --git a/deal.II/deal.II/include/fe/mapping_cartesian.h b/deal.II/deal.II/include/fe/mapping_cartesian.h index 7be76a8446..0ed6799179 100644 --- a/deal.II/deal.II/include/fe/mapping_cartesian.h +++ b/deal.II/deal.II/include/fe/mapping_cartesian.h @@ -248,10 +248,9 @@ class MappingCartesian : public Mapping * Do the computation for the * @p{fill_*} functions. */ - void compute_fill (const typename DoFHandler::cell_iterator - &cell, - unsigned int face_no, - unsigned int sub_no, + void compute_fill (const typename DoFHandler::cell_iterator &cell, + const unsigned int face_no, + const unsigned int sub_no, InternalData& data, std::vector > &quadrature_points, std::vector >& normal_vectors) const; diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index 457ca134f5..af67385f3b 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -1758,7 +1758,7 @@ class Triangulation : public TriaDimensionInfo, * approximation by a piecewise * straight line. */ - void set_boundary (unsigned int number, + void set_boundary (const unsigned int number, const Boundary &boundary_object = *straight_boundary); /** @@ -1768,7 +1768,7 @@ class Triangulation : public TriaDimensionInfo, * the same as in * @p{set_boundary} */ - const Boundary & get_boundary (unsigned int number) const; + const Boundary & get_boundary (const unsigned int number) const; /** * Copy a triangulation. This diff --git a/deal.II/deal.II/source/fe/fe_system.cc b/deal.II/deal.II/source/fe/fe_system.cc index bb42c17216..1e6c8eed27 100644 --- a/deal.II/deal.II/source/fe/fe_system.cc +++ b/deal.II/deal.II/source/fe/fe_system.cc @@ -321,10 +321,12 @@ FESystem::update_each (const UpdateFlags flags) const template typename Mapping::InternalDataBase * -FESystem::get_data (UpdateFlags flags, +FESystem::get_data (const UpdateFlags flags_, const Mapping &mapping, const Quadrature &quadrature) const { + UpdateFlags flags = flags_; + InternalData* data = new InternalData(n_base_elements()); data->update_once = update_once (flags); diff --git a/deal.II/deal.II/source/fe/mapping_q1.cc b/deal.II/deal.II/source/fe/mapping_q1.cc index ed1699457c..e992094f51 100644 --- a/deal.II/deal.II/source/fe/mapping_q1.cc +++ b/deal.II/deal.II/source/fe/mapping_q1.cc @@ -374,7 +374,7 @@ MappingQ1::get_data (const UpdateFlags update_flags, template void -MappingQ1::compute_face_data (UpdateFlags update_flags, +MappingQ1::compute_face_data (const UpdateFlags update_flags, const Quadrature& q, const unsigned int n_original_q_points, InternalData& data) const diff --git a/deal.II/deal.II/source/grid/grid_out.cc b/deal.II/deal.II/source/grid/grid_out.cc index 00b1bb30c6..bf925e48e2 100644 --- a/deal.II/deal.II/source/grid/grid_out.cc +++ b/deal.II/deal.II/source/grid/grid_out.cc @@ -823,7 +823,7 @@ void GridOut::write_eps (const Triangulation &tria, template void GridOut::write (const Triangulation &tria, std::ostream &out, - OutputFormat output_format, + const OutputFormat output_format, const Mapping *mapping) { switch (output_format) @@ -859,4 +859,4 @@ template void GridOut::write_eps (const Triangulation &, #endif template void GridOut::write (const Triangulation &, std::ostream &, - OutputFormat); + const OutputFormat); diff --git a/deal.II/deal.II/source/grid/grid_reordering.cc b/deal.II/deal.II/source/grid/grid_reordering.cc index 6286fef6b3..da8841bd85 100644 --- a/deal.II/deal.II/source/grid/grid_reordering.cc +++ b/deal.II/deal.II/source/grid/grid_reordering.cc @@ -714,8 +714,10 @@ template inline void GridReordering::track_back (typename std::vector &cells, RotationStack &rotation_states, - unsigned int track_back_to_cell) + const unsigned tbtc) { + unsigned int track_back_to_cell = tbtc; + top_of_function: Assert (track_back_to_cell > 0, ExcInternalError()); diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index af652318bd..c8fa763988 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -2896,14 +2896,16 @@ Triangulation<3>::last_face (const unsigned int level) const { template <> TriaDimensionInfo<3>::active_face_iterator -Triangulation<3>::last_active_face () const { +Triangulation<3>::last_active_face () const +{ return last_active_quad (); }; template <> TriaDimensionInfo<3>::active_face_iterator -Triangulation<3>::last_active_face (const unsigned int level) const { +Triangulation<3>::last_active_face (const unsigned int level) const +{ return last_active_quad (level); }; @@ -2913,7 +2915,8 @@ Triangulation<3>::last_active_face (const unsigned int level) const { template typename TriaDimensionInfo::raw_line_iterator -Triangulation::begin_raw_line (unsigned int level) const { +Triangulation::begin_raw_line (const unsigned int level) const +{ Assert (levellines.lines.size() == 0) @@ -2925,9 +2928,11 @@ Triangulation::begin_raw_line (unsigned int level) const { }; + template typename TriaDimensionInfo::raw_quad_iterator -Triangulation::begin_raw_quad (unsigned int level) const { +Triangulation::begin_raw_quad (const unsigned int level) const +{ Assert (levelquads.quads.size() == 0) @@ -2939,9 +2944,11 @@ Triangulation::begin_raw_quad (unsigned int level) const { }; + template typename TriaDimensionInfo::raw_hex_iterator -Triangulation::begin_raw_hex (unsigned int level) const { +Triangulation::begin_raw_hex (const unsigned int level) const +{ Assert (levelhexes.hexes.size() == 0) @@ -2953,9 +2960,11 @@ Triangulation::begin_raw_hex (unsigned int level) const { }; + template typename TriaDimensionInfo::line_iterator -Triangulation::begin_line (unsigned int level) const { +Triangulation::begin_line (const unsigned int level) const +{ // level is checked in begin_raw raw_line_iterator ri = begin_raw_line (level); if (ri.state() != valid) @@ -2967,9 +2976,11 @@ Triangulation::begin_line (unsigned int level) const { }; + template typename TriaDimensionInfo::quad_iterator -Triangulation::begin_quad (unsigned int level) const { +Triangulation::begin_quad (const unsigned int level) const +{ // level is checked in begin_raw raw_quad_iterator ri = begin_raw_quad (level); if (ri.state() != valid) @@ -2981,9 +2992,11 @@ Triangulation::begin_quad (unsigned int level) const { }; + template typename TriaDimensionInfo::hex_iterator -Triangulation::begin_hex (unsigned int level) const { +Triangulation::begin_hex (const unsigned int level) const +{ // level is checked in begin_raw raw_hex_iterator ri = begin_raw_hex (level); if (ri.state() != valid) @@ -2995,9 +3008,11 @@ Triangulation::begin_hex (unsigned int level) const { }; + template typename TriaDimensionInfo::active_line_iterator -Triangulation::begin_active_line (unsigned int level) const { +Triangulation::begin_active_line (const unsigned int level) const +{ // level is checked in begin_raw line_iterator i = begin_line (level); if (i.state() != valid) @@ -3009,9 +3024,11 @@ Triangulation::begin_active_line (unsigned int level) const { }; + template typename TriaDimensionInfo::active_quad_iterator -Triangulation::begin_active_quad (unsigned int level) const { +Triangulation::begin_active_quad (const unsigned int level) const +{ // level is checked in begin_raw quad_iterator i = begin_quad (level); if (i.state() != valid) @@ -3023,9 +3040,11 @@ Triangulation::begin_active_quad (unsigned int level) const { }; + template typename TriaDimensionInfo::active_hex_iterator -Triangulation::begin_active_hex (unsigned int level) const { +Triangulation::begin_active_hex (const unsigned int level) const +{ // level is checked in begin_raw hex_iterator i = begin_hex (level); if (i.state() != valid) @@ -3037,36 +3056,44 @@ Triangulation::begin_active_hex (unsigned int level) const { }; + template typename TriaDimensionInfo::raw_line_iterator -Triangulation::end_line () const { +Triangulation::end_line () const +{ return raw_line_iterator (const_cast*>(this), -1, -1); }; + template typename TriaDimensionInfo::raw_quad_iterator -Triangulation::end_quad () const { +Triangulation::end_quad () const +{ return raw_quad_iterator (const_cast*>(this), -1, -1); }; + template typename TriaDimensionInfo::raw_hex_iterator -Triangulation::end_hex () const { +Triangulation::end_hex () const +{ return raw_hex_iterator (const_cast*>(this), -1, -1); }; + template typename TriaDimensionInfo::raw_line_iterator -Triangulation::last_raw_line (const unsigned int level) const { +Triangulation::last_raw_line (const unsigned int level) const +{ Assert (levellines.lines.size() != 0, ExcEmptyLevel (level)); -- 2.39.5