From 7ea1982bf981929f421955a7983891f20768f375 Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 27 Feb 2014 21:23:54 +0000 Subject: [PATCH] Fix a number of warnings produced by ICC. git-svn-id: https://svn.dealii.org/trunk@32579 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/base/data_out_base.cc | 6 +-- deal.II/source/dofs/dof_handler.cc | 9 +--- deal.II/source/dofs/dof_handler_policy.cc | 15 +++---- deal.II/source/dofs/dof_renumbering.cc | 4 +- deal.II/source/dofs/dof_tools.cc | 6 +-- deal.II/source/dofs/dof_tools_sparsity.cc | 11 ++--- deal.II/source/fe/fe_tools.cc | 6 +-- deal.II/source/grid/grid_out.cc | 30 ++++++------- deal.II/source/grid/tria.cc | 6 +-- deal.II/source/lac/sparsity_pattern.cc | 4 +- deal.II/source/lac/trilinos_sparse_matrix.cc | 1 - deal.II/source/multigrid/mg_tools.cc | 42 +++++++++---------- deal.II/source/numerics/data_out.cc | 24 +++++------ deal.II/source/numerics/data_out_faces.cc | 26 ++++++------ .../numerics/derivative_approximation.cc | 6 +-- .../source/numerics/point_value_history.cc | 11 +++-- 16 files changed, 94 insertions(+), 113 deletions(-) diff --git a/deal.II/source/base/data_out_base.cc b/deal.II/source/base/data_out_base.cc index 58a8fbd5dc..bc33d4e57f 100644 --- a/deal.II/source/base/data_out_base.cc +++ b/deal.II/source/base/data_out_base.cc @@ -2731,11 +2731,9 @@ namespace DataOutBase Point<3> v_min, v_max, v_inter; // Use the Bubblesort algorithm to sort the points with respect to the third coordinate - int i, j; - - for (i = 0; i < 2; ++i) + for (int i = 0; i < 2; ++i) { - for (j = 0; j < 2-i; ++j) + for (int j = 0; j < 2-i; ++j) { if (points[j][2] > points[j + 1][2]) { diff --git a/deal.II/source/dofs/dof_handler.cc b/deal.II/source/dofs/dof_handler.cc index ce78e1d5d2..eda98397a2 100644 --- a/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/source/dofs/dof_handler.cc @@ -1408,10 +1408,7 @@ void DoFHandler<3>::renumber_dofs (const unsigned int level, // level, as those lines logically belong to the same // level as the cell, at least for for isotropic // refinement - - level_cell_iterator cell = begin(level), - endcell = end(level); - for ( ; cell != endcell ; ++cell) + for (level_cell_iterator cell = begin(level) ; cell != end(level) ; ++cell) for (unsigned int line=0; line < GeometryInfo<3>::lines_per_cell; ++line) cell->line(line)->set_user_flag(); @@ -1441,9 +1438,7 @@ void DoFHandler<3>::renumber_dofs (const unsigned int level, // level, as those lines logically belong to the same // level as the cell, at least for for isotropic // refinement - level_cell_iterator cell = begin(level), - endcell = end(level); - for ( ; cell != endcell ; ++cell) + for (level_cell_iterator cell = begin(level) ; cell != end(level); ++cell) for (unsigned int quad=0; quad < GeometryInfo<3>::faces_per_cell; ++quad) cell->face(quad)->set_user_flag(); diff --git a/deal.II/source/dofs/dof_handler_policy.cc b/deal.II/source/dofs/dof_handler_policy.cc index 2dd018b6d2..3af161ec67 100644 --- a/deal.II/source/dofs/dof_handler_policy.cc +++ b/deal.II/source/dofs/dof_handler_policy.cc @@ -730,9 +730,8 @@ namespace internal // level, as those lines logically belong to the same // level as the cell, at least for for isotropic // refinement - typename DoFHandler<2,spacedim>::level_cell_iterator cell = dof_handler.begin(level), - endcell = dof_handler.end(level); - for ( ; cell != endcell; ++cell) + for (typename DoFHandler<2,spacedim>::level_cell_iterator cell = dof_handler.begin(level); + cell != dof_handler.end(level); ++cell) for (unsigned int line=0; line < GeometryInfo<2>::faces_per_cell; ++line) cell->face(line)->set_user_flag(); @@ -2083,9 +2082,8 @@ namespace internal tr->clear_user_flags (); //mark all own cells for transfer - typename DoFHandler::active_cell_iterator - cell, endc = dof_handler.end(); - for (cell = dof_handler.begin_active(); cell != endc; ++cell) + for (typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(); + cell != dof_handler.end(); ++cell) if (!cell->is_artificial()) cell->set_user_flag(); @@ -2120,10 +2118,9 @@ namespace internal //check that we are really done { std::vector local_dof_indices; - typename DoFHandler::active_cell_iterator - cell, endc = dof_handler.end(); - for (cell = dof_handler.begin_active(); cell != endc; ++cell) + for (typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(); + cell != dof_handler.end(); ++cell) if (!cell->is_artificial()) { local_dof_indices.resize (cell->get_fe().dofs_per_cell); diff --git a/deal.II/source/dofs/dof_renumbering.cc b/deal.II/source/dofs/dof_renumbering.cc index d341ce93fc..654ac53e24 100644 --- a/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/source/dofs/dof_renumbering.cc @@ -1233,11 +1233,11 @@ namespace DoFRenumbering tria->get_p4est_tree_to_coarse_cell_permutation() [c]; const typename DoFHandler::level_cell_iterator - cell (tria, 0, coarse_cell_index, &dof_handler); + this_cell (tria, 0, coarse_cell_index, &dof_handler); next_free = compute_hierarchical_recursive (next_free, renumbering, - cell, + this_cell, locally_owned); } #else diff --git a/deal.II/source/dofs/dof_tools.cc b/deal.II/source/dofs/dof_tools.cc index 74e9345301..3ea5499334 100644 --- a/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/source/dofs/dof_tools.cc @@ -2035,10 +2035,10 @@ namespace DoFTools vertex_dof_count[vg] = 0; // Create a mapping from all vertices to the ones used here - unsigned int i=0; + unsigned int n_vertex_count=0; for (unsigned int vg=0; vgget_dof_indices (local_dof_indices_row); cell_col->get_dof_indices (local_dof_indices_col); - for (unsigned int i=0; iget_dof_indices (local_dof_indices_row); cell_col_child->get_dof_indices (local_dof_indices_col); - for (unsigned int i=0; ineighbor_is_coarser(face)) continue; - typename DH::face_iterator cell_face = cell->face(face); const unsigned int neighbor_face = cell->neighbor_of_neighbor(face); @@ -1013,8 +1012,6 @@ namespace DoFTools if (cell->neighbor_is_coarser(face)) continue; - typename dealii::hp::DoFHandler::face_iterator - cell_face = cell->face(face); const unsigned int neighbor_face = cell->neighbor_of_neighbor(face); diff --git a/deal.II/source/fe/fe_tools.cc b/deal.II/source/fe/fe_tools.cc index 87a9685e71..23470cbfeb 100644 --- a/deal.II/source/fe/fe_tools.cc +++ b/deal.II/source/fe/fe_tools.cc @@ -369,16 +369,16 @@ namespace FETools element.n_blocks())); types::global_dof_index k=0; - unsigned int i=0; + unsigned int count=0; for (unsigned int b=0; b start_indices(block_data.size()); k = 0; diff --git a/deal.II/source/grid/grid_out.cc b/deal.II/source/grid/grid_out.cc index e2a26b6907..acb1011e25 100644 --- a/deal.II/source/grid/grid_out.cc +++ b/deal.II/source/grid/grid_out.cc @@ -1411,18 +1411,15 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const float x_dimension_perspective, y_dimension_perspective; - Triangulation<2,2>::cell_iterator cell = tria.begin(), endc = tria.end(); - // auxiliary variables for the bounding box and the range of cell levels - double x_min = cell->vertex(0)[0]; - double x_max = cell->vertex(0)[0]; - double y_min = cell->vertex(0)[1]; - double y_max = cell->vertex(0)[1]; + double x_min = tria.begin()->vertex(0)[0]; + double x_max = tria.begin()->vertex(0)[0]; + double y_min = tria.begin()->vertex(0)[1]; + double y_max = tria.begin()->vertex(0)[1]; double x_dimension, y_dimension; - min_level = cell->level(); - max_level = cell->level(); + min_level = max_level = tria.begin()->level(); // auxiliary array for the materials being used (material ids 255 max.) unsigned int materials[256]; @@ -1448,7 +1445,7 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const // bounding box of the given triangulation and check // the cells for material id, level number, subdomain id // (, and level subdomain id). - for (; cell != endc; ++cell) + for (Triangulation<2,2>::cell_iterator cell = tria.begin(); cell != tria.end(); ++cell) { for (unsigned int vertex_index = 0; vertex_index < 4; vertex_index++) { @@ -1582,18 +1579,15 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const // determine the bounding box of the given triangulation on the projection plane of the camera viewing system - cell = tria.begin(); - endc = tria.end(); - - point[0] = cell->vertex(0)[0]; - point[1] = cell->vertex(0)[1]; + point[0] = tria.begin()->vertex(0)[0]; + point[1] = tria.begin()->vertex(0)[1]; point[2] = 0; float min_level_min_vertex_distance = 0; if (svg_flags.convert_level_number_to_height) { - point[2] = svg_flags.level_height_factor * ((float)cell->level() / (float)n_levels) * std::max(x_dimension, y_dimension); + point[2] = svg_flags.level_height_factor * ((float)tria.begin()->level() / (float)n_levels) * std::max(x_dimension, y_dimension); } projection_decomposition = GridOut::svg_project_point(point, camera_position, camera_direction, camera_horizontal, camera_focus); @@ -1604,7 +1598,7 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const y_max_perspective = projection_decomposition[1]; y_min_perspective = projection_decomposition[1]; - for (; cell != endc; ++cell) + for (Triangulation<2,2>::cell_iterator cell = tria.begin(); cell != tria.end(); ++cell) { point[0] = cell->vertex(0)[0]; point[1] = cell->vertex(0)[1]; @@ -1831,7 +1825,9 @@ void GridOut::write_svg(const Triangulation<2,2> &tria, std::ostream &out) const for (unsigned int level_index = min_level; level_index <= max_level; level_index++) { - Triangulation<2,2>::cell_iterator cell = tria.begin(level_index), endc = tria.end(level_index); + Triangulation<2,2>::cell_iterator + cell = tria.begin(level_index), + endc = tria.end(level_index); for (; cell != endc; ++cell) { diff --git a/deal.II/source/grid/tria.cc b/deal.II/source/grid/tria.cc index 620b7089ef..ee0dbe74f9 100644 --- a/deal.II/source/grid/tria.cc +++ b/deal.II/source/grid/tria.cc @@ -5723,10 +5723,10 @@ namespace internal for (unsigned int q=0; qquads.cells.size(); ++q) for (unsigned int l=0; l::lines_per_face; ++l) { - const int index=triangulation.faces->quads.cells[q].face(l); - if (index==old_index_0) + const int this_index=triangulation.faces->quads.cells[q].face(l); + if (this_index==old_index_0) triangulation.faces->quads.cells[q].set_face(l,new_index_0); - else if (index==old_index_1) + else if (this_index==old_index_1) triangulation.faces->quads.cells[q].set_face(l,new_index_1); } // now we have to copy diff --git a/deal.II/source/lac/sparsity_pattern.cc b/deal.II/source/lac/sparsity_pattern.cc index 43f4c9ffe8..88d11d479c 100644 --- a/deal.II/source/lac/sparsity_pattern.cc +++ b/deal.II/source/lac/sparsity_pattern.cc @@ -811,8 +811,8 @@ SparsityPattern::add_entries (const size_type row, else // cannot just append the new range at the end, forward to the // other function - for (ForwardIterator it = begin; it != end; ++it) - add (row, *it); + for (ForwardIterator p = begin; p != end; ++p) + add (row, *p); } } else diff --git a/deal.II/source/lac/trilinos_sparse_matrix.cc b/deal.II/source/lac/trilinos_sparse_matrix.cc index 0443687b93..14b547e45b 100644 --- a/deal.II/source/lac/trilinos_sparse_matrix.cc +++ b/deal.II/source/lac/trilinos_sparse_matrix.cc @@ -955,7 +955,6 @@ namespace TrilinosWrappers - inline void SparseMatrix::compress (::dealii::VectorOperation::values operation) { diff --git a/deal.II/source/multigrid/mg_tools.cc b/deal.II/source/multigrid/mg_tools.cc index 62589b793f..3c4db2437c 100644 --- a/deal.II/source/multigrid/mg_tools.cc +++ b/deal.II/source/multigrid/mg_tools.cc @@ -224,8 +224,8 @@ namespace MGTools if (level_boundary) { - for (unsigned int i=0; iget_mg_dof_indices(neighbor_indices); - for (unsigned int i=0; iget_mg_dof_indices(neighbor_indices); for (unsigned int base=0; base *cell_and_index, // first fill dof_data for (unsigned int dataset=0; datasetdof_data.size(); ++dataset) { - const FEValuesBase &fe_patch_values + const FEValuesBase &this_fe_patch_values = data.get_present_fe_values (dataset); const unsigned int n_components = - fe_patch_values.get_fe().n_components(); + this_fe_patch_values.get_fe().n_components(); const DataPostprocessor *postprocessor=this->dof_data[dataset]->postprocessor; @@ -149,17 +149,17 @@ build_one_patch (const std::pair *cell_and_index, // at each point there is only one component of value, // gradient etc. if (update_flags & update_values) - this->dof_data[dataset]->get_function_values (fe_patch_values, + this->dof_data[dataset]->get_function_values (this_fe_patch_values, data.patch_values); if (update_flags & update_gradients) - this->dof_data[dataset]->get_function_gradients (fe_patch_values, + this->dof_data[dataset]->get_function_gradients (this_fe_patch_values, data.patch_gradients); if (update_flags & update_hessians) - this->dof_data[dataset]->get_function_hessians (fe_patch_values, + this->dof_data[dataset]->get_function_hessians (this_fe_patch_values, data.patch_hessians); if (update_flags & update_quadrature_points) - data.patch_evaluation_points = fe_patch_values.get_quadrature_points(); + data.patch_evaluation_points = this_fe_patch_values.get_quadrature_points(); std::vector > dummy_normals; @@ -178,17 +178,17 @@ build_one_patch (const std::pair *cell_and_index, // at each point there is a vector valued function and its // derivative... if (update_flags & update_values) - this->dof_data[dataset]->get_function_values (fe_patch_values, + this->dof_data[dataset]->get_function_values (this_fe_patch_values, data.patch_values_system); if (update_flags & update_gradients) - this->dof_data[dataset]->get_function_gradients (fe_patch_values, + this->dof_data[dataset]->get_function_gradients (this_fe_patch_values, data.patch_gradients_system); if (update_flags & update_hessians) - this->dof_data[dataset]->get_function_hessians (fe_patch_values, + this->dof_data[dataset]->get_function_hessians (this_fe_patch_values, data.patch_hessians_system); if (update_flags & update_quadrature_points) - data.patch_evaluation_points = fe_patch_values.get_quadrature_points(); + data.patch_evaluation_points = this_fe_patch_values.get_quadrature_points(); std::vector > dummy_normals; @@ -214,7 +214,7 @@ build_one_patch (const std::pair *cell_and_index, // reasons. if (n_components == 1) { - this->dof_data[dataset]->get_function_values (fe_patch_values, + this->dof_data[dataset]->get_function_values (this_fe_patch_values, data.patch_values); for (unsigned int q=0; q *cell_and_index, else { data.resize_system_vectors(n_components); - this->dof_data[dataset]->get_function_values (fe_patch_values, + this->dof_data[dataset]->get_function_values (this_fe_patch_values, data.patch_values_system); for (unsigned int component=0; componentdof_data.size(); ++dataset) { - const FEValuesBase &fe_patch_values + const FEValuesBase &this_fe_patch_values = data.get_present_fe_values (dataset); const unsigned int n_components - = fe_patch_values.get_fe().n_components(); + = this_fe_patch_values.get_fe().n_components(); const DataPostprocessor *postprocessor=this->dof_data[dataset]->postprocessor; if (postprocessor != 0) { @@ -154,24 +154,24 @@ build_one_patch (const FaceDescriptor *cell_and_face, // thus does not depend on the number of components of the data // vector if (update_flags & update_normal_vectors) - data.patch_normals=fe_patch_values.get_normal_vectors(); + data.patch_normals=this_fe_patch_values.get_normal_vectors(); if (n_components == 1) { // at each point there is only one component of value, // gradient etc. if (update_flags & update_values) - this->dof_data[dataset]->get_function_values (fe_patch_values, + this->dof_data[dataset]->get_function_values (this_fe_patch_values, data.patch_values); if (update_flags & update_gradients) - this->dof_data[dataset]->get_function_gradients (fe_patch_values, + this->dof_data[dataset]->get_function_gradients (this_fe_patch_values, data.patch_gradients); if (update_flags & update_hessians) - this->dof_data[dataset]->get_function_hessians (fe_patch_values, + this->dof_data[dataset]->get_function_hessians (this_fe_patch_values, data.patch_hessians); if (update_flags & update_quadrature_points) - data.patch_evaluation_points = fe_patch_values.get_quadrature_points(); + data.patch_evaluation_points = this_fe_patch_values.get_quadrature_points(); postprocessor-> compute_derived_quantities_scalar(data.patch_values, @@ -187,17 +187,17 @@ build_one_patch (const FaceDescriptor *cell_and_face, // derivative... data.resize_system_vectors(n_components); if (update_flags & update_values) - this->dof_data[dataset]->get_function_values (fe_patch_values, + this->dof_data[dataset]->get_function_values (this_fe_patch_values, data.patch_values_system); if (update_flags & update_gradients) - this->dof_data[dataset]->get_function_gradients (fe_patch_values, + this->dof_data[dataset]->get_function_gradients (this_fe_patch_values, data.patch_gradients_system); if (update_flags & update_hessians) - this->dof_data[dataset]->get_function_hessians (fe_patch_values, + this->dof_data[dataset]->get_function_hessians (this_fe_patch_values, data.patch_hessians_system); if (update_flags & update_quadrature_points) - data.patch_evaluation_points = fe_patch_values.get_quadrature_points(); + data.patch_evaluation_points = this_fe_patch_values.get_quadrature_points(); postprocessor-> compute_derived_quantities_vector(data.patch_values_system, @@ -220,7 +220,7 @@ build_one_patch (const FaceDescriptor *cell_and_face, // reasons. if (n_components == 1) { - this->dof_data[dataset]->get_function_values (fe_patch_values, + this->dof_data[dataset]->get_function_values (this_fe_patch_values, data.patch_values); for (unsigned int q=0; qdof_data[dataset]->get_function_values (fe_patch_values, + this->dof_data[dataset]->get_function_values (this_fe_patch_values, data.patch_values_system); for (unsigned int component=0; component &fe_midpoint_value + const FEValues &neighbor_fe_midpoint_value = x_fe_midpoint_value.get_present_fe_values(); // ...and get the value of the // solution... const typename DerivativeDescription::ProjectedDerivative neighbor_midpoint_value - = DerivativeDescription::get_projected_derivative (fe_midpoint_value, + = DerivativeDescription::get_projected_derivative (neighbor_fe_midpoint_value, solution, component); // ...and the place where it lives const Point - neighbor_center = fe_midpoint_value.quadrature_point(0); + neighbor_center = neighbor_fe_midpoint_value.quadrature_point(0); // vector for the diff --git a/deal.II/source/numerics/point_value_history.cc b/deal.II/source/numerics/point_value_history.cc index c7b849693b..ae1c763e57 100644 --- a/deal.II/source/numerics/point_value_history.cc +++ b/deal.II/source/numerics/point_value_history.cc @@ -976,8 +976,6 @@ void PointValueHistory // write column headings - std::map > >::iterator - data_store_begin = data_store.begin (); to_gnuplot << "# "; if (indep_names.size() > 0) @@ -995,7 +993,8 @@ void PointValueHistory } } - for (; data_store_begin != data_store.end (); data_store_begin++) + for (std::map > >::iterator + data_store_begin = data_store.begin (); data_store_begin != data_store.end (); ++data_store_begin) { typename std::map ::iterator mask = component_mask.find(data_store_begin->first); unsigned int n_stored = mask->second.n_selected_components(); @@ -1022,8 +1021,6 @@ void PointValueHistory // write data stored for the point for (unsigned int key = 0; key < dataset_key.size (); key++) { - std::map > >::iterator - data_store_begin = data_store.begin (); to_gnuplot << dataset_key[key]; for (unsigned int component = 0; component < n_indep; component++) @@ -1031,7 +1028,9 @@ void PointValueHistory to_gnuplot << " " << independent_values[component][key]; } - for (; data_store_begin != data_store.end (); data_store_begin++) + for (std::map > >::iterator + data_store_begin = data_store.begin (); + data_store_begin != data_store.end (); ++data_store_begin) { typename std::map ::iterator mask = component_mask.find(data_store_begin->first); unsigned int n_stored = mask->second.n_selected_components(); -- 2.39.5