From: Peter Munch Date: Fri, 19 Jun 2020 14:41:51 +0000 (+0200) Subject: Remove DoFHandlerType from dof_handler_policy.h/.cc X-Git-Tag: v9.3.0-rc1~1410^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1cc9092fd7998e48cb5ed57c87a6d698de5214b;p=dealii.git Remove DoFHandlerType from dof_handler_policy.h/.cc --- diff --git a/include/deal.II/dofs/dof_handler_policy.h b/include/deal.II/dofs/dof_handler_policy.h index 6e45adaa50..bc704f09b0 100644 --- a/include/deal.II/dofs/dof_handler_policy.h +++ b/include/deal.II/dofs/dof_handler_policy.h @@ -113,9 +113,8 @@ namespace internal * This class implements the default policy for sequential operations, * i.e. for the case where all cells get degrees of freedom. */ - template - class Sequential : public PolicyBase + template + class Sequential : public PolicyBase { public: /** @@ -123,7 +122,7 @@ namespace internal * @param dof_handler The DoFHandler object upon which this * policy class is supposed to work. */ - Sequential(DoFHandlerType &dof_handler); + Sequential(DoFHandler &dof_handler); // documentation is inherited virtual NumberCache @@ -148,7 +147,7 @@ namespace internal /** * The DoFHandler object on which this policy object works. */ - SmartPointer dof_handler; + SmartPointer> dof_handler; }; @@ -157,9 +156,8 @@ namespace internal * This class implements the policy for operations when we use a * parallel::shared::Triangulation object. */ - template - class ParallelShared : public PolicyBase + template + class ParallelShared : public PolicyBase { public: /** @@ -167,7 +165,7 @@ namespace internal * @param dof_handler The DoFHandler object upon which this * policy class is supposed to work. */ - ParallelShared(DoFHandlerType &dof_handler); + ParallelShared(DoFHandler &dof_handler); /** * Distribute degrees of freedom on the object given as first @@ -209,7 +207,7 @@ namespace internal /** * The DoFHandler object on which this policy object works. */ - SmartPointer dof_handler; + SmartPointer> dof_handler; }; @@ -217,10 +215,8 @@ namespace internal * This class implements the policy for operations when we use a * parallel::DistributedTriangulationBase object. */ - template - class ParallelDistributed - : public PolicyBase + template + class ParallelDistributed : public PolicyBase { public: /** @@ -228,7 +224,7 @@ namespace internal * @param dof_handler The DoFHandler object upon which this * policy class is supposed to work. */ - ParallelDistributed(DoFHandlerType &dof_handler); + ParallelDistributed(DoFHandler &dof_handler); // documentation is inherited virtual NumberCache @@ -253,7 +249,7 @@ namespace internal /** * The DoFHandler object on which this policy object works. */ - SmartPointer dof_handler; + SmartPointer> dof_handler; }; } // namespace Policy } // namespace DoFHandlerImplementation diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index e32b0a8563..02c6ef96b8 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -51,29 +51,23 @@ namespace internal { std::string policy_name; if (dynamic_cast> *>( - &policy) || + Policy::Sequential *>(&policy) || dynamic_cast> *>( - &policy)) + Policy::Sequential *>(&policy)) policy_name = "Policy::Sequential<"; else if (dynamic_cast< const typename dealii::internal::DoFHandlerImplementation:: - Policy::ParallelDistributed> - *>(&policy) || + Policy::ParallelDistributed *>(&policy) || dynamic_cast< const typename dealii::internal::DoFHandlerImplementation:: - Policy::ParallelDistributed> - *>(&policy)) + Policy::ParallelDistributed *>(&policy)) policy_name = "Policy::ParallelDistributed<"; else if (dynamic_cast< const typename dealii::internal::DoFHandlerImplementation:: - Policy::ParallelShared> *>( - &policy) || + Policy::ParallelShared *>(&policy) || dynamic_cast< const typename dealii::internal::DoFHandlerImplementation:: - Policy::ParallelShared> *>( - &policy)) + Policy::ParallelShared *>(&policy)) policy_name = "Policy::ParallelShared<"; else AssertThrow(false, ExcNotImplemented()); @@ -2606,19 +2600,18 @@ DoFHandler::setup_policy() // decide whether we need a sequential or a parallel distributed policy if (dynamic_cast *>(&this->get_triangulation()) != nullptr) - this->policy = - std::make_unique>>(*this); + this->policy = std::make_unique>(*this); else if (dynamic_cast< const dealii::parallel::DistributedTriangulationBase *>(&this->get_triangulation()) == nullptr) - this->policy = - std::make_unique>>(*this); + this->policy = std::make_unique< + internal::DoFHandlerImplementation::Policy::Sequential>( + *this); else this->policy = std::make_unique>>(*this); + ParallelDistributed>(*this); } @@ -3003,8 +2996,7 @@ DoFHandler::setup_policy_and_listeners() { this->policy = std::make_unique>>( - *this); + ParallelDistributed>(*this); // repartitioning signals this->tria_listeners.push_back( @@ -3039,7 +3031,7 @@ DoFHandler::setup_policy_and_listeners() { this->policy = std::make_unique>>(*this); + ParallelShared>(*this); // partitioning signals this->tria_listeners.push_back( @@ -3057,9 +3049,9 @@ DoFHandler::setup_policy_and_listeners() } else { - this->policy = - std::make_unique>>(*this); + this->policy = std::make_unique< + internal::DoFHandlerImplementation::Policy::Sequential>( + *this); // refinement signals this->tria_listeners.push_back(this->tria->signals.pre_refinement.connect( diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index 6d5ac2be5b..e8741fc818 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -68,22 +68,15 @@ namespace internal * Update the cache used for cell dof indices on all (non-artificial) * active cells of the given DoFHandler. */ - template + template void update_all_active_cell_dof_indices_caches( - const DoFHandlerType &dof_handler) + const DoFHandler &dof_handler) { - typename DoFHandlerType::active_cell_iterator - beginc = dof_handler.begin_active(), - endc = dof_handler.end(); - - auto worker = - [](const typename DoFHandlerType::active_cell_iterator &cell, - void *, - void *) { - if (!cell->is_artificial()) - cell->update_cell_dof_indices_cache(); - }; + const auto worker = [](const auto &cell, void *, void *) { + if (!cell->is_artificial()) + cell->update_cell_dof_indices_cache(); + }; // parallelize filling all of the cell caches. by using // WorkStream, we make sure that we only run through the @@ -91,8 +84,8 @@ namespace internal // for example has to split the range multiple times, // which is expensive because cell iterators are not // random access iterators with a cheap operator- - WorkStream::run(beginc, - endc, + WorkStream::run(dof_handler.begin_active(), + dof_handler.end(), worker, /* copier */ std::function(), /* scratch_data */ nullptr, @@ -106,22 +99,15 @@ namespace internal * Update the cache used for cell dof indices on all (non-artificial) * level (multigrid) cells of the given DoFHandler. */ - template + template void update_all_level_cell_dof_indices_caches( - const DoFHandlerType &dof_handler) + const DoFHandler &dof_handler) { - typename DoFHandlerType::level_cell_iterator beginc = - dof_handler.begin(), - endc = dof_handler.end(); - - auto worker = - [](const typename DoFHandlerType::level_cell_iterator &cell, - void *, - void *) { - if (cell->has_children() || !cell->is_artificial()) - cell->update_cell_dof_indices_cache(); - }; + const auto worker = [](const auto &cell, void *, void *) { + if (cell->has_children() || !cell->is_artificial()) + cell->update_cell_dof_indices_cache(); + }; // parallelize filling all of the cell caches. by using // WorkStream, we make sure that we only run through the @@ -129,8 +115,8 @@ namespace internal // for example has to split the range multiple times, // which is expensive because cell iterators are not // random access iterators with a cheap operator- - WorkStream::run(beginc, - endc, + WorkStream::run(dof_handler.begin(), + dof_handler.end(), worker, /* copier */ std::function(), /* scratch_data */ nullptr, @@ -436,8 +422,7 @@ namespace internal for (unsigned int l = 0; l < GeometryInfo::lines_per_cell; ++l) if (cell->line(l)->user_flag_set() == false) { - const typename DoFHandler::line_iterator line = - cell->line(l); + const auto line = cell->line(l); line->set_user_flag(); unsigned int unique_sets_of_dofs = @@ -807,8 +792,7 @@ namespace internal if ((cell->quad(q)->user_flag_set() == false) && (cell->quad(q)->n_active_fe_indices() == 2)) { - const typename DoFHandler::quad_iterator quad = - cell->quad(q); + const auto quad = cell->quad(q); quad->set_user_flag(); const std::set fe_indices = @@ -963,17 +947,16 @@ namespace internal * Returns the final number of degrees of freedom, which is the number * of all valid DoF indices in @p new_dof_indices. */ - template + template static types::global_dof_index enumerate_dof_indices_for_renumbering( std::vector &new_dof_indices, const std::vector< std::map> &all_constrained_indices, - const DoFHandlerType &) + const DoFHandler &) { - Assert(all_constrained_indices.size() == DoFHandlerType::dimension, - ExcInternalError()); + Assert(all_constrained_indices.size() == dim, ExcInternalError()); // first preset the new DoF indices that are identities for (const auto &constrained_dof_indices : all_constrained_indices) @@ -1284,8 +1267,7 @@ namespace internal if ((cell->is_locally_owned()) && (cell->line(l)->user_flag_set() == true)) { - const typename DoFHandler::line_iterator line = - cell->line(l); + const auto line = cell->line(l); line->clear_user_flag(); unsigned int unique_sets_of_dofs = @@ -1562,8 +1544,7 @@ namespace internal (cell->quad(q)->user_flag_set() == true) && (cell->quad(q)->n_active_fe_indices() == 2)) { - const typename DoFHandler::quad_iterator quad = - cell->quad(q); + const auto quad = cell->quad(q); quad->clear_user_flag(); const std::set fe_indices = @@ -1695,10 +1676,10 @@ namespace internal * numbers::invalid_subdomain_id. Return the total number of dofs * distributed. */ - template + template static types::global_dof_index - distribute_dofs(const types::subdomain_id subdomain_id, - DoFHandlerType & dof_handler) + distribute_dofs(const types::subdomain_id subdomain_id, + DoFHandler &dof_handler) { Assert(dof_handler.get_triangulation().n_levels() > 0, ExcMessage("Empty triangulation")); @@ -1749,12 +1730,12 @@ namespace internal * Phase 5, these values will be overwritten by the correct one. The * invalidated indices will be stored in the @p renumbering parameter. */ - template + template static void invalidate_dof_indices_on_weaker_ghost_cells_for_renumbering( std::vector &renumbering, const types::subdomain_id subdomain_id, - const DoFHandlerType & dof_handler) + const DoFHandler & dof_handler) { std::vector local_dof_indices; @@ -1781,18 +1762,15 @@ namespace internal - template + template static types::global_dof_index - distribute_dofs_on_level(const types::subdomain_id level_subdomain_id, - DoFHandlerType & dof_handler, - const unsigned int level) + distribute_dofs_on_level(const types::subdomain_id level_subdomain_id, + DoFHandler &dof_handler, + const unsigned int level) { Assert(dof_handler.hp_capability_enabled == false, ExcInternalError()); - const unsigned int dim = DoFHandlerType::dimension; - const unsigned int spacedim = DoFHandlerType::space_dimension; - const dealii::Triangulation &tria = dof_handler.get_triangulation(); Assert(tria.n_levels() > 0, ExcMessage("Empty triangulation")); @@ -2132,8 +2110,7 @@ namespace internal ++l) if (cell->line(l)->user_flag_set() == false) { - const typename DoFHandler::line_iterator - line = cell->line(l); + const auto line = cell->line(l); line->set_user_flag(); const unsigned int n_active_fe_indices = @@ -2242,8 +2219,7 @@ namespace internal ++l) if (cell->line(l)->user_flag_set() == false) { - const typename DoFHandler::line_iterator - line = cell->line(l); + const auto line = cell->line(l); line->set_user_flag(); const unsigned int n_active_fe_indices = @@ -2321,8 +2297,7 @@ namespace internal ++q) if (cell->quad(q)->user_flag_set() == false) { - const typename DoFHandler::quad_iterator - quad = cell->quad(q); + const auto quad = cell->quad(q); quad->set_user_flag(); const unsigned int n_active_fe_indices = @@ -2582,19 +2557,16 @@ namespace internal // level, as those lines logically belong to the same // level as the cell, at least for for isotropic // refinement - typename DoFHandler<2, spacedim>::level_cell_iterator cell, - endc = dof_handler.end(level); - for (cell = dof_handler.begin(level); cell != endc; ++cell) + for (const auto &cell : + dof_handler.cell_iterators_on_level(level)) if (cell->level_subdomain_id() != numbers::artificial_subdomain_id) for (const unsigned int line : GeometryInfo<2>::face_indices()) cell->face(line)->set_user_flag(); - for (typename DoFHandler<2, spacedim>::cell_iterator cell = - dof_handler.begin(); - cell != dof_handler.end(); - ++cell) + for (const auto &cell : + dof_handler.cell_iterators_on_level(level)) for (unsigned int l = 0; l < GeometryInfo<2>::lines_per_cell; ++l) if (cell->line(l)->user_flag_set()) @@ -2651,9 +2623,8 @@ namespace internal // flag all lines adjacent to cells of the current // level, as those lines logically belong to the same // level as the cell, at least for isotropic refinement - typename DoFHandler<3, spacedim>::level_cell_iterator cell, - endc = dof_handler.end(level); - for (cell = dof_handler.begin(level); cell != endc; ++cell) + for (const auto &cell : + dof_handler.cell_iterators_on_level(level)) if (cell->level_subdomain_id() != numbers::artificial_subdomain_id) for (unsigned int line = 0; @@ -2661,10 +2632,8 @@ namespace internal ++line) cell->line(line)->set_user_flag(); - for (typename DoFHandler<3, spacedim>::cell_iterator cell = - dof_handler.begin(); - cell != dof_handler.end(); - ++cell) + for (const auto &cell : + dof_handler.cell_iterators_on_level(level)) for (unsigned int l = 0; l < GeometryInfo<3>::lines_per_cell; ++l) if (cell->line(l)->user_flag_set()) @@ -2694,7 +2663,8 @@ namespace internal // flag all quads adjacent to cells of the current level, as // those quads logically belong to the same level as the cell, // at least for isotropic refinement - for (cell = dof_handler.begin(level); cell != endc; ++cell) + for (const auto &cell : + dof_handler.cell_iterators_on_level(level)) if (cell->level_subdomain_id() != numbers::artificial_subdomain_id) for (unsigned int quad = 0; @@ -2702,10 +2672,7 @@ namespace internal ++quad) cell->quad(quad)->set_user_flag(); - for (typename DoFHandler<3, spacedim>::cell_iterator cell = - dof_handler.begin(); - cell != dof_handler.end(); - ++cell) + for (const auto &cell : dof_handler.cell_iterators()) for (unsigned int l = 0; l < GeometryInfo<3>::quads_per_cell; ++l) if (cell->quad(l)->user_flag_set()) @@ -2791,16 +2758,17 @@ namespace internal - template - Sequential::Sequential(DoFHandlerType &dof_handler) + template + Sequential::Sequential( + DoFHandler &dof_handler) : dof_handler(&dof_handler) {} - template + template NumberCache - Sequential::distribute_dofs() const + Sequential::distribute_dofs() const { const types::global_dof_index n_initial_dofs = Implementation::distribute_dofs(numbers::invalid_subdomain_id, @@ -2817,15 +2785,14 @@ namespace internal - template + template std::vector - Sequential::distribute_mg_dofs() const + Sequential::distribute_mg_dofs() const { std::vector user_flags; dof_handler->get_triangulation().save_user_flags(user_flags); - const_cast &>( + const_cast &>( dof_handler->get_triangulation()) .clear_user_flags(); @@ -2844,8 +2811,7 @@ namespace internal number_caches.emplace_back(n_level_dofs); } - const_cast &>( + const_cast &>( dof_handler->get_triangulation()) .load_user_flags(user_flags); @@ -2854,9 +2820,9 @@ namespace internal - template + template NumberCache - Sequential::renumber_dofs( + Sequential::renumber_dofs( const std::vector &new_numbers) const { Implementation::renumber_dofs(new_numbers, @@ -2878,9 +2844,9 @@ namespace internal - template + template NumberCache - Sequential::renumber_mg_dofs( + Sequential::renumber_mg_dofs( const unsigned int level, const std::vector &new_numbers) const { @@ -2895,9 +2861,9 @@ namespace internal /* --------------------- class ParallelShared ---------------- */ - template - ParallelShared::ParallelShared( - DoFHandlerType &dof_handler) + template + ParallelShared::ParallelShared( + DoFHandler &dof_handler) : dof_handler(&dof_handler) {} @@ -2913,11 +2879,12 @@ namespace internal * has already been set up. In can, consequently, be called at a point * when we are still distributing degrees of freedom. */ - template + template std::vector - get_dof_subdomain_association(const DoFHandlerType & dof_handler, - const types::global_dof_index n_dofs, - const unsigned int n_procs) + get_dof_subdomain_association( + const DoFHandler &dof_handler, + const types::global_dof_index n_dofs, + const unsigned int n_procs) { (void)n_procs; std::vector subdomain_association( @@ -2927,10 +2894,7 @@ namespace internal // loop over all cells and record which subdomain a DoF belongs to. // give to the smaller subdomain_id in case it is on an interface - typename DoFHandlerType::active_cell_iterator - cell = dof_handler.begin_active(), - endc = dof_handler.end(); - for (; cell != endc; ++cell) + for (const auto &cell : dof_handler.active_cell_iterators()) { // get the owner of the cell; note that we have made sure above // that all cells are either locally owned or ghosts (not @@ -2974,13 +2938,13 @@ namespace internal * the same way as parallel::DistributedTriangulationBase (proc with * smallest index) instead of the coin flip method above. */ - template + template std::vector get_dof_level_subdomain_association( - const DoFHandlerType & dof_handler, - const types::global_dof_index n_dofs_on_level, - const unsigned int n_procs, - const unsigned int level) + const DoFHandler &dof_handler, + const types::global_dof_index n_dofs_on_level, + const unsigned int n_procs, + const unsigned int level) { (void)n_procs; std::vector level_subdomain_association( @@ -2990,10 +2954,7 @@ namespace internal // loop over all cells and record which subdomain a DoF belongs to. // interface goes to proccessor with smaller subdomain id - typename DoFHandlerType::cell_iterator cell = - dof_handler.begin(level), - endc = dof_handler.end(level); - for (; cell != endc; ++cell) + for (const auto &cell : dof_handler.cell_iterators_on_level(level)) { // get the owner of the cell; note that we have made sure above // that all cells are either locally owned or ghosts (not @@ -3036,13 +2997,10 @@ namespace internal - template + template NumberCache - ParallelShared::distribute_dofs() const + ParallelShared::distribute_dofs() const { - const unsigned int dim = DoFHandlerType::dimension; - const unsigned int spacedim = DoFHandlerType::space_dimension; - const dealii::parallel::shared::Triangulation *tr = (dynamic_cast< const dealii::parallel::shared::Triangulation *>( @@ -3199,13 +3157,10 @@ namespace internal - template + template std::vector - ParallelShared::distribute_mg_dofs() const + ParallelShared::distribute_mg_dofs() const { - const unsigned int dim = DoFHandlerType::dimension; - const unsigned int spacedim = DoFHandlerType::space_dimension; - const dealii::parallel::shared::Triangulation *tr = (dynamic_cast< const dealii::parallel::shared::Triangulation *>( @@ -3390,9 +3345,9 @@ namespace internal - template + template NumberCache - ParallelShared::renumber_dofs( + ParallelShared::renumber_dofs( const std::vector &new_numbers) const { #ifndef DEAL_II_WITH_MPI @@ -3400,9 +3355,6 @@ namespace internal Assert(false, ExcNotImplemented()); return NumberCache(); #else - const unsigned int dim = DoFHandlerType::dimension; - const unsigned int spacedim = DoFHandlerType::space_dimension; - // Similar to distribute_dofs() we need to have a special treatment in // case artificial cells are present. const dealii::parallel::shared::Triangulation *tr = @@ -3559,9 +3511,9 @@ namespace internal - template + template NumberCache - ParallelShared::renumber_mg_dofs( + ParallelShared::renumber_mg_dofs( const unsigned int /*level*/, const std::vector & /*new_numbers*/) const { @@ -3579,12 +3531,12 @@ namespace internal namespace { - template + template void communicate_mg_ghost_cells( const typename dealii::parallel:: DistributedTriangulationBase &tria, - DoFHandlerType & dof_handler) + DoFHandler & dof_handler) { (void)tria; const auto pack = [&](const auto &cell) { @@ -3624,13 +3576,16 @@ namespace internal complete = false; if (!complete) - const_cast(cell) + const_cast< + typename DoFHandler::level_cell_iterator &>(cell) ->set_user_flag(); else - const_cast(cell) + const_cast< + typename DoFHandler::level_cell_iterator &>(cell) ->clear_user_flag(); - const_cast(cell) + const_cast< + typename DoFHandler::level_cell_iterator &>(cell) ->set_mg_dof_indices(dof_indices); }; @@ -3640,7 +3595,7 @@ namespace internal GridTools::exchange_cell_data_to_level_ghosts< std::vector, - DoFHandlerType>(dof_handler, pack, unpack, filter); + DoFHandler>(dof_handler, pack, unpack, filter); } @@ -3674,17 +3629,15 @@ namespace internal * all ghost cells. In phase 2, this is only true if we * did not receive a complete set of DoF indices in phase 1. */ - template + template void communicate_dof_indices_on_marked_cells( - const DoFHandlerType &dof_handler) + const DoFHandler &dof_handler) { # ifndef DEAL_II_WITH_MPI (void)dof_handler; Assert(false, ExcNotImplemented()); # else - const unsigned int dim = DoFHandlerType::dimension; - const unsigned int spacedim = DoFHandlerType::space_dimension; // define functions that pack data on cells that are ghost cells // somewhere else, and unpack data on cells where we get information @@ -3723,13 +3676,18 @@ namespace internal complete = false; if (!complete) - const_cast(cell) + const_cast< + typename DoFHandler::active_cell_iterator &>( + cell) ->set_user_flag(); else - const_cast(cell) + const_cast< + typename DoFHandler::active_cell_iterator &>( + cell) ->clear_user_flag(); - const_cast(cell) + const_cast< + typename DoFHandler::active_cell_iterator &>(cell) ->set_dof_indices(dof_indices); }; @@ -3739,7 +3697,7 @@ namespace internal GridTools::exchange_cell_data_to_ghosts< std::vector, - DoFHandlerType>(dof_handler, pack, unpack, filter); + DoFHandler>(dof_handler, pack, unpack, filter); // finally update the cell DoF indices caches to make sure // our internal data structures are consistent @@ -3785,24 +3743,22 @@ namespace internal - template - ParallelDistributed::ParallelDistributed( - DoFHandlerType &dof_handler) + template + ParallelDistributed::ParallelDistributed( + DoFHandler &dof_handler) : dof_handler(&dof_handler) {} - template + template NumberCache - ParallelDistributed::distribute_dofs() const + ParallelDistributed::distribute_dofs() const { #ifndef DEAL_II_WITH_MPI Assert(false, ExcNotImplemented()); return NumberCache(); #else - const unsigned int dim = DoFHandlerType::dimension; - const unsigned int spacedim = DoFHandlerType::space_dimension; dealii::parallel::DistributedTriangulationBase *triangulation = @@ -4010,16 +3966,14 @@ namespace internal - template + template std::vector - ParallelDistributed::distribute_mg_dofs() const + ParallelDistributed::distribute_mg_dofs() const { #ifndef DEAL_II_WITH_MPI Assert(false, ExcNotImplemented()); return std::vector(); #else - const unsigned int dim = DoFHandlerType::dimension; - const unsigned int spacedim = DoFHandlerType::space_dimension; dealii::parallel::DistributedTriangulationBase *triangulation = @@ -4064,11 +4018,8 @@ namespace internal { std::vector local_dof_indices; - typename DoFHandlerType::level_cell_iterator - cell = dof_handler->begin(level), - endc = dof_handler->end(level); - - for (; cell != endc; ++cell) + for (const auto &cell : + dof_handler->cell_iterators_on_level(level)) if (cell->level_subdomain_id() != numbers::artificial_subdomain_id && (cell->level_subdomain_id() < @@ -4160,9 +4111,7 @@ namespace internal // mark all ghost cells for transfer { - typename DoFHandlerType::level_cell_iterator cell, - endc = dof_handler->end(); - for (cell = dof_handler->begin(); cell != endc; ++cell) + for (const auto &cell : dof_handler->cell_iterators()) if (cell->level_subdomain_id() != dealii::numbers::artificial_subdomain_id && !cell->is_locally_owned_on_level()) @@ -4197,9 +4146,7 @@ namespace internal # ifdef DEBUG // make sure we have removed all flags: { - typename DoFHandlerType::level_cell_iterator cell, - endc = dof_handler->end(); - for (cell = dof_handler->begin(); cell != endc; ++cell) + for (const auto &cell : dof_handler->cell_iterators()) if (cell->level_subdomain_id() != dealii::numbers::artificial_subdomain_id && !cell->is_locally_owned_on_level()) @@ -4216,10 +4163,7 @@ namespace internal // check that we are really done { std::vector local_dof_indices; - typename DoFHandlerType::level_cell_iterator cell, - endc = dof_handler->end(); - - for (cell = dof_handler->begin(); cell != endc; ++cell) + for (const auto &cell : dof_handler->cell_iterators()) if (cell->level_subdomain_id() != dealii::numbers::artificial_subdomain_id) { @@ -4242,9 +4186,9 @@ namespace internal } - template + template NumberCache - ParallelDistributed::renumber_dofs( + ParallelDistributed::renumber_dofs( const std::vector &new_numbers) const { (void)new_numbers; @@ -4256,8 +4200,6 @@ namespace internal Assert(false, ExcNotImplemented()); return NumberCache(); #else - const unsigned int dim = DoFHandlerType::dimension; - const unsigned int spacedim = DoFHandlerType::space_dimension; dealii::parallel::DistributedTriangulationBase *triangulation = @@ -4494,9 +4436,9 @@ namespace internal - template + template NumberCache - ParallelDistributed::renumber_mg_dofs( + ParallelDistributed::renumber_mg_dofs( const unsigned int level, const std::vector &new_numbers) const { @@ -4507,8 +4449,6 @@ namespace internal #ifdef DEAL_II_WITH_MPI - constexpr int dim = DoFHandlerType::dimension; - constexpr int spacedim = DoFHandlerType::space_dimension; const dealii::parallel::TriangulationBase *tr = (dynamic_cast *>(&this->dof_handler->get_triangulation())); diff --git a/source/dofs/dof_handler_policy.inst.in b/source/dofs/dof_handler_policy.inst.in index 9b72fc8f93..1611fe8ee3 100644 --- a/source/dofs/dof_handler_policy.inst.in +++ b/source/dofs/dof_handler_policy.inst.in @@ -25,14 +25,13 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) \{ template class PolicyBase; - template class Sequential< - dealii::DoFHandler>; + template class Sequential; - template class ParallelShared< - dealii::DoFHandler>; + template class ParallelShared; - template class ParallelDistributed< - dealii::DoFHandler>; + template class ParallelDistributed; \} \} \}