From: bangerth Date: Fri, 10 Aug 2012 09:19:42 +0000 (+0000) Subject: Part II of: Convert a bunch of bare 'unsigned's into 'unsigned int's to make the... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3124b6590fbc2883a7fc5030279c5ab6707fd9a;p=dealii-svn.git Part II of: 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@25862 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/base/logstream.cc b/deal.II/source/base/logstream.cc index 94729e15f6..98f06e51dd 100644 --- a/deal.II/source/base/logstream.cc +++ b/deal.II/source/base/logstream.cc @@ -255,7 +255,7 @@ void LogStream::pop () unsigned int -LogStream::depth_console (const unsigned n) +LogStream::depth_console (const unsigned int n) { Threads::ThreadMutex::ScopedLock lock(log_lock); const unsigned int h = std_depth; @@ -265,7 +265,7 @@ LogStream::depth_console (const unsigned n) unsigned int -LogStream::depth_file (const unsigned n) +LogStream::depth_file (const unsigned int n) { Threads::ThreadMutex::ScopedLock lock(log_lock); const unsigned int h = file_depth; diff --git a/deal.II/source/base/thread_management.cc b/deal.II/source/base/thread_management.cc index 033bb2df5c..7549689b48 100644 --- a/deal.II/source/base/thread_management.cc +++ b/deal.II/source/base/thread_management.cc @@ -154,7 +154,7 @@ namespace Threads const pid_t this_id = getpid(); #else # ifdef DEAL_II_MSVC - const unsigned this_id = 0; + const unsigned int this_id = 0; # else const pid_t this_id = 0; # endif diff --git a/deal.II/source/distributed/tria.cc b/deal.II/source/distributed/tria.cc index a75cad3012..9499c5548f 100644 --- a/deal.II/source/distributed/tria.cc +++ b/deal.II/source/distributed/tria.cc @@ -164,7 +164,7 @@ namespace internal long *length); static - unsigned (&checksum) (types<2>::forest * p4est); + unsigned int (&checksum) (types<2>::forest * p4est); static void (&vtk_write_file) (types<2>::forest * p4est, @@ -286,7 +286,7 @@ namespace internal long *length) = p4est_connectivity_load; - unsigned (&functions<2>::checksum) (types<2>::forest * p4est) + unsigned int (&functions<2>::checksum) (types<2>::forest * p4est) = p4est_checksum; void (&functions<2>::vtk_write_file) (types<2>::forest * p4est, @@ -412,7 +412,7 @@ namespace internal long *length); static - unsigned (&checksum) (types<3>::forest * p8est); + unsigned int (&checksum) (types<3>::forest * p8est); static void (&vtk_write_file) (types<3>::forest * p8est, @@ -537,7 +537,7 @@ namespace internal long *length) = p8est_connectivity_load; - unsigned (&functions<3>::checksum) (types<3>::forest * p8est) + unsigned int (&functions<3>::checksum) (types<3>::forest * p8est) = p8est_checksum; void (&functions<3>::vtk_write_file) (types<3>::forest * p8est, @@ -831,7 +831,7 @@ namespace if (f>cell->neighbor_of_neighbor (f)) smaller_idx = 1; - unsigned larger_idx = (smaller_idx+1) % 2; + unsigned int larger_idx = (smaller_idx+1) % 2; //smaller = *_list[smaller_idx] //larger = *_list[larger_idx] diff --git a/deal.II/source/fe/fe.cc b/deal.II/source/fe/fe.cc index 15fe75d4ca..8bfce1e4fb 100644 --- a/deal.II/source/fe/fe.cc +++ b/deal.II/source/fe/fe.cc @@ -756,7 +756,7 @@ FiniteElement::has_generalized_support_points () const template Point -FiniteElement::unit_support_point (const unsigned index) const +FiniteElement::unit_support_point (const unsigned int index) const { Assert (index < this->dofs_per_cell, ExcIndexRange (index, 0, this->dofs_per_cell)); @@ -818,7 +818,7 @@ FiniteElement::has_generalized_face_support_points () const template Point -FiniteElement::unit_face_support_point (const unsigned index) const +FiniteElement::unit_face_support_point (const unsigned int index) const { Assert (index < this->dofs_per_face, ExcIndexRange (index, 0, this->dofs_per_face)); @@ -1159,7 +1159,7 @@ FiniteElement::get_subface_data (const UpdateFlags flags, template const FiniteElement& -FiniteElement::base_element(const unsigned index) const +FiniteElement::base_element(const unsigned int index) const { Assert (index==0, ExcIndexRange(index,0,1)); // This function should not be diff --git a/deal.II/source/fe/fe_abf.cc b/deal.II/source/fe/fe_abf.cc index 296a00749c..fd1459541d 100644 --- a/deal.II/source/fe/fe_abf.cc +++ b/deal.II/source/fe/fe_abf.cc @@ -590,15 +590,15 @@ FE_ABF::interpolate( * values[face*n_face_points+k](GeometryInfo::unit_normal_direction[face]+offset); } - const unsigned start_cell_dofs = GeometryInfo::faces_per_cell*this->dofs_per_face; - const unsigned start_cell_points = GeometryInfo::faces_per_cell*n_face_points; + const unsigned int start_cell_dofs = GeometryInfo::faces_per_cell*this->dofs_per_face; + const unsigned int start_cell_points = GeometryInfo::faces_per_cell*n_face_points; for (unsigned int k=0;k::interpolate( * values[GeometryInfo::unit_normal_direction[face]][face*n_face_points+k]; } - const unsigned start_cell_dofs = GeometryInfo::faces_per_cell*this->dofs_per_face; - const unsigned start_cell_points = GeometryInfo::faces_per_cell*n_face_points; + const unsigned int start_cell_dofs = GeometryInfo::faces_per_cell*this->dofs_per_face; + const unsigned int start_cell_points = GeometryInfo::faces_per_cell*n_face_points; for (unsigned int k=0;k::interpolate (std::vector& local_dofs, * n_edge_points], 1); - for (unsigned i = 0; i < this->degree; ++i) + for (unsigned int i = 0; i < this->degree; ++i) for (unsigned int j = 0; j < this->degree-1; ++j) system_rhs (i * (this->degree-1) + j) += reference_quadrature.weight (q_point) * tmp @@ -3578,7 +3578,7 @@ FE_Nedelec::interpolate (std::vector& local_dofs, * n_edge_points], 2); - for (unsigned i = 0; i < this->degree; ++i) + for (unsigned int i = 0; i < this->degree; ++i) for (unsigned int j = 0; j < this->degree-1; ++j) system_rhs (i * (this->degree-1) + j) += boundary_weights @@ -3686,7 +3686,7 @@ FE_Nedelec::interpolate (std::vector& local_dofs, + n_face_points], 2); - for (unsigned i = 0; i <= deg; ++i) + for (unsigned int i = 0; i <= deg; ++i) for (unsigned int j = 0; j < deg; ++j) system_rhs (i * deg + j) += boundary_weights @@ -3742,7 +3742,7 @@ FE_Nedelec::interpolate (std::vector& local_dofs, * n_face_points], 2); - for (unsigned i = 0; i <= deg; ++i) + for (unsigned int i = 0; i <= deg; ++i) for (unsigned int j = 0; j < deg; ++j) system_rhs (i * deg + j) += boundary_weights @@ -3850,7 +3850,7 @@ FE_Nedelec::interpolate (std::vector& local_dofs, * n_face_points], 2); - for (unsigned i = 0; i <= deg; ++i) + for (unsigned int i = 0; i <= deg; ++i) for (unsigned int j = 0; j < deg; ++j) system_rhs (i * deg + j) += boundary_weights @@ -4013,7 +4013,7 @@ FE_Nedelec::interpolate (std::vector& local_dofs, * n_face_points], 1); - for (unsigned i = 0; i <= deg; ++i) + for (unsigned int i = 0; i <= deg; ++i) for (unsigned int j = 0; j < deg; ++j) system_rhs (i * deg + j) += boundary_weights @@ -4125,7 +4125,7 @@ FE_Nedelec::interpolate (std::vector& local_dofs, * n_face_points], 1); - for (unsigned i = 0; i <= deg; ++i) + for (unsigned int i = 0; i <= deg; ++i) for (unsigned int j = 0; j < deg; ++j) system_rhs (i * deg + j) += boundary_weights @@ -4794,7 +4794,7 @@ const * n_edge_points], 1); - for (unsigned i = 0; i <= deg; ++i) + for (unsigned int i = 0; i <= deg; ++i) for (unsigned int j = 0; j < deg; ++j) system_rhs (i * deg + j) += reference_quadrature.weight (q_point) * tmp @@ -5074,7 +5074,7 @@ const * n_edge_points], face_coordinates[face][1]); - for (unsigned i = 0; i <= deg; ++i) + for (unsigned int i = 0; i <= deg; ++i) for (unsigned int j = 0; j < deg; ++j) system_rhs (i * deg + j) += boundary_weights (q_point + n_edge_points, diff --git a/deal.II/source/fe/fe_nothing.cc b/deal.II/source/fe/fe_nothing.cc index b64b834384..8560468828 100644 --- a/deal.II/source/fe/fe_nothing.cc +++ b/deal.II/source/fe/fe_nothing.cc @@ -25,7 +25,7 @@ namespace template -FE_Nothing::FE_Nothing (const unsigned n_components) +FE_Nothing::FE_Nothing (const unsigned int n_components) : FiniteElement (FiniteElementData(std::vector(dim+1,0), diff --git a/deal.II/source/fe/fe_raviart_thomas.cc b/deal.II/source/fe/fe_raviart_thomas.cc index 543a2ca0a8..8e60ee549b 100644 --- a/deal.II/source/fe/fe_raviart_thomas.cc +++ b/deal.II/source/fe/fe_raviart_thomas.cc @@ -484,8 +484,8 @@ FE_RaviartThomas::interpolate( * values[face*n_face_points+k](GeometryInfo::unit_normal_direction[face]+offset); } - const unsigned start_cell_dofs = GeometryInfo::faces_per_cell*this->dofs_per_face; - const unsigned start_cell_points = GeometryInfo::faces_per_cell*n_face_points; + const unsigned int start_cell_dofs = GeometryInfo::faces_per_cell*this->dofs_per_face; + const unsigned int start_cell_points = GeometryInfo::faces_per_cell*n_face_points; for (unsigned int k=0;k::interpolate( * values[GeometryInfo::unit_normal_direction[face]][face*n_face_points+k]; } - const unsigned start_cell_dofs = GeometryInfo::faces_per_cell*this->dofs_per_face; - const unsigned start_cell_points = GeometryInfo::faces_per_cell*n_face_points; + const unsigned int start_cell_dofs = GeometryInfo::faces_per_cell*this->dofs_per_face; + const unsigned int start_cell_points = GeometryInfo::faces_per_cell*n_face_points; for (unsigned int k=0;k::build_cell_tables() this->system_to_component_table.resize(this->dofs_per_cell); this->face_system_to_component_table.resize(this->dofs_per_face); - unsigned total_index = 0; + unsigned int total_index = 0; this->block_indices_data.reinit(0,0); for (unsigned int base=0; base < this->n_base_elements(); ++base) @@ -1275,7 +1275,7 @@ FESystem::build_cell_tables() vertex_number::vertices_per_cell; ++vertex_number) { - unsigned comp_start = 0; + unsigned int comp_start = 0; for(unsigned int base=0; basen_base_elements(); ++base) for (unsigned int m=0; melement_multiplicity(base); ++m, comp_start+=base_element(base).n_components()) @@ -1312,7 +1312,7 @@ FESystem::build_cell_tables() line_number != GeometryInfo::lines_per_cell; ++line_number) { - unsigned comp_start = 0; + unsigned int comp_start = 0; for (unsigned int base=0; basen_base_elements(); ++base) for (unsigned int m=0; melement_multiplicity(base); ++m, comp_start+=base_element(base).n_components()) @@ -1507,15 +1507,15 @@ FESystem::build_face_tables() // 2. Lines if (GeometryInfo::lines_per_face > 0) - for (unsigned line_number= 0; + for (unsigned int line_number= 0; line_number != GeometryInfo::lines_per_face; ++line_number) { - unsigned comp_start = 0; - for(unsigned base = 0; base < this->n_base_elements(); ++base) + unsigned int comp_start = 0; + for(unsigned int base = 0; base < this->n_base_elements(); ++base) for (unsigned int m=0; melement_multiplicity(base); ++m, comp_start += base_element(base).n_components()) - for (unsigned local_index = 0; + for (unsigned int local_index = 0; local_index < base_element(base).dofs_per_line; ++local_index, ++total_index) { @@ -1553,15 +1553,15 @@ FESystem::build_face_tables() // 3. Quads if (GeometryInfo::quads_per_face > 0) - for (unsigned quad_number= 0; + for (unsigned int quad_number= 0; quad_number != GeometryInfo::quads_per_face; ++quad_number) { - unsigned comp_start = 0; - for(unsigned base=0; basen_base_elements(); ++base) + unsigned int comp_start = 0; + for(unsigned int base=0; basen_base_elements(); ++base) for (unsigned int m=0; melement_multiplicity(base); ++m, comp_start += base_element(base).n_components()) - for (unsigned local_index = 0; + for (unsigned int local_index = 0; local_index < base_element(base).dofs_per_quad; ++local_index, ++total_index) { @@ -3294,7 +3294,7 @@ compute_nonzero_components (const std::vector* vertex_number::vertices_per_cell; ++vertex_number) { - unsigned comp_start = 0; + unsigned int comp_start = 0; for(unsigned int base=0; basen_components()) @@ -3327,7 +3327,7 @@ compute_nonzero_components (const std::vector* line_number != GeometryInfo::lines_per_cell; ++line_number) { - unsigned comp_start = 0; + unsigned int comp_start = 0; for (unsigned int base=0; basen_components()) @@ -3456,7 +3456,7 @@ FESystem::has_support_on_face (const unsigned int shape_index, template Point -FESystem::unit_support_point (const unsigned index) const +FESystem::unit_support_point (const unsigned int index) const { Assert (index < this->dofs_per_cell, ExcIndexRange (index, 0, this->dofs_per_cell)); @@ -3481,7 +3481,7 @@ FESystem::unit_support_point (const unsigned index) const template Point -FESystem::unit_face_support_point (const unsigned index) const +FESystem::unit_face_support_point (const unsigned int index) const { Assert (index < this->dofs_per_face, ExcIndexRange (index, 0, this->dofs_per_face)); diff --git a/deal.II/source/fe/mapping_q1.cc b/deal.II/source/fe/mapping_q1.cc index 4ca013da9a..d40401de26 100644 --- a/deal.II/source/fe/mapping_q1.cc +++ b/deal.II/source/fe/mapping_q1.cc @@ -940,7 +940,7 @@ namespace internal // map the unit tangentials to the // real cell. checking for d!=dim-1 // eliminates compiler warnings - // regarding unsigned expressions < + // regarding unsigned int expressions < // 0. for (unsigned int d=0; d!=dim-1; ++d) { diff --git a/deal.II/source/grid/grid_tools.cc b/deal.II/source/grid/grid_tools.cc index e8250f1d69..62990c8f5a 100644 --- a/deal.II/source/grid/grid_tools.cc +++ b/deal.II/source/grid/grid_tools.cc @@ -703,7 +703,7 @@ namespace GridTools // look at the mid-points of edges for (; cell != endc; ++cell) { - for (unsigned v = 0; v < GeometryInfo::vertices_per_cell; v++) + for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; v++) if (cell->vertex_index(v) == vertex) { // OK, we found a cell that contains @@ -716,7 +716,7 @@ namespace GridTools // neighbor. if this is the case, then we need to also // add this neighbor if (dim >= 2) - for (unsigned vface = 0; vface < dim; vface++) + for (unsigned int vface = 0; vface < dim; vface++) { const unsigned int face = GeometryInfo::vertex_to_face[v][vface]; diff --git a/deal.II/source/grid/tria.cc b/deal.II/source/grid/tria.cc index 156b910e90..6f9355de11 100644 --- a/deal.II/source/grid/tria.cc +++ b/deal.II/source/grid/tria.cc @@ -12533,7 +12533,7 @@ unsigned int Triangulation::max_adjacent_cells () const // vertices used on level 0 unsigned int max_vertex_index = 0; for (; cell!=endc; ++cell) - for (unsigned vertex=0; vertex::vertices_per_cell; ++vertex) + for (unsigned int vertex=0; vertex::vertices_per_cell; ++vertex) if (cell->vertex_index(vertex) > max_vertex_index) max_vertex_index = cell->vertex_index(vertex); @@ -12546,7 +12546,7 @@ unsigned int Triangulation::max_adjacent_cells () const // every time we find an adjacent // element for (cell=begin(); cell!=endc; ++cell) - for (unsigned vertex=0; vertex::vertices_per_cell; ++vertex) + for (unsigned int vertex=0; vertex::vertices_per_cell; ++vertex) ++usage_count[cell->vertex_index(vertex)]; return std::max (GeometryInfo::vertices_per_cell, diff --git a/deal.II/source/lac/petsc_vector_base.cc b/deal.II/source/lac/petsc_vector_base.cc index 20dcc6fd0e..6820ff126a 100644 --- a/deal.II/source/lac/petsc_vector_base.cc +++ b/deal.II/source/lac/petsc_vector_base.cc @@ -100,7 +100,7 @@ namespace PETScWrappers else { //ghost entry - unsigned ghostidx + unsigned int ghostidx = vector.ghost_indices.index_within_set(index); Assert(ghostidx+end-begin<(unsigned int)lsize, ExcInternalError()); diff --git a/deal.II/source/numerics/derivative_approximation.cc b/deal.II/source/numerics/derivative_approximation.cc index 5f5ac9784e..6ada44114c 100644 --- a/deal.II/source/numerics/derivative_approximation.cc +++ b/deal.II/source/numerics/derivative_approximation.cc @@ -672,7 +672,7 @@ DerivativeApproximation::approximate (const Mapping &mapping, typename DH::active_cell_iterator cell, endc; cell = endc = dof_handler.begin_active(); // (static_cast to avoid warnings - // about unsigned always >=0) + // about unsigned int always >=0) std::advance (cell, static_cast(index_interval.first)); std::advance (endc, static_cast(index_interval.second)); diff --git a/deal.II/source/numerics/time_dependent.cc b/deal.II/source/numerics/time_dependent.cc index be529b60f8..c5d1355cc4 100644 --- a/deal.II/source/numerics/time_dependent.cc +++ b/deal.II/source/numerics/time_dependent.cc @@ -270,7 +270,7 @@ TimeStepBase::~TimeStepBase () void -TimeStepBase::wake_up (const unsigned ) +TimeStepBase::wake_up (const unsigned int ) {} @@ -454,7 +454,7 @@ TimeStepBase_Tria::~TimeStepBase_Tria () template void -TimeStepBase_Tria::wake_up (const unsigned wakeup_level) +TimeStepBase_Tria::wake_up (const unsigned int wakeup_level) { TimeStepBase::wake_up (wakeup_level); @@ -467,7 +467,7 @@ TimeStepBase_Tria::wake_up (const unsigned wakeup_level) template void -TimeStepBase_Tria::sleep (const unsigned sleep_level) +TimeStepBase_Tria::sleep (const unsigned int sleep_level) { if (sleep_level == flags.sleep_level_to_delete_grid) {