DEAL_II_NAMESPACE_OPEN
+namespace internal
+{
+ namespace parallel
+ {
+ namespace distributed
+ {
+ namespace TriangulationImplementation
+ {
+ /**
+ * Communicate refinement flags on ghost cells from the owner of the
+ * cell.
+ *
+ * This is necessary to get consistent refinement, as mesh smoothing
+ * would undo some of the requested coarsening/refinement.
+ */
+ template <int dim, int spacedim>
+ void
+ exchange_refinement_flags(
+ dealii::parallel::distributed::Triangulation<dim, spacedim> &tria)
+ {
+ auto pack =
+ [](const typename Triangulation<dim, spacedim>::active_cell_iterator
+ &cell) -> std::uint8_t {
+ if (cell->refine_flag_set())
+ return 1;
+ if (cell->coarsen_flag_set())
+ return 2;
+ return 0;
+ };
+
+ auto unpack =
+ [](const typename Triangulation<dim, spacedim>::active_cell_iterator
+ &cell,
+ const std::uint8_t &flag) -> void {
+ cell->clear_coarsen_flag();
+ cell->clear_refine_flag();
+ if (flag == 1)
+ cell->set_refine_flag();
+ else if (flag == 2)
+ cell->set_coarsen_flag();
+ };
+
+ GridTools::exchange_cell_data_to_ghosts<std::uint8_t>(tria,
+ pack,
+ unpack);
+ }
+ } // namespace TriangulationImplementation
+ } // namespace distributed
+ } // namespace parallel
+} // namespace internal
+
+
+
#ifdef DEAL_II_WITH_P4EST
namespace
cell->set_subdomain_id(ghost_owner);
}
}
- template <int dim, int spacedim>
- void
- exchange_refinement_flags(Triangulation<dim, spacedim> &tria)
- {
- // Communicate refinement flags on ghost cells from the owner of the
- // cell. This is necessary to get consistent refinement, as mesh
- // smoothing would undo some of the requested coarsening/refinement.
-
- auto pack =
- [](
- const typename Triangulation<dim, spacedim>::active_cell_iterator &cell)
- -> std::uint8_t {
- if (cell->refine_flag_set())
- return 1;
- if (cell->coarsen_flag_set())
- return 2;
- return 0;
- };
- auto unpack =
- [](
- const typename Triangulation<dim, spacedim>::active_cell_iterator &cell,
- const std::uint8_t &flag) -> void {
- cell->clear_coarsen_flag();
- cell->clear_refine_flag();
- if (flag == 1)
- cell->set_refine_flag();
- else if (flag == 2)
- cell->set_coarsen_flag();
- };
-
- GridTools::exchange_cell_data_to_ghosts<std::uint8_t,
- Triangulation<dim, spacedim>>(
- tria, pack, unpack);
- }
# ifdef P4EST_SEARCH_LOCAL
template <int dim>
// First exchange coarsen/refinement flags on ghost cells. After this
// collective communication call all flags on ghost cells match the
// flags set by the user on the owning rank.
- exchange_refinement_flags(*this);
+ dealii::internal::parallel::distributed::TriangulationImplementation::
+ exchange_refinement_flags(*this);
// Now we can call the sequential version to apply mesh smoothing and
// other modifications: