From: denis.davydov Date: Sun, 4 May 2014 17:35:16 +0000 (+0000) Subject: revert previous commit; add Assert to ParallelShared::renumber_dofs X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7cb4d0eb2eee02ce003cf12be13c3df9716c230;p=dealii-svn.git revert previous commit; add Assert to ParallelShared::renumber_dofs git-svn-id: https://svn.dealii.org/branches/branch_sharedtria@32882 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/dofs/dof_handler_policy.cc b/deal.II/source/dofs/dof_handler_policy.cc index 94859feff2..554a06dfc7 100644 --- a/deal.II/source/dofs/dof_handler_policy.cc +++ b/deal.II/source/dofs/dof_handler_policy.cc @@ -1004,49 +1004,8 @@ namespace internal dealii::DoFHandler &dof_handler, NumberCache &number_cache_current) const { - //shift: - std::vector gathered_new_numbers; - if ( new_numbers.size() < dof_handler.n_dofs()) - { - //gather sizes of new_nubers - const parallel::shared::Triangulation< dim, spacedim > *tr - = (dynamic_cast*> - (&dof_handler.get_tria())); - Assert (tr != 0, ExcInternalError()); - const unsigned int n_cpu = Utilities::MPI::n_mpi_processes(tr->get_communicator()); - - std::vector global_n_dofs(n_cpu); - types::global_dof_index n_dofs = new_numbers.size(); - MPI_Allgather(&n_dofs, 1, DEAL_II_DOF_INDEX_MPI_TYPE, - &global_n_dofs[0], 1, DEAL_II_DOF_INDEX_MPI_TYPE, - tr->get_communicator()); - - std::vector local_new_numbers (new_numbers.size(),0); - types::global_dof_index shift = 0; - for (unsigned int i = 0; i < tr->locally_owned_subdomain(); i++ ) - shift+=global_n_dofs[i]; - - for (unsigned int i = 0; i < new_numbers.size(); i++) - local_new_numbers[i] = new_numbers[i]+shift; - - //Assert ( std::max_element(local_new_numbers.begin(),local_new_numbers.end()) < dof_handler.n_dofs(),ExcInternalError() ); - - gathered_new_numbers.resize(dof_handler.n_dofs()); - MPI_Allgather(&local_new_numbers[0], local_new_numbers.size(), DEAL_II_DOF_INDEX_MPI_TYPE, - &gathered_new_numbers[0], local_new_numbers.size(), DEAL_II_DOF_INDEX_MPI_TYPE, - tr->get_communicator()); - } - else - { - gathered_new_numbers = new_numbers; - } - //debug: - //for (unsigned int i = 0; i < new_numbers.size(); i++) - // std::cout<::renumber_dofs (gathered_new_numbers,dof_handler,number_cache_current); + Assert(new_numbers.size() == dof_handler.n_dofs(), ExcInternalError()); + NumberCache number_cache = Sequential::renumber_dofs (new_numbers,dof_handler,number_cache_current); //update current number cache number_cache_current = number_cache; //correct number_cache: