From 2100a2c53eb412f0e36cb52ab01fdc1f71522af6 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sat, 28 Mar 2020 13:52:57 +0100 Subject: [PATCH] Explicitly spell dealii::parallel in multiple places --- .../deal.II/matrix_free/dof_info.templates.h | 23 ++-- .../deal.II/matrix_free/face_setup_internal.h | 6 +- .../deal.II/multigrid/mg_transfer.templates.h | 13 +- source/dofs/dof_handler_policy.cc | 120 ++++++++++-------- source/multigrid/mg_transfer_internal.cc | 10 +- 5 files changed, 94 insertions(+), 78 deletions(-) diff --git a/include/deal.II/matrix_free/dof_info.templates.h b/include/deal.II/matrix_free/dof_info.templates.h index ee12196d50..b717de9bfc 100644 --- a/include/deal.II/matrix_free/dof_info.templates.h +++ b/include/deal.II/matrix_free/dof_info.templates.h @@ -1571,16 +1571,15 @@ namespace internal std::vector row_lengths(n_rows); std::vector mutexes(n_rows / internal::bucket_size_threading + 1); - parallel::apply_to_subranges(0, - task_info.n_active_cells, - [this, - &mutexes, - &row_lengths](const unsigned int begin, - const unsigned int end) { - internal::compute_row_lengths( - begin, end, *this, mutexes, row_lengths); - }, - 20); + dealii::parallel::apply_to_subranges( + 0, + task_info.n_active_cells, + [this, &mutexes, &row_lengths](const unsigned int begin, + const unsigned int end) { + internal::compute_row_lengths( + begin, end, *this, mutexes, row_lengths); + }, + 20); // disregard dofs that only sit on a single cell because they cannot // couple @@ -1594,7 +1593,7 @@ namespace internal SparsityPattern connectivity_dof(n_rows, task_info.n_active_cells, row_lengths); - parallel::apply_to_subranges( + dealii::parallel::apply_to_subranges( 0, task_info.n_active_cells, [this, &row_lengths, &mutexes, &connectivity_dof]( @@ -1614,7 +1613,7 @@ namespace internal // create a connectivity list between cells. The connectivity graph // should apply the renumbering, i.e., the entry for cell j is the entry // for cell renumbering[j] in the original ordering. - parallel::apply_to_subranges( + dealii::parallel::apply_to_subranges( 0, task_info.n_active_cells, [this, &reverse_numbering, &connectivity_dof, &connectivity]( diff --git a/include/deal.II/matrix_free/face_setup_internal.h b/include/deal.II/matrix_free/face_setup_internal.h index 2ad4ab8437..24ee361cbe 100644 --- a/include/deal.II/matrix_free/face_setup_internal.h +++ b/include/deal.II/matrix_free/face_setup_internal.h @@ -298,9 +298,9 @@ namespace internal // looking at the length of the lists of faces # if defined(DEAL_II_WITH_MPI) && defined(DEBUG) MPI_Comm comm = MPI_COMM_SELF; - if (const parallel::TriangulationBase *ptria = - dynamic_cast *>( - &triangulation)) + if (const dealii::parallel::TriangulationBase *ptria = + dynamic_cast + *>(&triangulation)) comm = ptria->get_communicator(); MPI_Status status; diff --git a/include/deal.II/multigrid/mg_transfer.templates.h b/include/deal.II/multigrid/mg_transfer.templates.h index 0158b6310b..feb1507e15 100644 --- a/include/deal.II/multigrid/mg_transfer.templates.h +++ b/include/deal.II/multigrid/mg_transfer.templates.h @@ -120,8 +120,8 @@ namespace internal MGLevelObject &v) { const dealii::parallel::TriangulationBase *tria = - (dynamic_cast *>( - &dof_handler.get_triangulation())); + (dynamic_cast + *>(&dof_handler.get_triangulation())); AssertThrow( tria != nullptr, ExcMessage( @@ -148,8 +148,8 @@ namespace internal MGLevelObject &v) { const dealii::parallel::TriangulationBase *tria = - (dynamic_cast *>( - &dof_handler.get_triangulation())); + (dynamic_cast + *>(&dof_handler.get_triangulation())); AssertThrow( tria != nullptr, ExcMessage( @@ -455,8 +455,9 @@ MGLevelGlobalTransfer>::copy_to_mg( dst[level].reinit(ghosted_level_vector[level], false); else { - const parallel::TriangulationBase *tria = - (dynamic_cast *>( + const dealii::parallel::TriangulationBase *tria = + (dynamic_cast< + const dealii::parallel::TriangulationBase *>( &dof_handler.get_triangulation())); dst[level].reinit(dof_handler.locally_owned_mg_dofs(level), tria != nullptr ? tria->get_communicator() : diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index 2494008672..a21950148c 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -1064,8 +1064,8 @@ namespace internal // mark all vertices on ghost cells std::vector include_vertex( dof_handler.get_triangulation().n_vertices(), false); - if (dynamic_cast< - const parallel::DistributedTriangulationBase *>( + if (dynamic_cast *>( &dof_handler.get_triangulation()) != nullptr) for (const auto &cell : dof_handler.active_cell_iterators()) if (cell->is_ghost()) @@ -3289,8 +3289,9 @@ namespace internal const unsigned int dim = DoFHandlerType::dimension; const unsigned int spacedim = DoFHandlerType::space_dimension; - const parallel::shared::Triangulation *tr = - (dynamic_cast *>( + const dealii::parallel::shared::Triangulation *tr = + (dynamic_cast< + const dealii::parallel::shared::Triangulation *>( &this->dof_handler->get_triangulation())); Assert(tr != nullptr, ExcInternalError()); @@ -3451,8 +3452,9 @@ namespace internal const unsigned int dim = DoFHandlerType::dimension; const unsigned int spacedim = DoFHandlerType::space_dimension; - const parallel::shared::Triangulation *tr = - (dynamic_cast *>( + const dealii::parallel::shared::Triangulation *tr = + (dynamic_cast< + const dealii::parallel::shared::Triangulation *>( &this->dof_handler->get_triangulation())); Assert(tr != nullptr, ExcInternalError()); @@ -3475,10 +3477,12 @@ namespace internal std::vector saved_level_subdomain_ids; saved_level_subdomain_ids.resize(tr->n_cells(lvl)); { - typename parallel::shared::Triangulation::cell_iterator - cell = this->dof_handler->get_triangulation().begin(lvl), - endc = this->dof_handler->get_triangulation().end(lvl); + typename dealii::parallel::shared::Triangulation:: + cell_iterator cell = + this->dof_handler->get_triangulation().begin( + lvl), + endc = + this->dof_handler->get_triangulation().end(lvl); const std::vector &true_level_subdomain_ids = tr->get_true_level_subdomain_ids_of_cells(lvl); @@ -3609,10 +3613,12 @@ namespace internal // finally, restore current level subdomain ids { - typename parallel::shared::Triangulation::cell_iterator - cell = this->dof_handler->get_triangulation().begin(lvl), - endc = this->dof_handler->get_triangulation().end(lvl); + typename dealii::parallel::shared::Triangulation:: + cell_iterator cell = + this->dof_handler->get_triangulation().begin( + lvl), + endc = + this->dof_handler->get_triangulation().end(lvl); for (unsigned int index = 0; cell != endc; ++cell, ++index) cell->set_level_subdomain_id(saved_level_subdomain_ids[index]); @@ -3645,15 +3651,16 @@ namespace internal // Similar to distribute_dofs() we need to have a special treatment in // case artificial cells are present. - const parallel::shared::Triangulation *tr = - (dynamic_cast *>( + const dealii::parallel::shared::Triangulation *tr = + (dynamic_cast< + const dealii::parallel::shared::Triangulation *>( &this->dof_handler->get_triangulation())); Assert(tr != nullptr, ExcInternalError()); - typename parallel::shared::Triangulation::active_cell_iterator - cell = this->dof_handler->get_triangulation().begin_active(), - endc = this->dof_handler->get_triangulation().end(); + typename dealii::parallel::shared::Triangulation:: + active_cell_iterator + cell = this->dof_handler->get_triangulation().begin_active(), + endc = this->dof_handler->get_triangulation().end(); std::vector current_subdomain_ids( tr->n_active_cells()); const std::vector &true_subdomain_ids = @@ -3821,7 +3828,8 @@ namespace internal template void get_mg_dofindices_recursively( - const parallel::DistributedTriangulationBase &tria, + const dealii::parallel::DistributedTriangulationBase + &tria, const typename DoFHandler::level_cell_iterator & dealii_cell, const typename CellId::binary_type & quadrant, @@ -3863,9 +3871,9 @@ namespace internal template void find_marked_mg_ghost_cells_recursively( - const typename parallel::DistributedTriangulationBase - & tria, - const unsigned int tree_index, + const typename dealii::parallel:: + DistributedTriangulationBase &tria, + const unsigned int tree_index, const typename DoFHandler::level_cell_iterator &dealii_cell, std::map< @@ -3898,7 +3906,8 @@ namespace internal template void set_mg_dofindices_recursively( - const parallel::DistributedTriangulationBase &tria, + const dealii::parallel::DistributedTriangulationBase + &tria, const typename DoFHandler::level_cell_iterator & dealii_cell, const typename CellId::binary_type &quadrant, @@ -3964,9 +3973,9 @@ namespace internal template void communicate_mg_ghost_cells( - const typename parallel::DistributedTriangulationBase - & tria, - DoFHandlerType &dof_handler) + const typename dealii::parallel:: + DistributedTriangulationBase &tria, + DoFHandlerType & dof_handler) { using QuadrantBufferType = std::vector>; @@ -4176,9 +4185,9 @@ namespace internal template void - communicate_mg_ghost_cells( - const typename parallel::distributed::Triangulation<1, spacedim> &, - DoFHandler<1, spacedim> &) + communicate_mg_ghost_cells(const typename dealii::parallel:: + distributed::Triangulation<1, spacedim> &, + DoFHandler<1, spacedim> &) { Assert(false, ExcNotImplemented()); } @@ -4187,9 +4196,9 @@ namespace internal template void - communicate_mg_ghost_cells( - const typename parallel::distributed::Triangulation<1, spacedim> &, - hp::DoFHandler<1, spacedim> &) + communicate_mg_ghost_cells(const typename dealii::parallel:: + distributed::Triangulation<1, spacedim> &, + hp::DoFHandler<1, spacedim> &) { Assert(false, ExcNotImplemented()); } @@ -4367,9 +4376,10 @@ namespace internal // different tags for phase 1 and 2, but the cost of a // barrier is negligible compared to everything else we do // here - if (const auto *triangulation = dynamic_cast< - const parallel::DistributedTriangulationBase *>( - &dof_handler.get_triangulation())) + if (const auto *triangulation = + dynamic_cast *>( + &dof_handler.get_triangulation())) { const int ierr = MPI_Barrier(triangulation->get_communicator()); AssertThrowMPI(ierr); @@ -4411,10 +4421,12 @@ namespace internal const unsigned int dim = DoFHandlerType::dimension; const unsigned int spacedim = DoFHandlerType::space_dimension; - parallel::DistributedTriangulationBase *triangulation = - (dynamic_cast - *>(const_cast *>( - &dof_handler->get_triangulation()))); + dealii::parallel::DistributedTriangulationBase + *triangulation = + (dynamic_cast< + dealii::parallel::DistributedTriangulationBase *>( + const_cast *>( + &dof_handler->get_triangulation()))); Assert(triangulation != nullptr, ExcInternalError()); const types::subdomain_id subdomain_id = @@ -4646,10 +4658,12 @@ namespace internal const unsigned int dim = DoFHandlerType::dimension; const unsigned int spacedim = DoFHandlerType::space_dimension; - parallel::DistributedTriangulationBase *triangulation = - (dynamic_cast - *>(const_cast *>( - &dof_handler->get_triangulation()))); + dealii::parallel::DistributedTriangulationBase + *triangulation = + (dynamic_cast< + dealii::parallel::DistributedTriangulationBase *>( + const_cast *>( + &dof_handler->get_triangulation()))); Assert(triangulation != nullptr, ExcInternalError()); AssertThrow((triangulation->is_multilevel_hierarchy_constructed()), @@ -4882,10 +4896,12 @@ namespace internal const unsigned int dim = DoFHandlerType::dimension; const unsigned int spacedim = DoFHandlerType::space_dimension; - parallel::DistributedTriangulationBase *triangulation = - (dynamic_cast - *>(const_cast *>( - &dof_handler->get_triangulation()))); + dealii::parallel::DistributedTriangulationBase + *triangulation = + (dynamic_cast< + dealii::parallel::DistributedTriangulationBase *>( + const_cast *>( + &dof_handler->get_triangulation()))); Assert(triangulation != nullptr, ExcInternalError()); @@ -5139,9 +5155,9 @@ namespace internal constexpr int dim = DoFHandlerType::dimension; constexpr int spacedim = DoFHandlerType::space_dimension; - const parallel::TriangulationBase *tr = - (dynamic_cast *>( - &this->dof_handler->get_triangulation())); + const dealii::parallel::TriangulationBase *tr = + (dynamic_cast + *>(&this->dof_handler->get_triangulation())); Assert(tr != nullptr, ExcInternalError()); const unsigned int my_rank = diff --git a/source/multigrid/mg_transfer_internal.cc b/source/multigrid/mg_transfer_internal.cc index 7eb2363c76..20179c8eb3 100644 --- a/source/multigrid/mg_transfer_internal.cc +++ b/source/multigrid/mg_transfer_internal.cc @@ -215,8 +215,8 @@ namespace internal } const dealii::parallel::TriangulationBase *tria = - (dynamic_cast *>( - &dof_handler.get_triangulation())); + (dynamic_cast + *>(&dof_handler.get_triangulation())); AssertThrow( send_data_temp.size() == 0 || tria != nullptr, ExcMessage( @@ -947,9 +947,9 @@ namespace internal // the base class for keeping ghosted transfer indices. To avoid // keeping two very similar vectors, we keep one single ghosted // vector that is augmented/filled here. - const parallel::TriangulationBase *ptria = - (dynamic_cast *>( - &tria)); + const dealii::parallel::TriangulationBase *ptria = + (dynamic_cast< + const dealii::parallel::TriangulationBase *>(&tria)); const MPI_Comm communicator = ptria != nullptr ? ptria->get_communicator() : MPI_COMM_SELF; -- 2.39.5