From: bangerth Date: Thu, 27 Feb 2014 22:53:53 +0000 (+0000) Subject: Fix a number of warnings produced by ICC. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d8aa4cbe250ea10e16279995fc091e549f6b7c2;p=dealii-svn.git Fix a number of warnings produced by ICC. git-svn-id: https://svn.dealii.org/trunk@32581 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/dofs/dof_handler.cc b/deal.II/source/dofs/dof_handler.cc index eda98397a2..503e2357d5 100644 --- a/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/source/dofs/dof_handler.cc @@ -1348,9 +1348,7 @@ void DoFHandler<2>::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<2>::faces_per_cell; ++line) cell->face(line)->set_user_flag(); diff --git a/deal.II/source/fe/fe_tools.cc b/deal.II/source/fe/fe_tools.cc index 23470cbfeb..af14cf582b 100644 --- a/deal.II/source/fe/fe_tools.cc +++ b/deal.II/source/fe/fe_tools.cc @@ -908,51 +908,53 @@ namespace FETools // shape value on the cell. std::vector face_c_dofs(n); std::vector face_f_dofs(n); - unsigned int k=0; - for (unsigned int i=0; i::vertices_per_face; ++i) - { - const unsigned int offset_c = GeometryInfo::face_to_cell_vertices(face_coarse, i) - *fe.dofs_per_vertex; - const unsigned int offset_f = GeometryInfo::face_to_cell_vertices(face_fine, i) - *fe.dofs_per_vertex; - for (unsigned int j=0; j::lines_per_face; ++i) - { - const unsigned int offset_c = fe.first_line_index - + GeometryInfo::face_to_cell_lines(face_coarse, i-1) - *fe.dofs_per_line; - const unsigned int offset_f = fe.first_line_index - + GeometryInfo::face_to_cell_lines(face_fine, i-1) - *fe.dofs_per_line; - for (unsigned int j=0; j::quads_per_face; ++i) - { - const unsigned int offset_c = fe.first_quad_index - + face_coarse - *fe.dofs_per_quad; - const unsigned int offset_f = fe.first_quad_index - + face_fine - *fe.dofs_per_quad; - for (unsigned int j=0; j::vertices_per_face; ++i) + { + const unsigned int offset_c = GeometryInfo::face_to_cell_vertices(face_coarse, i) + *fe.dofs_per_vertex; + const unsigned int offset_f = GeometryInfo::face_to_cell_vertices(face_fine, i) + *fe.dofs_per_vertex; + for (unsigned int j=0; j::lines_per_face; ++i) + { + const unsigned int offset_c = fe.first_line_index + + GeometryInfo::face_to_cell_lines(face_coarse, i-1) + *fe.dofs_per_line; + const unsigned int offset_f = fe.first_line_index + + GeometryInfo::face_to_cell_lines(face_fine, i-1) + *fe.dofs_per_line; + for (unsigned int j=0; j::quads_per_face; ++i) + { + const unsigned int offset_c = fe.first_quad_index + + face_coarse + *fe.dofs_per_quad; + const unsigned int offset_f = fe.first_quad_index + + face_fine + *fe.dofs_per_quad; + for (unsigned int j=0; jface(i)->set_boundary_indicator(1); for (unsigned int j=0; j::lines_per_face; ++j) { - const Point<3> vertices[2] + const Point<3> line_vertices[2] = { cell->face(i)->line(j)->vertex(0), cell->face(i)->line(j)->vertex(1) }; - if ((std::fabs(vertices[0].distance(center)-radius) > + if ((std::fabs(line_vertices[0].distance(center)-radius) > 1e-5*radius) || - (std::fabs(vertices[1].distance(center)-radius) > + (std::fabs(line_vertices[1].distance(center)-radius) > 1e-5*radius)) cell->face(i)->line(j)->set_boundary_indicator(1); } diff --git a/deal.II/source/grid/grid_in.cc b/deal.II/source/grid/grid_in.cc index 3bc720ce6e..52ae8a5187 100644 --- a/deal.II/source/grid/grid_in.cc +++ b/deal.II/source/grid/grid_in.cc @@ -2036,8 +2036,8 @@ void GridIn::parse_tecplot_header(std::string &header, AssertThrow(n_vars>=dim, ExcMessage("Tecplot file must contain at least one variable for each dimension")); - for (unsigned int i=1; i0, + for (unsigned int d=1; d0, ExcMessage("Tecplot file must contain at least one variable for each dimension.")); } else if (Utilities::match_at_string_start(entries[i],"ZONETYPE=ORDERED")) diff --git a/deal.II/source/grid/grid_out.cc b/deal.II/source/grid/grid_out.cc index acb1011e25..d4415d620a 100644 --- a/deal.II/source/grid/grid_out.cc +++ b/deal.II/source/grid/grid_out.cc @@ -3277,11 +3277,9 @@ namespace internal case 2: { - typename dealii::Triangulation::active_cell_iterator - cell=tria.begin_active(), - endc=tria.end(); - - for (; cell!=endc; ++cell) + for (typename dealii::Triangulation::active_cell_iterator + cell=tria.begin_active(); + cell!=tria.end(); ++cell) for (unsigned int line_no=0; line_no::lines_per_cell; ++line_no) { @@ -3352,11 +3350,9 @@ namespace internal // boundary faces and // generate the info from // them - typename dealii::Triangulation::active_cell_iterator - cell=tria.begin_active (); - const typename dealii::Triangulation::active_cell_iterator - end=tria.end (); - for (; cell!=end; ++cell) + for (typename dealii::Triangulation::active_cell_iterator + cell=tria.begin_active(); + cell!=tria.end(); ++cell) for (unsigned int face_no=0; face_no::faces_per_cell; ++face_no) { const typename dealii::Triangulation::face_iterator diff --git a/deal.II/source/grid/grid_reordering.cc b/deal.II/source/grid/grid_reordering.cc index 59d187df34..9b478ad08c 100644 --- a/deal.II/source/grid/grid_reordering.cc +++ b/deal.II/source/grid/grid_reordering.cc @@ -1538,10 +1538,10 @@ namespace internal // rotation to get the new // cube unsigned int temp[8]; - for (unsigned int i=0; i<8; ++i) - temp[i] = the_cell.nodes[CubePermutations[perm_num][i]]; - for (unsigned int i=0; i<8; ++i) - the_cell.nodes[i] = temp[i]; + for (unsigned int v=0; v<8; ++v) + temp[v] = the_cell.nodes[CubePermutations[perm_num][v]]; + for (unsigned int v=0; v<8; ++v) + the_cell.nodes[v] = temp[v]; } } } // namespace GridReordering3d diff --git a/deal.II/source/grid/grid_tools.cc b/deal.II/source/grid/grid_tools.cc index e96dab3f2f..84e781be1e 100644 --- a/deal.II/source/grid/grid_tools.cc +++ b/deal.II/source/grid/grid_tools.cc @@ -2170,11 +2170,9 @@ next_cell: do { bool changed = false; - typename Container::active_cell_iterator - cell = surface_mesh.begin_active(), - endc = surface_mesh.end(); - for (; cell!=endc; ++cell) + for (typename Container::active_cell_iterator + cell = surface_mesh.begin_active(); cell!=surface_mesh.end(); ++cell) if (surface_to_volume_mapping[cell]->has_children() == true ) { cell->set_refine_flag (); @@ -2186,14 +2184,12 @@ next_cell: const_cast&>(get_tria(surface_mesh)) .execute_coarsening_and_refinement(); - typename Container::cell_iterator - cell = surface_mesh.begin(), - endc = surface_mesh.end(); - for (; cell!=endc; ++cell) - for (unsigned int c=0; cn_children(); c++) - if (surface_to_volume_mapping.find(cell->child(c)) == surface_to_volume_mapping.end()) - surface_to_volume_mapping[cell->child(c)] - = surface_to_volume_mapping[cell]->child(c); + for (typename Container::cell_iterator + surface_cell = surface_mesh.begin(); surface_cell!=surface_mesh.end(); ++surface_cell) + for (unsigned int c=0; cn_children(); c++) + if (surface_to_volume_mapping.find(surface_cell->child(c)) == surface_to_volume_mapping.end()) + surface_to_volume_mapping[surface_cell->child(c)] + = surface_to_volume_mapping[surface_cell]->child(c); } else break; diff --git a/deal.II/source/grid/tria.cc b/deal.II/source/grid/tria.cc index ee0dbe74f9..4decbf7886 100644 --- a/deal.II/source/grid/tria.cc +++ b/deal.II/source/grid/tria.cc @@ -5814,10 +5814,10 @@ namespace internal for (unsigned int h=0; hcells.cells.size(); ++h) for (unsigned int q=0; q::faces_per_cell; ++q) { - const int index=triangulation.levels[l]->cells.cells[h].face(q); - if (index==switch_1_index) + const int face_index=triangulation.levels[l]->cells.cells[h].face(q); + if (face_index==switch_1_index) triangulation.levels[l]->cells.cells[h].set_face(q,switch_2_index); - else if (index==switch_2_index) + else if (face_index==switch_2_index) triangulation.levels[l]->cells.cells[h].set_face(q,switch_1_index); } // now we have to copy @@ -9264,13 +9264,13 @@ namespace internal // at the outset of the // next iteration) for // refinement - for (unsigned int line=0; - line::lines_per_cell; ++line) - if (!cell->line(line)->has_children() && + for (unsigned int l=0; + l::lines_per_cell; ++l) + if (!cell->line(l)->has_children() && (GeometryInfo::line_refinement_case(cell->refine_flag_set(), - line) + l) !=RefinementCase<1>::no_refinement)) - cell->line(line)->set_user_flag(); + cell->line(l)->set_user_flag(); break; } diff --git a/deal.II/source/multigrid/mg_tools.cc b/deal.II/source/multigrid/mg_tools.cc index 3c4db2437c..e68a86b969 100644 --- a/deal.II/source/multigrid/mg_tools.cc +++ b/deal.II/source/multigrid/mg_tools.cc @@ -242,9 +242,9 @@ namespace MGTools // here. if (flux_coupling != DoFTools::none) { - unsigned int increment = nfe.dofs_per_cell - nfe.dofs_per_face; + const unsigned int dof_increment = nfe.dofs_per_cell - nfe.dofs_per_face; for (unsigned int local_dof=0; local_dof