From acb51c2ff6bc7b12ae9a37bfa2e4b5bf1c7423da Mon Sep 17 00:00:00 2001 From: "kainan.wang" Date: Mon, 6 May 2013 22:20:06 +0000 Subject: [PATCH] More changes at dof_tools.cc git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29469 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/dofs/dof_tools.cc | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/deal.II/source/dofs/dof_tools.cc b/deal.II/source/dofs/dof_tools.cc index 9e006c0d27..48167c84d8 100644 --- a/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/source/dofs/dof_tools.cc @@ -4629,7 +4629,7 @@ namespace DoFTools const unsigned int coarse_component, const InterGridMap > &coarse_to_fine_grid_map, const std::vector > ¶meter_dofs, - const std::vector &weight_mapping, + const std::vector &weight_mapping, std::vector > &weights, const typename dealii::DoFHandler::active_cell_iterator &begin, const typename dealii::DoFHandler::active_cell_iterator &end) @@ -4683,7 +4683,7 @@ namespace DoFTools // vector to hold the representation of a single degree of freedom // on the coarse grid (for the selected fe) on the fine grid - const unsigned int n_fine_dofs = weight_mapping.size(); + const types::global_dof_index n_fine_dofs = weight_mapping.size(); dealii::Vector global_parameter_representation (n_fine_dofs); typename dealii::DoFHandler::active_cell_iterator cell; @@ -4741,9 +4741,9 @@ namespace DoFTools // weights, have only one mutex for all of them static Threads::Mutex mutex; Threads::Mutex::ScopedLock lock (mutex); - for (unsigned int i=0; i > &coarse_to_fine_grid_map, const std::vector > ¶meter_dofs, - const std::vector &weight_mapping, + const std::vector &weight_mapping, std::vector > &weights) { // simply distribute the range of cells to different threads @@ -4790,7 +4790,7 @@ namespace DoFTools const unsigned int , const InterGridMap > &, const std::vector > &, - const std::vector &, + const std::vector &, std::vector > &, const typename dealii::DoFHandler::active_cell_iterator &, const typename dealii::DoFHandler::active_cell_iterator &) @@ -4823,7 +4823,7 @@ namespace DoFTools const unsigned int fine_component, const InterGridMap > &coarse_to_fine_grid_map, std::vector > &weights, - std::vector &weight_mapping) + std::vector &weight_mapping) { // aliases to the finite elements used by the dof handlers: const FiniteElement &coarse_fe = coarse_grid.get_fe(), @@ -4949,7 +4949,7 @@ namespace DoFTools weights.resize (n_coarse_dofs); weight_mapping.clear (); - weight_mapping.resize (n_fine_dofs, -1); + weight_mapping.resize (n_fine_dofs, numbers::invalid_dof_index); if (true) { @@ -4964,7 +4964,7 @@ namespace DoFTools // if this DoF is a parameter dof and has not yet been // numbered, then do so if ((fine_fe.system_to_component_index(i).first == fine_component) && - (weight_mapping[local_dof_indices[i]] == -1)) + (weight_mapping[local_dof_indices[i]] == numbers::invalid_dof_index)) { weight_mapping[local_dof_indices[i]] = next_free_index; ++next_free_index; @@ -5060,7 +5060,7 @@ namespace DoFTools // grid; if it is a parameter dof, then its value is the column in // weights for that parameter dof, if it is any other dof, then its // value is -1, indicating an error - std::vector weight_mapping; + std::vector weight_mapping; const unsigned int n_parameters_on_fine_grid = internal::compute_intergrid_weights_1 (coarse_grid, coarse_component, @@ -5093,7 +5093,7 @@ namespace DoFTools // element in this row with weight identical to one. the representant // will become an unconstrained degree of freedom, while all others // will be constrained to this dof (and possibly others) - std::vector representants(n_coarse_dofs, -1); + std::vector representants(n_coarse_dofs, numbers::invalid_dof_index); for (types::global_dof_index parameter_dof=0; parameter_dof(column)) + if (weight_mapping[global_dof] == static_cast(column)) break; Assert (global_dof < weight_mapping.size(), ExcInternalError()); @@ -5139,7 +5139,7 @@ namespace DoFTools // but it is not known to the author how to make it faster... std::vector > constraint_line; for (types::global_dof_index global_dof=0; global_dof weight_mapping; + std::vector weight_mapping; internal::compute_intergrid_weights_1 (coarse_grid, coarse_component, fine_grid, fine_component, @@ -5241,7 +5241,7 @@ namespace DoFTools // now compute the requested representation const types::global_dof_index n_global_parm_dofs = std::count_if (weight_mapping.begin(), weight_mapping.end(), - std::bind2nd (std::not_equal_to (), -1)); + std::bind2nd (std::not_equal_to (), numbers::invalid_dof_index)); // first construct the inverse mapping of weight_mapping std::vector inverse_weight_mapping (n_global_parm_dofs, @@ -5250,7 +5250,7 @@ namespace DoFTools { const types::global_dof_index parameter_dof = weight_mapping[i]; // if this global dof is a parameter - if (parameter_dof != numbers::invalid_unsigned_int) + if (parameter_dof != numbers::invalid_dof_index) { Assert (parameter_dof < n_global_parm_dofs, ExcInternalError()); Assert ((inverse_weight_mapping[parameter_dof] == DoFHandler::invalid_dof_index), -- 2.39.5