From 7f58f8b4f06b2ed481c5067a36b9183ee61848f4 Mon Sep 17 00:00:00 2001 From: heister Date: Fri, 24 May 2013 16:11:47 +0000 Subject: [PATCH] ignore non local cells in mg* git-svn-id: https://svn.dealii.org/trunk@29574 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/multigrid/mg_tools.cc | 11 +++++++++++ deal.II/source/multigrid/mg_transfer_prebuilt.cc | 7 +++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/deal.II/source/multigrid/mg_tools.cc b/deal.II/source/multigrid/mg_tools.cc index 1fe5ef922d..0ec23e20e7 100644 --- a/deal.II/source/multigrid/mg_tools.cc +++ b/deal.II/source/multigrid/mg_tools.cc @@ -1201,6 +1201,8 @@ namespace MGTools endc = dof.end(); for (; cell!=endc; ++cell) { + if (cell->level_subdomain_id()!=dof.get_tria().locally_owned_subdomain()) + continue; const FiniteElement &fe = cell->get_fe(); const unsigned int level = cell->level(); local_dofs.resize(fe.dofs_per_face); @@ -1430,6 +1432,9 @@ namespace MGTools for (; cell!=endc; ++cell) { + if (cell->level_subdomain_id()!=mg_dof_handler.get_tria().locally_owned_subdomain()) + continue; + std::fill (cell_dofs.begin(), cell_dofs.end(), false); for (unsigned int face_nr=0; face_nr::faces_per_cell; ++face_nr) @@ -1484,6 +1489,9 @@ namespace MGTools for (; cell!=endc; ++cell) { + if (cell->level_subdomain_id()!=mg_dof_handler.get_tria().locally_owned_subdomain()) + continue; + std::fill (cell_dofs.begin(), cell_dofs.end(), false); std::fill (cell_dofs_interface.begin(), cell_dofs_interface.end(), false); @@ -1571,6 +1579,9 @@ namespace MGTools for (; cell!=endc; ++cell) { + if (cell->level_subdomain_id()!=mg_dof_handler.get_tria().locally_owned_subdomain()) + continue; + bool has_coarser_neighbor = false; std::fill (cell_dofs.begin(), cell_dofs.end(), false); diff --git a/deal.II/source/multigrid/mg_transfer_prebuilt.cc b/deal.II/source/multigrid/mg_transfer_prebuilt.cc index 933db2ba1b..de6e664ef8 100644 --- a/deal.II/source/multigrid/mg_transfer_prebuilt.cc +++ b/deal.II/source/multigrid/mg_transfer_prebuilt.cc @@ -142,7 +142,7 @@ void MGTransferPrebuilt::build_matrices ( std::vector entries (dofs_per_cell); for (typename DoFHandler::cell_iterator cell=mg_dof.begin(level); cell != mg_dof.end(level); ++cell) - if (cell->has_children()) + if (cell->has_children() && cell->level_subdomain_id()==mg_dof.get_tria().locally_owned_subdomain()) { cell->get_mg_dof_indices (dof_indices_parent); @@ -183,7 +183,7 @@ void MGTransferPrebuilt::build_matrices ( // now actually build the matrices for (typename DoFHandler::cell_iterator cell=mg_dof.begin(level); cell != mg_dof.end(level); ++cell) - if (cell->has_children()) + if (cell->has_children() && cell->level_subdomain_id()==mg_dof.get_tria().locally_owned_subdomain()) { cell->get_mg_dof_indices (dof_indices_parent); @@ -283,6 +283,9 @@ void MGTransferPrebuilt::build_matrices ( // by restricting from fine level. for (; level_cell!=level_end; ++level_cell) { + if (level_cell->level_subdomain_id()!=mg_dof.get_tria().locally_owned_subdomain()) + continue; + // get the dof numbers of // this cell for the global // and the level-wise -- 2.39.5