From 0dbaf1f3850fed7ba025fa333cf059c8a312e4f0 Mon Sep 17 00:00:00 2001 From: koecher Date: Fri, 10 Aug 2012 10:18:49 +0000 Subject: [PATCH] convert some unsigned ints to types::global_dof_index git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_3@25871 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/dofs/dof_levels.h | 2 +- deal.II/include/deal.II/dofs/dof_objects.h | 10 +- deal.II/include/deal.II/dofs/dof_tools.h | 28 ++--- deal.II/source/dofs/dof_objects.cc | 2 +- deal.II/source/dofs/dof_tools.cc | 138 ++++++++++----------- 5 files changed, 90 insertions(+), 90 deletions(-) diff --git a/deal.II/include/deal.II/dofs/dof_levels.h b/deal.II/include/deal.II/dofs/dof_levels.h index cb9c40d733..fd103594e9 100644 --- a/deal.II/include/deal.II/dofs/dof_levels.h +++ b/deal.II/include/deal.II/dofs/dof_levels.h @@ -108,7 +108,7 @@ namespace internal * times * selected_fe.dofs_per_cell. */ - std::vector cell_dof_indices_cache; + std::vector cell_dof_indices_cache; /** diff --git a/deal.II/include/deal.II/dofs/dof_objects.h b/deal.II/include/deal.II/dofs/dof_objects.h index 91a9475512..95af696f74 100644 --- a/deal.II/include/deal.II/dofs/dof_objects.h +++ b/deal.II/include/deal.II/dofs/dof_objects.h @@ -99,7 +99,7 @@ namespace internal const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, - const unsigned int global_index); + const types::global_dof_index global_index); /** * Return the global index of @@ -127,7 +127,7 @@ namespace internal * and non-hp classes. */ template - unsigned int + types::global_dof_index get_dof_index (const dealii::DoFHandler &dof_handler, const unsigned int obj_index, const unsigned int fe_index, @@ -144,7 +144,7 @@ namespace internal template unsigned int n_active_fe_indices (const dealii::DoFHandler &dof_handler, - const unsigned int index) const; + const types::global_dof_index index) const; /** * Similar to the function @@ -155,7 +155,7 @@ namespace internal template bool fe_index_is_active (const dealii::DoFHandler &dof_handler, - const unsigned int index, + const types::global_dof_index index, const unsigned int fe_index) const; /** @@ -204,7 +204,7 @@ namespace internal inline bool DoFObjects::fe_index_is_active (const dealii::DoFHandler &, - const unsigned int, + const types::global_dof_index, const unsigned int fe_index) const { Assert (fe_index == 0, diff --git a/deal.II/include/deal.II/dofs/dof_tools.h b/deal.II/include/deal.II/dofs/dof_tools.h index dbf3c6d871..05b3369a31 100644 --- a/deal.II/include/deal.II/dofs/dof_tools.h +++ b/deal.II/include/deal.II/dofs/dof_tools.h @@ -737,7 +737,7 @@ namespace DoFTools template void make_boundary_sparsity_pattern (const DH &dof, - const std::vector &dof_to_boundary_mapping, + const std::vector &dof_to_boundary_mapping, SparsityPattern &sparsity_pattern); /** @@ -774,7 +774,7 @@ namespace DoFTools void make_boundary_sparsity_pattern (const DH &dof, const typename FunctionMap::type &boundary_indicators, - const std::vector &dof_to_boundary_mapping, + const std::vector &dof_to_boundary_mapping, SparsityPattern &sparsity); /** @@ -2095,10 +2095,10 @@ namespace DoFTools template void count_dofs_per_component (const DH & dof_handler, - std::vector& dofs_per_component, + std::vector& dofs_per_component, const bool vector_valued_once = false, - std::vector target_component - = std::vector()); + std::vector target_component + = std::vector()); /** * Count the degrees of freedom @@ -2134,9 +2134,9 @@ namespace DoFTools template void count_dofs_per_block (const DH &dof, - std::vector &dofs_per_block, - std::vector target_block - = std::vector()); + std::vector &dofs_per_block, + std::vector target_block + = std::vector()); /** * @deprecated See the previous @@ -2149,8 +2149,8 @@ namespace DoFTools template void count_dofs_per_component (const DoFHandler& dof_handler, - std::vector& dofs_per_component, - std::vector target_component); + std::vector& dofs_per_component, + std::vector target_component); /** * This function can be used when @@ -2438,7 +2438,7 @@ namespace DoFTools template void map_dof_to_boundary_indices (const DH &dof_handler, - std::vector &mapping); + std::vector &mapping); /** * Same as the previous function, @@ -2455,7 +2455,7 @@ namespace DoFTools void map_dof_to_boundary_indices (const DH &dof_handler, const std::set &boundary_indicators, - std::vector &mapping); + std::vector &mapping); /** * Return a list of support @@ -2525,7 +2525,7 @@ namespace DoFTools void map_support_points_to_dofs (const Mapping &mapping, const DH &dof_handler, - std::map, unsigned int, Comp> &point_to_index_map); + std::map, types::global_dof_index, Comp> &point_to_index_map); /** * Map a coupling table from the @@ -2826,7 +2826,7 @@ namespace DoFTools map_support_points_to_dofs ( const Mapping &mapping, const DH &dof_handler, - std::map, unsigned int, Comp> &point_to_index_map) + std::map, types::global_dof_index, Comp> &point_to_index_map) { // let the checking of arguments be // done by the function first diff --git a/deal.II/source/dofs/dof_objects.cc b/deal.II/source/dofs/dof_objects.cc index f5709f1313..6fbb7f37aa 100644 --- a/deal.II/source/dofs/dof_objects.cc +++ b/deal.II/source/dofs/dof_objects.cc @@ -41,7 +41,7 @@ namespace internal const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, - const unsigned int global_index) + const types::global_dof_index global_index) { Assert ((fe_index == dealii::DoFHandler::default_fe_index), ExcMessage ("Only the default FE index is allowed for non-hp DoFHandler objects")); diff --git a/deal.II/source/dofs/dof_tools.cc b/deal.II/source/dofs/dof_tools.cc index 1d396983dd..fe6a8dc859 100644 --- a/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/source/dofs/dof_tools.cc @@ -83,7 +83,7 @@ namespace DoFTools "associated DoF handler objects, asking for any subdomain other " "than the locally owned one does not make sense.")); - std::vector dofs_on_this_cell; + std::vector dofs_on_this_cell; dofs_on_this_cell.reserve (max_dofs_per_cell(dof)); typename DH::active_cell_iterator cell = dof.begin_active(), endc = dof.end(); @@ -211,7 +211,7 @@ namespace DoFTools } - std::vector dofs_on_this_cell(fe_collection.max_dofs_per_cell()); + std::vector dofs_on_this_cell(fe_collection.max_dofs_per_cell()); typename DH::active_cell_iterator cell = dof.begin_active(), endc = dof.end(); @@ -285,9 +285,9 @@ namespace DoFTools cell_row->get_fe().dofs_per_cell; const unsigned int dofs_per_cell_col = cell_col->get_fe().dofs_per_cell; - std::vector + std::vector local_dof_indices_row(dofs_per_cell_row); - std::vector + std::vector local_dof_indices_col(dofs_per_cell_col); cell_row->get_dof_indices (local_dof_indices_row); cell_col->get_dof_indices (local_dof_indices_col); @@ -308,9 +308,9 @@ namespace DoFTools cell_row_child->get_fe().dofs_per_cell; const unsigned int dofs_per_cell_col = cell_col->get_fe().dofs_per_cell; - std::vector + std::vector local_dof_indices_row(dofs_per_cell_row); - std::vector + std::vector local_dof_indices_col(dofs_per_cell_col); cell_row_child->get_dof_indices (local_dof_indices_row); cell_col->get_dof_indices (local_dof_indices_col); @@ -332,9 +332,9 @@ namespace DoFTools cell_row->get_fe().dofs_per_cell; const unsigned int dofs_per_cell_col = cell_col_child->get_fe().dofs_per_cell; - std::vector + std::vector local_dof_indices_row(dofs_per_cell_row); - std::vector + std::vector local_dof_indices_col(dofs_per_cell_col); cell_row->get_dof_indices (local_dof_indices_row); cell_col_child->get_dof_indices (local_dof_indices_col); @@ -353,7 +353,7 @@ namespace DoFTools void make_boundary_sparsity_pattern ( const DH &dof, - const std::vector &dof_to_boundary_mapping, + const std::vector &dof_to_boundary_mapping, SparsityPattern &sparsity) { if (DH::dimension == 1) @@ -381,7 +381,7 @@ namespace DoFTools if (sparsity.n_rows() != 0) { unsigned int max_element = 0; - for (std::vector::const_iterator i=dof_to_boundary_mapping.begin(); + for (std::vector::const_iterator i=dof_to_boundary_mapping.begin(); i!=dof_to_boundary_mapping.end(); ++i) if ((*i != DH::invalid_dof_index) && (*i > max_element)) @@ -390,7 +390,7 @@ namespace DoFTools }; #endif - std::vector dofs_on_this_face; + std::vector dofs_on_this_face; dofs_on_this_face.reserve (max_dofs_per_face(dof)); // loop over all faces to check @@ -428,7 +428,7 @@ namespace DoFTools void make_boundary_sparsity_pattern ( const DH &dof, const typename FunctionMap::type &boundary_indicators, - const std::vector &dof_to_boundary_mapping, + const std::vector &dof_to_boundary_mapping, SparsityPattern &sparsity) { if (DH::dimension == 1) @@ -453,7 +453,7 @@ namespace DoFTools cell = cell->child(direction); const unsigned int dofs_per_vertex = cell->get_fe().dofs_per_vertex; - std::vector boundary_dof_boundary_indices (dofs_per_vertex); + std::vector boundary_dof_boundary_indices (dofs_per_vertex); // next get boundary mapped dof // indices of boundary dofs @@ -482,7 +482,7 @@ namespace DoFTools if (sparsity.n_rows() != 0) { unsigned int max_element = 0; - for (std::vector::const_iterator i=dof_to_boundary_mapping.begin(); + for (std::vector::const_iterator i=dof_to_boundary_mapping.begin(); i!=dof_to_boundary_mapping.end(); ++i) if ((*i != DH::invalid_dof_index) && (*i > max_element)) @@ -491,7 +491,7 @@ namespace DoFTools }; #endif - std::vector dofs_on_this_face; + std::vector dofs_on_this_face; dofs_on_this_face.reserve (max_dofs_per_face(dof)); typename DH::active_cell_iterator cell = dof.begin_active(), endc = dof.end(); @@ -542,8 +542,8 @@ namespace DoFTools "associated DoF handler objects, asking for any subdomain other " "than the locally owned one does not make sense.")); - std::vector dofs_on_this_cell; - std::vector dofs_on_other_cell; + std::vector dofs_on_this_cell; + std::vector dofs_on_other_cell; dofs_on_this_cell.reserve (max_dofs_per_cell(dof)); dofs_on_other_cell.reserve (max_dofs_per_cell(dof)); typename DH::active_cell_iterator cell = dof.begin_active(), @@ -748,8 +748,8 @@ namespace DoFTools { const FiniteElement &fe = dof.get_fe(); - std::vector dofs_on_this_cell(fe.dofs_per_cell); - std::vector dofs_on_other_cell(fe.dofs_per_cell); + std::vector dofs_on_this_cell(fe.dofs_per_cell); + std::vector dofs_on_other_cell(fe.dofs_per_cell); const Table<2,Coupling> int_dof_mask = dof_couplings_from_component_couplings(fe, int_mask), @@ -994,8 +994,8 @@ namespace DoFTools const dealii::hp::FECollection &fe = dof.get_fe(); - std::vector dofs_on_this_cell(DoFTools::max_dofs_per_cell(dof)); - std::vector dofs_on_other_cell(DoFTools::max_dofs_per_cell(dof)); + std::vector dofs_on_this_cell(DoFTools::max_dofs_per_cell(dof)); + std::vector dofs_on_other_cell(DoFTools::max_dofs_per_cell(dof)); const std::vector > int_dof_mask @@ -1228,7 +1228,7 @@ namespace DoFTools inline bool check_master_dof_list (const FullMatrix &face_interpolation_matrix, - const std::vector &master_dof_list) + const std::vector &master_dof_list) { const unsigned int N = master_dof_list.size(); @@ -1431,7 +1431,7 @@ namespace DoFTools // the other one. this latter case // shows up when running // hp/hp_constraints_q_system_06 - std::vector master_dof_list; + std::vector master_dof_list; unsigned int index = 0; for (int v=0; v(GeometryInfo::vertices_per_face); @@ -1534,7 +1534,7 @@ namespace DoFTools // finally copy the list into the // mask std::fill (master_dof_mask.begin(), master_dof_mask.end(), false); - for (std::vector::const_iterator i=master_dof_list.begin(); + for (std::vector::const_iterator i=master_dof_list.begin(); i!=master_dof_list.end(); ++i) master_dof_mask[*i] = true; } @@ -1826,8 +1826,8 @@ namespace DoFTools * fuller than necessary. */ void - filter_constraints (const std::vector &master_dofs, - const std::vector &slave_dofs, + filter_constraints (const std::vector &master_dofs, + const std::vector &slave_dofs, const FullMatrix &face_constraints, ConstraintMatrix &constraints) { @@ -2065,8 +2065,8 @@ namespace DoFTools const unsigned int spacedim = DH::space_dimension; - std::vector dofs_on_mother; - std::vector dofs_on_children; + std::vector dofs_on_mother; + std::vector dofs_on_children; // loop over all lines; only on // lines there can be constraints. @@ -2219,8 +2219,8 @@ namespace DoFTools { const unsigned int dim = 3; - std::vector dofs_on_mother; - std::vector dofs_on_children; + std::vector dofs_on_mother; + std::vector dofs_on_children; // loop over all quads; only on // quads there can be constraints. @@ -2479,9 +2479,9 @@ namespace DoFTools // dof numbers, as well as a // scratch array needed for the // complicated case below - std::vector master_dofs; - std::vector slave_dofs; - std::vector scratch_dofs; + std::vector master_dofs; + std::vector slave_dofs; + std::vector scratch_dofs; // caches for the face and // subface interpolation @@ -3355,8 +3355,8 @@ namespace DoFTools const unsigned int dofs_per_face = fe.dofs_per_face; - std::vector dofs_1(dofs_per_face); - std::vector dofs_2(dofs_per_face); + std::vector dofs_1(dofs_per_face); + std::vector dofs_2(dofs_per_face); face_1->get_dof_indices(dofs_1, face_1_index); face_2->get_dof_indices(dofs_2, face_2_index); @@ -3540,7 +3540,7 @@ namespace DoFTools // then loop over all cells and do // the work - std::vector indices; + std::vector indices; for (typename DH::active_cell_iterator c=dof.begin_active(); c!=dof.end(); ++ c) if (c->is_locally_owned()) @@ -3607,7 +3607,7 @@ namespace DoFTools typename DH::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); - std::vector dof_indices; + std::vector dof_indices; dof_indices.reserve (max_dofs_per_cell(dof_handler)); for (unsigned int present_cell = 0; cell!=endc; ++cell, ++present_cell) @@ -3879,7 +3879,7 @@ namespace DoFTools // then loop over all cells and do // work - std::vector indices(fe.dofs_per_cell); + std::vector indices(fe.dofs_per_cell); typename DH::cell_iterator c; for (c = dof.begin(level) ; c != dof.end(level) ; ++ c) { @@ -3947,7 +3947,7 @@ namespace DoFTools = (component_select != std::vector(component_select.size(), true)); - std::vector face_dof_indices; + std::vector face_dof_indices; face_dof_indices.reserve (max_dofs_per_face(dof_handler)); // now loop over all cells and @@ -4074,7 +4074,7 @@ namespace DoFTools // values selected_dofs.clear (); selected_dofs.resize (dof_handler.n_dofs(), false); - std::vector cell_dof_indices; + std::vector cell_dof_indices; cell_dof_indices.reserve (max_dofs_per_cell(dof_handler)); // now loop over all cells and @@ -4293,7 +4293,7 @@ namespace DoFTools // preset all values by false std::fill_n (selected_dofs.begin(), dof_handler.n_dofs(), false); - std::vector local_dof_indices; + std::vector local_dof_indices; local_dof_indices.reserve (max_dofs_per_cell(dof_handler)); // this function is similar to the @@ -4341,8 +4341,8 @@ namespace DoFTools // because we can't be sure that the dof // range of locally_owned_dofs is really // contiguous. - std::vector dof_indices; - std::set global_dof_indices; + std::vector dof_indices; + std::set global_dof_indices; typename DH::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); @@ -4352,7 +4352,7 @@ namespace DoFTools dof_indices.resize(cell->get_fe().dofs_per_cell); cell->get_dof_indices(dof_indices); - for (std::vector::iterator it=dof_indices.begin(); + for (std::vector::iterator it=dof_indices.begin(); it!=dof_indices.end(); ++it) if (!dof_set.is_element(*it)) @@ -4380,8 +4380,8 @@ namespace DoFTools // because we can't be sure that the dof // range of locally_owned_dofs is really // contiguous. - std::vector dof_indices; - std::set global_dof_indices; + std::vector dof_indices; + std::set global_dof_indices; typename DH::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); @@ -4391,7 +4391,7 @@ namespace DoFTools dof_indices.resize(cell->get_fe().dofs_per_cell); cell->get_dof_indices(dof_indices); - for (std::vector::iterator it=dof_indices.begin(); + for (std::vector::iterator it=dof_indices.begin(); it!=dof_indices.end(); ++it) if (!dof_set.is_element(*it)) @@ -4489,7 +4489,7 @@ namespace DoFTools std::fill_n (subdomain_association.begin(), dof_handler.n_dofs(), types::invalid_subdomain_id); - std::vector local_dof_indices; + std::vector local_dof_indices; local_dof_indices.reserve (max_dofs_per_cell(dof_handler)); // pseudo-randomly assign variables @@ -4580,7 +4580,7 @@ namespace DoFTools IndexSet index_set (dof_handler.n_dofs()); - std::vector local_dof_indices; + std::vector local_dof_indices; local_dof_indices.reserve (max_dofs_per_cell(dof_handler)); // first generate an unsorted list of all @@ -4591,7 +4591,7 @@ namespace DoFTools // hence too expensive. Could also use // std::set, but that is in general more // expensive than a vector - std::vector subdomain_indices; + std::vector subdomain_indices; typename DH::active_cell_iterator cell = dof_handler.begin_active(), @@ -4683,7 +4683,7 @@ namespace DoFTools const std::vector &dofs_by_component, const std::vector &target_component, const bool only_once, - std::vector &dofs_per_component, + std::vector &dofs_per_component, unsigned int &component) { for (unsigned int b=0;b &dofs_by_component, const std::vector &target_component, const bool only_once, - std::vector &dofs_per_component, + std::vector &dofs_per_component, unsigned int &component) { // assert that all elements in the collection have the same @@ -4783,7 +4783,7 @@ namespace DoFTools void count_dofs_per_component ( const DH & dof_handler, - std::vector& dofs_per_component, + std::vector& dofs_per_component, bool only_once, std::vector target_component) { @@ -4871,7 +4871,7 @@ namespace DoFTools template void count_dofs_per_block (const DH &dof_handler, - std::vector &dofs_per_block, + std::vector &dofs_per_block, std::vector target_block) { const dealii::hp::FECollection @@ -4953,7 +4953,7 @@ namespace DoFTools template void count_dofs_per_component (const DoFHandler &dof_handler, - std::vector &dofs_per_component, + std::vector &dofs_per_component, std::vector target_component) { count_dofs_per_component (dof_handler, dofs_per_component, @@ -5066,7 +5066,7 @@ namespace DoFTools dealii::Vector global_parameter_representation (n_fine_dofs); typename dealii::DoFHandler::active_cell_iterator cell; - std::vector parameter_dof_indices (coarse_fe.dofs_per_cell); + std::vector parameter_dof_indices (coarse_fe.dofs_per_cell); for (cell=begin; cell!=end; ++cell) { @@ -5347,7 +5347,7 @@ namespace DoFTools // interesting dof. finally count // how many true's there std::vector dof_is_interesting (fine_grid.n_dofs(), false); - std::vector local_dof_indices (fine_fe.dofs_per_cell); + std::vector local_dof_indices (fine_fe.dofs_per_cell); for (typename dealii::DoFHandler::active_cell_iterator cell=fine_grid.begin_active(); @@ -5374,7 +5374,7 @@ namespace DoFTools if (true) { - std::vector local_dof_indices(fine_fe.dofs_per_cell); + std::vector local_dof_indices(fine_fe.dofs_per_cell); unsigned int next_free_index=0; for (typename dealii::DoFHandler::active_cell_iterator cell=fine_grid.begin_active(); @@ -5799,7 +5799,7 @@ namespace DoFTools template void map_dof_to_boundary_indices (const DH &dof_handler, - std::vector &mapping) + std::vector &mapping) { Assert (&dof_handler.get_fe() != 0, ExcNoFESelected()); @@ -5807,7 +5807,7 @@ namespace DoFTools mapping.insert (mapping.end(), dof_handler.n_dofs(), DH::invalid_dof_index); - std::vector dofs_on_face; + std::vector dofs_on_face; dofs_on_face.reserve (max_dofs_per_face(dof_handler)); unsigned int next_boundary_index = 0; @@ -5848,7 +5848,7 @@ namespace DoFTools void map_dof_to_boundary_indices ( const DH &dof_handler, const std::set &boundary_indicators, - std::vector &mapping) + std::vector &mapping) { Assert (&dof_handler.get_fe() != 0, ExcNoFESelected()); Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(), @@ -5862,7 +5862,7 @@ namespace DoFTools if (boundary_indicators.size() == 0) return; - std::vector dofs_on_face; + std::vector dofs_on_face; dofs_on_face.reserve (max_dofs_per_face(dof_handler)); unsigned int next_boundary_index = 0; @@ -5893,7 +5893,7 @@ namespace DoFTools void map_dofs_to_support_points(const hp::MappingCollection & mapping, const DH &dof_handler, - std::map > &support_points) + std::map > &support_points) { const unsigned int dim = DH::dimension; const unsigned int spacedim = DH::space_dimension; @@ -5929,7 +5929,7 @@ namespace DoFTools typename DH::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); - std::vector local_dof_indices; + std::vector local_dof_indices; for (; cell != endc; ++cell) // only work on locally relevant cells if (cell->is_artificial() == false) @@ -5956,7 +5956,7 @@ namespace DoFTools std::vector > &support_points) { // get the data in the form of the map as above - std::map > x_support_points; + std::map > x_support_points; map_dofs_to_support_points(mapping, dof_handler, x_support_points); // now convert from the map to the linear vector. make sure every @@ -6021,7 +6021,7 @@ namespace DoFTools void map_dofs_to_support_points (const Mapping &mapping, const DoFHandler &dof_handler, - std::map > &support_points) + std::map > &support_points) { support_points.clear(); @@ -6039,7 +6039,7 @@ namespace DoFTools void map_dofs_to_support_points(const hp::MappingCollection &mapping, const hp::DoFHandler &dof_handler, - std::map > &support_points) + std::map > &support_points) { support_points.clear(); @@ -6132,7 +6132,7 @@ namespace DoFTools VectorTools::ExcNoComponentSelected()); // a field to store the indices - std::vector face_dofs; + std::vector face_dofs; face_dofs.reserve (max_dofs_per_face(dof)); typename DH::active_cell_iterator @@ -6187,7 +6187,7 @@ namespace DoFTools const DH& dof_handler, const unsigned int level, const std::vector& selected_dofs, - unsigned int offset) + types::global_dof_index offset) { typename DH::cell_iterator cell; typename DH::cell_iterator endc = dof_handler.end(level); -- 2.39.5