]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use braces to avoid a new warning in gcc 4.3.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 25 Jan 2007 21:28:51 +0000 (21:28 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 25 Jan 2007 21:28:51 +0000 (21:28 +0000)
git-svn-id: https://svn.dealii.org/trunk@14374 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_poly_tensor.cc
deal.II/deal.II/source/grid/tria.cc

index 6524780e86e63e7e27431c9ece45b53500220d82..ba4fc66431be4e736f517792ff11bc0283d2a179 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2005, 2006 by the deal.II authors
+//    Copyright (C) 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -311,22 +311,27 @@ FE_PolyTensor<POLY,dim>::get_data (const UpdateFlags      update_flags,
                           values, grads, grad_grads);
        
        if (flags & update_values)
-         if (inverse_node_matrix.n_cols() == 0)
-           for (unsigned int i=0; i<this->dofs_per_cell; ++i)
-             data->shape_values[i][k] = values[i];
-         else
-           for (unsigned int i=0; i<this->dofs_per_cell; ++i)
-             for (unsigned int j=0; j<this->dofs_per_cell; ++j)
-               data->shape_values[i][k] += inverse_node_matrix(j,i) * values[j];
+         {
+           if (inverse_node_matrix.n_cols() == 0)
+             for (unsigned int i=0; i<this->dofs_per_cell; ++i)
+               data->shape_values[i][k] = values[i];
+           else
+             for (unsigned int i=0; i<this->dofs_per_cell; ++i)
+               for (unsigned int j=0; j<this->dofs_per_cell; ++j)
+                 data->shape_values[i][k] += inverse_node_matrix(j,i) * values[j];
+         }
        
        if (flags & update_gradients)
-         if (inverse_node_matrix.n_cols() == 0)
-           for (unsigned int i=0; i<this->dofs_per_cell; ++i)
-             data->shape_grads[i][k] = grads[i];
-         else
-           for (unsigned int i=0; i<this->dofs_per_cell; ++i)
-             for (unsigned int j=0; j<this->dofs_per_cell; ++j)
-               data->shape_grads[i][k] += inverse_node_matrix(j,i) * grads[j];
+         {
+           if (inverse_node_matrix.n_cols() == 0)
+             for (unsigned int i=0; i<this->dofs_per_cell; ++i)
+               data->shape_grads[i][k] = grads[i];
+           else
+             for (unsigned int i=0; i<this->dofs_per_cell; ++i)
+               for (unsigned int j=0; j<this->dofs_per_cell; ++j)
+                 data->shape_grads[i][k] += inverse_node_matrix(j,i) * grads[j];
+         }
+       
       }
   return data;
 }
index 595bdbb4b75edfe3b0c742aea52c4f5b08cdabb3..f543fa6a5af4894e51012409e1dba31acb401518 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -7971,28 +7971,30 @@ bool Triangulation<dim>::prepare_coarsening_and_refinement ()
                          ++total_neighbors;
 
                        if (neighbor.state() == IteratorState::valid)
-                         if ((neighbor->active() &&
-                              !neighbor->refine_flag_set()) ||
-                             (neighbor->level() == cell->level()-1))
-                           ++unrefined_neighbors;
-                         else
-                           if (!neighbor->active())
-                                                              // maybe this cell's
-                                                              // children will be
-                                                              // coarsened
-                             {
-                               unsigned int tagged_children = 0;
-                               for (unsigned int c=0;
-                                    c<GeometryInfo<dim>::children_per_cell;
-                                    ++c)
-                                 if (neighbor->child(c)->coarsen_flag_set())
-                                   ++tagged_children;
-                               if (tagged_children ==
-                                   GeometryInfo<dim>::children_per_cell)
-                                 ++unrefined_neighbors;
-                             }
+                         {
+                           if ((neighbor->active() &&
+                                !neighbor->refine_flag_set()) ||
+                               (neighbor->level() == cell->level()-1))
+                             ++unrefined_neighbors;
+                           else
+                             if (!neighbor->active())
+                                                                // maybe this cell's
+                                                                // children will be
+                                                                // coarsened
+                               {
+                                 unsigned int tagged_children = 0;
+                                 for (unsigned int c=0;
+                                      c<GeometryInfo<dim>::children_per_cell;
+                                      ++c)
+                                   if (neighbor->child(c)->coarsen_flag_set())
+                                     ++tagged_children;
+                                 if (tagged_children ==
+                                     GeometryInfo<dim>::children_per_cell)
+                                   ++unrefined_neighbors;
+                               }
+                         }
                      }
-               
+                   
                                                     // if all
                                                     // neighbors
                                                     // unrefined:
@@ -8033,15 +8035,17 @@ bool Triangulation<dim>::prepare_coarsening_and_refinement ()
                          (smooth_grid & eliminate_refined_boundary_islands)) )
                        &&
                        (total_neighbors != 0))
-                     if (!cell->active())
-                       for (unsigned int c=0;
-                            c<GeometryInfo<dim>::children_per_cell; ++c)
-                         {
-                           cell->child(c)->clear_refine_flag ();
-                           cell->child(c)->set_coarsen_flag ();
-                         }
-                     else 
-                       cell->clear_refine_flag();
+                     {
+                       if (!cell->active())
+                         for (unsigned int c=0;
+                              c<GeometryInfo<dim>::children_per_cell; ++c)
+                           {
+                             cell->child(c)->clear_refine_flag ();
+                             cell->child(c)->set_coarsen_flag ();
+                           }
+                       else
+                         cell->clear_refine_flag();
+                     }
                  }
              }
        }

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.