From a00dd5d9f22706c5e5fb3d2d689cfb7d598ee97e Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Sat, 20 Mar 2021 15:33:16 -0600 Subject: [PATCH] Copy triangulation in MGTransferGlobalCoarsening. --- .../mg_transfer_global_coarsening.templates.h | 45 +------------------ 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h index 9baebafd6e..35113b1462 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -1914,30 +1914,6 @@ namespace MGTransferGlobalCoarseningTools } - namespace internal - { - template - void - load_forest(const parallel::distributed::Triangulation &in, - parallel::distributed::Triangulation & out) - { -#ifndef DEAL_II_WITH_P4EST - (void)in; - (void)out; -#else - out.load(in.get_p4est()); -#endif - } - - template - void - load_forest(const parallel::distributed::Triangulation<1, spacedim> &in, - parallel::distributed::Triangulation<1, spacedim> & out) - { - (void)in; - (void)out; - } - } // namespace internal template std::vector>> @@ -1967,33 +1943,16 @@ namespace MGTransferGlobalCoarseningTools const unsigned int max_level = fine_triangulation->n_global_levels() - 1; - const auto coarse_mesh_description = - GridTools::get_coarse_mesh_description(*fine_triangulation); - // create coarse meshes for (unsigned int l = max_level; l > 0; --l) { - // create empty triangulation + // copy triangulation auto new_tria = std::make_shared>( fine_triangulation->get_communicator(), fine_triangulation->get_mesh_smoothing()); - // create coarse grid - new_tria->create_triangulation(std::get<0>(coarse_mesh_description), - std::get<1>(coarse_mesh_description), - std::get<2>(coarse_mesh_description)); - - for (const auto i : fine_triangulation->get_manifold_ids()) - if (i != numbers::flat_manifold_id) - new_tria->set_manifold(i, fine_triangulation->get_manifold(i)); - - // create refinement hierarchy (by loading stored mesh) - internal::load_forest( - *dynamic_cast< - const parallel::distributed::Triangulation *>( - coarse_grid_triangulations[l].get()), - *new_tria); + new_tria->copy_triangulation(*coarse_grid_triangulations[l]); // coarsen mesh new_tria->coarsen_global(); -- 2.39.5