]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a number of warnings produced by ICC.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 27 Feb 2014 22:53:53 +0000 (22:53 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 27 Feb 2014 22:53:53 +0000 (22:53 +0000)
git-svn-id: https://svn.dealii.org/trunk@32581 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/dofs/dof_handler.cc
deal.II/source/fe/fe_tools.cc
deal.II/source/grid/grid_generator.cc
deal.II/source/grid/grid_in.cc
deal.II/source/grid/grid_out.cc
deal.II/source/grid/grid_reordering.cc
deal.II/source/grid/grid_tools.cc
deal.II/source/grid/tria.cc
deal.II/source/multigrid/mg_tools.cc

index eda98397a2bb5be8ce60b4110432d3deeb15d327..503e2357d5b630f2495b2aa661235b1973b053f6 100644 (file)
@@ -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();
 
index 23470cbfebfe9f681188e26357552bd2d4322db6..af14cf582b5385aeccb821ebbf4f007de595e71e 100644 (file)
@@ -908,51 +908,53 @@ namespace FETools
     // shape value on the cell.
     std::vector<unsigned int> face_c_dofs(n);
     std::vector<unsigned int> face_f_dofs(n);
-    unsigned int k=0;
-    for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_face; ++i)
-      {
-        const unsigned int offset_c = GeometryInfo<dim>::face_to_cell_vertices(face_coarse, i)
-                                      *fe.dofs_per_vertex;
-        const unsigned int offset_f = GeometryInfo<dim>::face_to_cell_vertices(face_fine, i)
-                                      *fe.dofs_per_vertex;
-        for (unsigned int j=0; j<fe.dofs_per_vertex; ++j)
-          {
-            face_c_dofs[k] = offset_c + j;
-            face_f_dofs[k] = offset_f + j;
-            ++k;
-          }
-      }
-    for (unsigned int i=1; i<=GeometryInfo<dim>::lines_per_face; ++i)
-      {
-        const unsigned int offset_c = fe.first_line_index
-                                      + GeometryInfo<dim>::face_to_cell_lines(face_coarse, i-1)
-                                      *fe.dofs_per_line;
-        const unsigned int offset_f = fe.first_line_index
-                                      + GeometryInfo<dim>::face_to_cell_lines(face_fine, i-1)
-                                      *fe.dofs_per_line;
-        for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-          {
-            face_c_dofs[k] = offset_c + j;
-            face_f_dofs[k] = offset_f + j;
-            ++k;
-          }
-      }
-    for (unsigned int i=1; i<=GeometryInfo<dim>::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<fe.dofs_per_quad; ++j)
-          {
-            face_c_dofs[k] = offset_c + j;
-            face_f_dofs[k] = offset_f + j;
-            ++k;
-          }
-      }
-    Assert (k == fe.dofs_per_face, ExcInternalError());
+    {
+      unsigned int face_dof=0;
+      for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_face; ++i)
+        {
+          const unsigned int offset_c = GeometryInfo<dim>::face_to_cell_vertices(face_coarse, i)
+                                          *fe.dofs_per_vertex;
+          const unsigned int offset_f = GeometryInfo<dim>::face_to_cell_vertices(face_fine, i)
+                                          *fe.dofs_per_vertex;
+          for (unsigned int j=0; j<fe.dofs_per_vertex; ++j)
+            {
+              face_c_dofs[face_dof] = offset_c + j;
+              face_f_dofs[face_dof] = offset_f + j;
+              ++face_dof;
+            }
+        }
+      for (unsigned int i=1; i<=GeometryInfo<dim>::lines_per_face; ++i)
+        {
+          const unsigned int offset_c = fe.first_line_index
+              + GeometryInfo<dim>::face_to_cell_lines(face_coarse, i-1)
+              *fe.dofs_per_line;
+          const unsigned int offset_f = fe.first_line_index
+              + GeometryInfo<dim>::face_to_cell_lines(face_fine, i-1)
+              *fe.dofs_per_line;
+          for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+            {
+              face_c_dofs[face_dof] = offset_c + j;
+              face_f_dofs[face_dof] = offset_f + j;
+              ++face_dof;
+            }
+        }
+      for (unsigned int i=1; i<=GeometryInfo<dim>::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<fe.dofs_per_quad; ++j)
+            {
+              face_c_dofs[face_dof] = offset_c + j;
+              face_f_dofs[face_dof] = offset_f + j;
+              ++face_dof;
+            }
+        }
+      Assert (face_dof == fe.dofs_per_face, ExcInternalError());
+    }
 
     // Set up meshes, one with a single
     // reference cell and refine it once
