From: bangerth Date: Fri, 31 Oct 2008 17:41:23 +0000 (+0000) Subject: Clean up code some. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d33de576735c01e833c642570679cf3bc3e0b0c7;p=dealii-svn.git Clean up code some. git-svn-id: https://svn.dealii.org/trunk@17432 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/dofs/dof_renumbering.cc b/deal.II/deal.II/source/dofs/dof_renumbering.cc index 095d619a91..84ac47df47 100644 --- a/deal.II/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/deal.II/source/dofs/dof_renumbering.cc @@ -500,20 +500,15 @@ namespace DoFRenumbering // constraints are not needed anymore constraints.clear (); - const unsigned int n_dofs = sparsity.n_rows(); - // store the new dof numbers; - // invalid_dof_index means that no new - // number was chosen yet - Assert(new_indices.size() == n_dofs, - ExcDimensionMismatch(new_indices.size(), n_dofs)); + Assert(new_indices.size() == n_dofs = sparsity.n_rows(), + ExcDimensionMismatch(new_indices.size(), + n_dofs = sparsity.n_rows())); SparsityTools::reorder_Cuthill_McKee (sparsity, new_indices, starting_indices); if (reversed_numbering) - for (std::vector::iterator i=new_indices.begin(); - i!=new_indices.end(); ++i) - *i = n_dofs-*i-1; + new_indices = Utilities::reverse_permutation (new_indices); } @@ -530,17 +525,12 @@ namespace DoFRenumbering dof_handler.max_couplings_between_dofs()); MGTools::make_sparsity_pattern (dof_handler, sparsity, level); - const unsigned int n_dofs = sparsity.n_rows(); - // store the new dof numbers; invalid_dof_index means - // that no new number was chosen yet - std::vector new_indices(n_dofs, DoFHandler::invalid_dof_index); - + std::vector new_indices(sparsity.n_rows()); SparsityTools::reorder_Cuthill_McKee (sparsity, new_indices, starting_indices); if (reversed_numbering) - for (std::vector::iterator i=new_indices.begin(); i!=new_indices.end(); ++i) - *i = n_dofs-*i; + new_indices = Utilities::reverse_permutation (new_indices); // actually perform renumbering; // this is dimension specific and