From 206932be19ab63d605b097d26a22b717980fb90a Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 10 Aug 2012 09:07:59 +0000 Subject: [PATCH] Convert a bunch of bare 'unsigned's into 'unsigned int's to make the replacement by types::global_dof_index simpler. git-svn-id: https://svn.dealii.org/trunk@25859 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/table.h | 2 +- deal.II/include/deal.II/base/table_indices.h | 2 +- deal.II/include/deal.II/base/tensor.h | 8 +-- deal.II/include/deal.II/base/tensor_base.h | 4 +- .../include/deal.II/integrators/divergence.h | 50 +++++++++---------- .../include/deal.II/integrators/elasticity.h | 18 +++---- deal.II/include/deal.II/integrators/l2.h | 20 ++++---- deal.II/include/deal.II/integrators/laplace.h | 42 ++++++++-------- deal.II/include/deal.II/integrators/maxwell.h | 32 ++++++------ deal.II/include/deal.II/lac/block_list.h | 2 +- .../include/deal.II/lac/block_vector_base.h | 4 +- .../deal.II/lac/full_matrix.templates.h | 2 +- .../include/deal.II/lac/tridiagonal_matrix.h | 2 +- .../deal.II/matrix_free/fe_evaluation.h | 16 +++--- .../deal.II/numerics/vector_tools.templates.h | 4 +- .../source/base/auto_derivative_function.cc | 14 +++--- deal.II/source/base/geometry_info.cc | 4 +- deal.II/source/dofs/dof_renumbering.cc | 2 +- deal.II/source/fe/fe_q.cc | 4 +- deal.II/source/fe/fe_system.cc | 6 +-- deal.II/source/fe/fe_values.cc | 48 +++++++++--------- deal.II/source/grid/grid_tools.cc | 2 +- deal.II/source/grid/tria_boundary_lib.cc | 38 +++++++------- deal.II/source/numerics/matrix_tools.cc | 2 +- 24 files changed, 164 insertions(+), 164 deletions(-) diff --git a/deal.II/include/deal.II/base/table.h b/deal.II/include/deal.II/base/table.h index 7d1f7d4658..531226662a 100644 --- a/deal.II/include/deal.II/base/table.h +++ b/deal.II/include/deal.II/base/table.h @@ -2055,7 +2055,7 @@ inline unsigned int TableBase::n_elements () const { - unsigned s = 1; + unsigned int s = 1; for (unsigned int n=0; n::unroll (Vector &result) const { AssertDimension (result.size(),(Utilities::fixed_power(dim))); - unsigned index = 0; + unsigned int index = 0; unroll_recursion (result, index); } @@ -568,7 +568,7 @@ void Tensor::unroll_recursion (Vector &result, unsigned int &index) const { - for (unsigned i=0; i &src1, * inner product sumi,j src1[i][j]*src2[i][j]. * * @relates Tensor - * @author Guido Kanschat, 2000 + * @author Guido Kanschat, 2000 */ template inline @@ -706,7 +706,7 @@ Number double_contract (const Tensor<2, dim, Number> &src1, Number res = 0.; for (unsigned int i=0; i::unroll (Vector &result) const Assert (result.size()==dim, ExcDimensionMismatch(dim, result.size())); - unsigned index = 0; + unsigned int index = 0; unroll_recursion (result,index); } @@ -1211,7 +1211,7 @@ void Tensor<1,dim,Number>::unroll_recursion (Vector &result, unsigned int &index) const { - for (unsigned i=0; i& Du = fe.shape_grad(j,k); M(i,j) += dx * vv * Du[d]; @@ -201,11 +201,11 @@ namespace LocalIntegrators const unsigned int t_dofs = fetest.dofs_per_cell; Assert (result.size() == t_dofs, ExcDimensionMismatch(result.size(), t_dofs)); - for (unsigned k=0;k ndx = factor * fe.JxW(k) * fe.normal_vector(k); - for (unsigned i=0;i ndx = factor * fe.normal_vector(k) * fe.JxW(k); - for (unsigned i=0;i& n = fe.normal_vector(k); - for (unsigned i=0;i& n = fe1.normal_vector(k); - for (unsigned i=0;i& n = fe.normal_vector(k); - for (unsigned i=0;i& n = fe.normal_vector(k); - for (unsigned i=0;i& n = fe.normal_vector(k); - for (unsigned i=0;i& n = fe1.normal_vector(k); for (unsigned int d=0;d& n = fe1.normal_vector(k); - for (unsigned i=0;i& Dvi = fe1.shape_grad(i,k); @@ -446,12 +446,12 @@ namespace LocalIntegrators const double penalty = .5 * pen * (nui + nue); - for (unsigned k=0;k& n = fe1.normal_vector(k); - for (unsigned i=0;i& n = fe.normal_vector(k); - for (unsigned i=0;i& n = fe.normal_vector(k); - for (unsigned i=0;i& n = fe1.normal_vector(k); - for (unsigned i=0;i Iterator:: - Iterator (BlockVector &parent, - const unsigned global_index) + Iterator (BlockVector &parent, + const unsigned int global_index) : parent (&parent), global_index (global_index) diff --git a/deal.II/include/deal.II/lac/full_matrix.templates.h b/deal.II/include/deal.II/lac/full_matrix.templates.h index 6ec578dd75..77b7b2672e 100644 --- a/deal.II/include/deal.II/lac/full_matrix.templates.h +++ b/deal.II/include/deal.II/lac/full_matrix.templates.h @@ -397,7 +397,7 @@ void FullMatrix::add_row (const unsigned int i, Assert (!this->empty(), ExcEmptyMatrix()); const unsigned int size_m = m(); - for (unsigned l=0; l { grad_out[comp][d] = (jac[d][0] * this->gradients_quad[comp][0][q_point]); - for (unsigned e=1; egradients_quad[comp][e][q_point]); } @@ -3457,7 +3457,7 @@ FEEvaluationBase for (unsigned int d=0; d new_val = jac[0][d] * grad_in[comp][0]; - for (unsigned e=1; egradients_quad[comp][d][q_point] = new_val * JxW; } @@ -3581,7 +3581,7 @@ FEEvaluationAccess for (unsigned int d=0; dgradients_quad[0][0][q_point]); - for (unsigned e=1; egradients_quad[0][e][q_point]); } } @@ -3697,7 +3697,7 @@ FEEvaluationAccess for (unsigned int d=0; d new_val = jac[0][d] * grad_in[0]; - for (unsigned e=1; egradients_quad[0][d][q_point] = new_val * JxW; } @@ -3773,10 +3773,10 @@ FEEvaluationAccess this->cell_type == internal::MatrixFreeFunctions::general ? this->jacobian[q_point] : this->jacobian[0]; divergence = (jac[0][0] * this->gradients_quad[0][0][q_point]); - for (unsigned e=1; egradients_quad[0][e][q_point]); for (unsigned int d=1; dgradients_quad[d][e][q_point]); } return divergence; @@ -3944,7 +3944,7 @@ FEEvaluationAccess this->quadrature_weights[q_point]) * div_in; for (unsigned int d=0; dgradients_quad[d][e][q_point] = jac[d][e] * fac; } } @@ -4010,7 +4010,7 @@ FEEvaluationAccess for (unsigned int d=0; d new_val = jac[0][d] * weighted[comp][0]; - for (unsigned e=1; egradients_quad[comp][d][q_point] = new_val; } diff --git a/deal.II/include/deal.II/numerics/vector_tools.templates.h b/deal.II/include/deal.II/numerics/vector_tools.templates.h index ec5501d5fb..190b8866e7 100644 --- a/deal.II/include/deal.II/numerics/vector_tools.templates.h +++ b/deal.II/include/deal.II/numerics/vector_tools.templates.h @@ -336,7 +336,7 @@ namespace VectorTools // left-most and right-most // vertex and query its vertex // dof indices. that's easy :-) - for (unsigned direction=0; direction<2; ++direction) + for (unsigned int direction=0; direction<2; ++direction) { dealii::DoFHandler<1>::cell_iterator cell = dof_handler.begin(0); @@ -359,7 +359,7 @@ namespace VectorTools // left-most and right-most // vertex and query its vertex // dof indices. that's easy :-) - for (unsigned direction=0; direction<2; ++direction) + for (unsigned int direction=0; direction<2; ++direction) { dealii::DoFHandler<1,2>::cell_iterator cell = dof_handler.begin(0); diff --git a/deal.II/source/base/auto_derivative_function.cc b/deal.II/source/base/auto_derivative_function.cc index 9e44a3c50d..f86853b6cd 100644 --- a/deal.II/source/base/auto_derivative_function.cc +++ b/deal.II/source/base/auto_derivative_function.cc @@ -204,7 +204,7 @@ gradient_list (const std::vector > &points, case UpwindEuler: { Point q1; - for (unsigned p=0; p > &points, case Euler: { Point q1, q2; - for (unsigned p=0; p > &points, case FourthOrder: { Point q1, q2, q3, q4; - for (unsigned p=0; p > &points, { Assert (gradients.size() == points.size(), ExcDimensionMismatch(gradients.size(), points.size())); - for (unsigned p=0; pn_components, ExcDimensionMismatch(gradients.size(), this->n_components)); @@ -268,7 +268,7 @@ vector_gradient_list (const std::vector > &points, case UpwindEuler: { Point q1; - for (unsigned p=0; p > &points, case Euler: { Point q1, q2; - for (unsigned p=0; p > &points, case FourthOrder: { Point q1, q2, q3, q4; - for (unsigned p=0; p GeometryInfo::project_to_unit_cell (const Point &q) { Point p = q; - for(unsigned i=0; i 1.) p[i] = 1.; @@ -1425,7 +1425,7 @@ GeometryInfo::distance_to_unit_cell (const Point &p) { double result = 0.0; - for(unsigned i=0; i result) result = -p[i]; else if ((p[i]-1.) > result) diff --git a/deal.II/source/dofs/dof_renumbering.cc b/deal.II/source/dofs/dof_renumbering.cc index 9e3b71a732..b65bdb052c 100644 --- a/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/source/dofs/dof_renumbering.cc @@ -1781,7 +1781,7 @@ namespace DoFRenumbering Assert(new_indices.size() == n_dofs, ExcDimensionMismatch(new_indices.size(), n_dofs)); - for (unsigned i=0; i::Implementation .TableBase<2,double>::reinit (fe.interface_constraints_size()); for (unsigned int i=0; i::Implementation constraint_point(k) = 1.0 - constraint_point(k); } - for (unsigned j=0; j::~FESystem () { // delete base elements created in // the constructor - for (unsigned i=0; iunsubscribe(typeid(*this).name()); delete base_elements[i].first; @@ -1513,7 +1513,7 @@ FESystem::build_face_tables() { unsigned comp_start = 0; for(unsigned base = 0; base < this->n_base_elements(); ++base) - for (unsigned m=0; melement_multiplicity(base); + for (unsigned int m=0; melement_multiplicity(base); ++m, comp_start += base_element(base).n_components()) for (unsigned local_index = 0; local_index < base_element(base).dofs_per_line; @@ -1559,7 +1559,7 @@ FESystem::build_face_tables() { unsigned comp_start = 0; for(unsigned base=0; basen_base_elements(); ++base) - for (unsigned m=0; melement_multiplicity(base); + for (unsigned int m=0; melement_multiplicity(base); ++m, comp_start += base_element(base).n_components()) for (unsigned local_index = 0; local_index < base_element(base).dofs_per_quad; diff --git a/deal.II/source/fe/fe_values.cc b/deal.II/source/fe/fe_values.cc index a839d72159..36e7552579 100644 --- a/deal.II/source/fe/fe_values.cc +++ b/deal.II/source/fe/fe_values.cc @@ -1967,7 +1967,7 @@ void FEValuesBase::get_function_values ( // Assert that we can write all // components into the result // vectors - for (unsigned i=0;i::get_function_values ( present_cell->get_interpolated_dof_values(fe_function, dof_values); // initialize with zero - for (unsigned i=0;i::get_function_values ( // finite element const unsigned int result_components = indices.size() * n_components / dofs_per_cell; - for (unsigned i=0;i::get_function_values ( Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); // initialize with zero - for (unsigned i=0;i::get_function_values ( { Assert (values.size() == result_components, ExcDimensionMismatch(values.size(), result_components)); - for (unsigned i=0;i::get_function_values ( { Assert(values.size() == n_quadrature_points, ExcDimensionMismatch(values.size(), n_quadrature_points)); - for (unsigned i=0;i::get_function_values ( Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); // initialize with zero - for (unsigned i=0;i::get_function_gradients ( ExcDimensionMismatch(gradients.size(), n_quadrature_points)); const unsigned int n_components = fe->n_components(); - for (unsigned i=0; i::get_function_gradients ( present_cell->get_interpolated_dof_values(fe_function, dof_values); // initialize with zero - for (unsigned i=0;i()); // add up contributions of trial @@ -2498,7 +2498,7 @@ void FEValuesBase::get_function_gradients ( { Assert (gradients.size() == result_components, ExcDimensionMismatch(gradients.size(), result_components)); - for (unsigned i=0;i::get_function_gradients ( { Assert(gradients.size() == n_quadrature_points, ExcDimensionMismatch(gradients.size(), n_quadrature_points)); - for (unsigned i=0;i::get_function_gradients ( Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField()); // initialize with zero - for (unsigned i=0;i()); // add up contributions of trial @@ -2686,7 +2686,7 @@ get_function_hessians (const InputVector &fe_function, ExcDimensionMismatch(hessians.size(), n_quadrature_points)); const unsigned int n_components = fe->n_components(); - for (unsigned i=0;iget_interpolated_dof_values(fe_function, dof_values); // initialize with zero - for (unsigned i=0;i()); // add up contributions of trial @@ -2791,7 +2791,7 @@ void FEValuesBase::get_function_hessians ( { Assert (hessians.size() == result_components, ExcDimensionMismatch(hessians.size(), result_components)); - for (unsigned i=0;i::get_function_hessians ( { Assert(hessians.size() == n_quadrature_points, ExcDimensionMismatch(hessians.size(), n_quadrature_points)); - for (unsigned i=0;i::get_function_hessians ( const unsigned int component_multiple = result_components / n_components; // initialize with zero - for (unsigned i=0;i()); // add up contributions of trial @@ -2992,7 +2992,7 @@ void FEValuesBase::get_function_laplacians ( // Assert that we can write all // components into the result // vectors - for (unsigned i=0;i::get_function_laplacians ( present_cell->get_interpolated_dof_values(fe_function, dof_values); // initialize with zero - for (unsigned i=0;i::get_function_laplacians ( // finite element const unsigned int result_components = indices.size() * n_components / dofs_per_cell; - for (unsigned i=0;i::get_function_laplacians ( Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); // initialize with zero - for (unsigned i=0;i::get_function_laplacians ( { Assert (laplacians.size() == result_components, ExcDimensionMismatch(laplacians.size(), result_components)); - for (unsigned i=0;i::get_function_laplacians ( { Assert(laplacians.size() == n_quadrature_points, ExcDimensionMismatch(laplacians.size(), n_quadrature_points)); - for (unsigned i=0;i::get_function_laplacians ( Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); // initialize with zero - for (unsigned i=0;i= 3) { - for (unsigned e=0; e::lines_per_cell; ++e) + for (unsigned int e=0; e::lines_per_cell; ++e) if (cell->line(e)->has_children()) // the only place where this vertex could have been // hiding is on the mid-edge point of the edge we diff --git a/deal.II/source/grid/tria_boundary_lib.cc b/deal.II/source/grid/tria_boundary_lib.cc index 8d442b3e89..6a48bb0c78 100644 --- a/deal.II/source/grid/tria_boundary_lib.cc +++ b/deal.II/source/grid/tria_boundary_lib.cc @@ -1344,7 +1344,7 @@ TorusBoundary<2,3>::get_new_point_on_line (const Triangulation<2,3>::line_iterat //Take care for periodic conditions, //For instance phi0= 0, phi1= 3/2*Pi middle has to be 7/4*Pi not 3/4*Pi //This also works for -Pi/2 + Pi, middle is 5/4*Pi - for(unsigned i=0; i<2;i++) + for(unsigned int i=0; i<2;i++) if(std::abs(p0(i)-p1(i))> numbers::PI) middle(i)=2*numbers::PI; @@ -1364,7 +1364,7 @@ TorusBoundary<2,3>::get_new_point_on_quad (const Triangulation<2,3>::quad_iterat //Just get the average Point<2> p[4]; - for(unsigned i=0;i<4;i++) + for(unsigned int i=0;i<4;i++) p[i]=get_surf_coord(quad->vertex(i)); Point<2> middle(0,0); @@ -1372,14 +1372,14 @@ TorusBoundary<2,3>::get_new_point_on_quad (const Triangulation<2,3>::quad_iterat //Take care for periodic conditions, see get_new_point_on_line() above //For instance phi0= 0, phi1= 3/2*Pi middle has to be 7/4*Pi not 3/4*Pi //This also works for -Pi/2 + Pi + Pi- Pi/2, middle is 5/4*Pi - for(unsigned i=0;i<2;i++) - for(unsigned j=1;j<4;j++){ + for(unsigned int i=0;i<2;i++) + for(unsigned int j=1;j<4;j++){ if(std::abs(p[0](i)-p[j](i))> numbers::PI){ middle(i)+=2*numbers::PI; } } - for(unsigned i=0;i<4;i++) + for(unsigned int i=0;i<4;i++) middle+=p[i]; middle*= 0.25; @@ -1434,7 +1434,7 @@ get_intermediate_points_on_line (const Triangulation<2, 3>::line_iterator & lin Point<2> p[2]; - for(unsigned i=0;i<2;i++) + for(unsigned int i=0;i<2;i++) p[i]=get_surf_coord(line->vertex(i)); unsigned offset[2]; @@ -1445,16 +1445,16 @@ get_intermediate_points_on_line (const Triangulation<2, 3>::line_iterator & lin //see get_new_point_on_line() above //Because we dont have a symmetric interpolation (just the middle) we need to //add 2*Pi to each almost zero and negative angles. - for(unsigned i=0;i<2;i++) - for(unsigned j=1;j<2;j++){ + for(unsigned int i=0;i<2;i++) + for(unsigned int j=1;j<2;j++){ if(std::abs(p[0](i)-p[j](i))> numbers::PI){ offset[i]++; break; } } - for(unsigned i=0;i<2;i++) - for(unsigned j=0;j<2;j++) + for(unsigned int i=0;i<2;i++) + for(unsigned int j=0;j<2;j++) if(p[j](i)<1.E-12 ) //Take care for periodic conditions & negative angles p[j](i)+=2*numbers::PI*offset[i]; @@ -1462,7 +1462,7 @@ get_intermediate_points_on_line (const Triangulation<2, 3>::line_iterator & lin double dx=1.0/(npoints+1); double x=dx; Point<2> target; - for(unsigned i=0; i::quad_iterator &qua Point<2> p[4]; - for(unsigned i=0;i<4;i++) + for(unsigned int i=0;i<4;i++) p[i]=get_surf_coord(quad->vertex(i)); Point<2> target; @@ -1499,23 +1499,23 @@ get_intermediate_points_on_quad (const Triangulation< 2, 3 >::quad_iterator &qua //see get_new_point_on_line() above //Because we dont have a symmetric interpolation (just the middle) we need to //add 2*Pi to each almost zero and negative angles. - for(unsigned i=0;i<2;i++) - for(unsigned j=1;j<4;j++){ + for(unsigned int i=0;i<2;i++) + for(unsigned int j=1;j<4;j++){ if(std::abs(p[0](i)-p[j](i))> numbers::PI){ offset[i]++; break; } } - for(unsigned i=0;i<2;i++) - for(unsigned j=0;j<4;j++) + for(unsigned int i=0;i<2;i++) + for(unsigned int j=0;j<4;j++) if(p[j](i)<1.E-12 ) //Take care for periodic conditions & negative angles p[j](i)+=2*numbers::PI*offset[i]; - for (unsigned i=0; i:: get_normals_at_vertices (const Triangulation<2,3 >::face_iterator &face, Boundary<2,3>::FaceVertexNormals &face_vertex_normals) const { - for(unsigned i=0; i::vertices_per_face; i++) + for(unsigned int i=0; i::vertices_per_face; i++) face_vertex_normals[i]=get_surf_norm(face->vertex(i)); } diff --git a/deal.II/source/numerics/matrix_tools.cc b/deal.II/source/numerics/matrix_tools.cc index 0c5f3ce151..84bf26e84e 100644 --- a/deal.II/source/numerics/matrix_tools.cc +++ b/deal.II/source/numerics/matrix_tools.cc @@ -2981,7 +2981,7 @@ namespace MatrixTools { // remove this row, except for the // diagonal element - for (unsigned j=0; j