From a3b727fe245285843ae3df0a61832b1b0cda391d Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 25 Jan 2007 21:28:51 +0000 Subject: [PATCH] Use braces to avoid a new warning in gcc 4.3. git-svn-id: https://svn.dealii.org/trunk@14374 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/fe/fe_poly_tensor.cc | 35 ++++++----- deal.II/deal.II/source/grid/tria.cc | 66 +++++++++++---------- 2 files changed, 55 insertions(+), 46 deletions(-) diff --git a/deal.II/deal.II/source/fe/fe_poly_tensor.cc b/deal.II/deal.II/source/fe/fe_poly_tensor.cc index 6524780e86..ba4fc66431 100644 --- a/deal.II/deal.II/source/fe/fe_poly_tensor.cc +++ b/deal.II/deal.II/source/fe/fe_poly_tensor.cc @@ -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::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; idofs_per_cell; ++i) - data->shape_values[i][k] = values[i]; - else - for (unsigned int i=0; idofs_per_cell; ++i) - for (unsigned int j=0; jdofs_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; idofs_per_cell; ++i) + data->shape_values[i][k] = values[i]; + else + for (unsigned int i=0; idofs_per_cell; ++i) + for (unsigned int j=0; jdofs_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; idofs_per_cell; ++i) - data->shape_grads[i][k] = grads[i]; - else - for (unsigned int i=0; idofs_per_cell; ++i) - for (unsigned int j=0; jdofs_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; idofs_per_cell; ++i) + data->shape_grads[i][k] = grads[i]; + else + for (unsigned int i=0; idofs_per_cell; ++i) + for (unsigned int j=0; jdofs_per_cell; ++j) + data->shape_grads[i][k] += inverse_node_matrix(j,i) * grads[j]; + } + } return data; } diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 595bdbb4b7..f543fa6a5a 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -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::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::children_per_cell; - ++c) - if (neighbor->child(c)->coarsen_flag_set()) - ++tagged_children; - if (tagged_children == - GeometryInfo::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::children_per_cell; + ++c) + if (neighbor->child(c)->coarsen_flag_set()) + ++tagged_children; + if (tagged_children == + GeometryInfo::children_per_cell) + ++unrefined_neighbors; + } + } } - + // if all // neighbors // unrefined: @@ -8033,15 +8035,17 @@ bool Triangulation::prepare_coarsening_and_refinement () (smooth_grid & eliminate_refined_boundary_islands)) ) && (total_neighbors != 0)) - if (!cell->active()) - for (unsigned int c=0; - c::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::children_per_cell; ++c) + { + cell->child(c)->clear_refine_flag (); + cell->child(c)->set_coarsen_flag (); + } + else + cell->clear_refine_flag(); + } } } } -- 2.39.5