index e71587880fbd3ef062bb927417a196c8a150b226..954a06b25a2a143480bfa07c47e3303122f42bb4 100644 (file)
@@ -2908,14 +2908,14 @@ namespace GridGenerator
                 cell->face(i)->set_boundary_indicator(1);
                 for (unsigned int j=0; j<GeometryInfo<3>::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);
                   }
index 3bc720ce6ede52e29bbf0b14a961a724b0fe0900..52ae8a51873aba3d074b7d940627a4bd7a413fec 100644 (file)
@@ -2036,8 +2036,8 @@ void GridIn<dim, spacedim>::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; i<dim; ++i)
-            AssertThrow(tecplot2deal[i]>0,
+          for (unsigned int d=1; d<dim; ++d)
+            AssertThrow(tecplot2deal[d]>0,
                         ExcMessage("Tecplot file must contain at least one variable for each dimension."));
         }
       else if (Utilities::match_at_string_start(entries[i],"ZONETYPE=ORDERED"))
index acb1011e25182028fff6945f023ee7577fbda3cc..d4415d620afccda45a46a0542635a2c4b51c4068 100644 (file)
@@ -3277,11 +3277,9 @@ namespace internal
 
         case 2:
         {
-          typename dealii::Triangulation<dim>::active_cell_iterator
-          cell=tria.begin_active(),
-          endc=tria.end();
-
-          for (; cell!=endc; ++cell)
+          for (typename dealii::Triangulation<dim>::active_cell_iterator
+              cell=tria.begin_active();
+              cell!=tria.end(); ++cell)
             for (unsigned int line_no=0;
                  line_no<GeometryInfo<dim>::lines_per_cell; ++line_no)
               {
@@ -3352,11 +3350,9 @@ namespace internal
               // boundary faces and
               // generate the info from
               // them
-              typename dealii::Triangulation<dim>::active_cell_iterator
-              cell=tria.begin_active ();
-              const typename dealii::Triangulation<dim>::active_cell_iterator
-              end=tria.end ();
-              for (; cell!=end; ++cell)
+              for (typename dealii::Triangulation<dim>::active_cell_iterator
+                  cell=tria.begin_active();
+                  cell!=tria.end(); ++cell)
                 for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
                   {
                     const typename dealii::Triangulation<dim>::face_iterator
index 59d187df34a522ff7ed55784ba7f132c4e27f015..9b478ad08c953b7e6110b514a028ffdebc7b0968 100644 (file)
@@ -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
index e96dab3f2f0ddec242a1563495a74ee4682f7a45..84e781be1eb210034f4eeedc60516cbc766c3c82 100644 (file)
@@ -2170,11 +2170,9 @@ next_cell:
     do
       {
         bool changed = false;
-        typename Container<dim-1,spacedim>::active_cell_iterator
-        cell = surface_mesh.begin_active(),
-        endc = surface_mesh.end();
 
-        for (; cell!=endc; ++cell)
+        for (typename Container<dim-1,spacedim>::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<Triangulation<dim-1,spacedim>&>(get_tria(surface_mesh))
             .execute_coarsening_and_refinement();
 
-            typename Container<dim-1,spacedim>::cell_iterator
-            cell = surface_mesh.begin(),
-            endc = surface_mesh.end();
-            for (; cell!=endc; ++cell)
-              for (unsigned int c=0; c<cell->n_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<dim-1,spacedim>::cell_iterator
+                surface_cell = surface_mesh.begin(); surface_cell!=surface_mesh.end(); ++surface_cell)
+              for (unsigned int c=0; c<surface_cell->n_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;
index ee0dbe74f9efb611f0eaf70aff1de11efeff3325..4decbf788604f8f6d55e5df96f7509fc5aea961e 100644 (file)
@@ -5814,10 +5814,10 @@ namespace internal
                               for (unsigned int h=0; h<triangulation.levels[l]->cells.cells.size(); ++h)
                                 for (unsigned int q=0; q<GeometryInfo<dim>::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<GeometryInfo<dim>::lines_per_cell; ++line)
-                                if (!cell->line(line)->has_children() &&
+                              for (unsigned int l=0;
+                                   l<GeometryInfo<dim>::lines_per_cell; ++l)
+                                if (!cell->line(l)->has_children() &&
                                     (GeometryInfo<dim>::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;
                             }
index 3c4db2437c1c1feb5c12f89ee69767d9a26e9ff8..e68a86b96962be103551c79e419c4ac7c4a5ad0e 100644 (file)
@@ -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<fe.dofs_per_cell; ++local_dof)
-                  row_lengths[cell_indices[local_dof]] += increment;
+                  row_lengths[cell_indices[local_dof]] += dof_increment;
               }
 
             // Do this only once per

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.