From 633b3585bc0634b0a30c5836d6cec1ff55b34b99 Mon Sep 17 00:00:00 2001 From: kronbichler Date: Sun, 19 Jan 2014 22:06:41 +0000 Subject: [PATCH] Try to fix some tests by adding more elements to sparsity pattern over processor boundaries git-svn-id: https://svn.dealii.org/trunk@32258 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/dofs/dof_tools_sparsity.cc | 12 +++++++++--- deal.II/source/multigrid/mg_tools.cc | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/deal.II/source/dofs/dof_tools_sparsity.cc b/deal.II/source/dofs/dof_tools_sparsity.cc index 917e6d000a..bc26fd13cd 100644 --- a/deal.II/source/dofs/dof_tools_sparsity.cc +++ b/deal.II/source/dofs/dof_tools_sparsity.cc @@ -584,6 +584,12 @@ namespace DoFTools constraints.add_entries_local_to_global (dofs_on_other_cell, dofs_on_this_cell, sparsity, keep_constrained_dofs); + // only need to add this when the neighbor is not + // owned by the current processor, otherwise we add + // the entries for the neighbor there + if (sub_neighbor->subdomain_id() != cell->subdomain_id()) + constraints.add_entries_local_to_global + (dofs_on_other_cell, sparsity, keep_constrained_dofs); } } else @@ -619,10 +625,10 @@ namespace DoFTools constraints.add_entries_local_to_global (dofs_on_other_cell, dofs_on_this_cell, sparsity, keep_constrained_dofs); - if (cell->neighbor(face)->active()) + if (cell->neighbor(face)->subdomain_id() != + cell->subdomain_id()) constraints.add_entries_local_to_global - (dofs_on_other_cell, dofs_on_other_cell, - sparsity, keep_constrained_dofs); + (dofs_on_other_cell, sparsity, keep_constrained_dofs); } } } diff --git a/deal.II/source/multigrid/mg_tools.cc b/deal.II/source/multigrid/mg_tools.cc index 65c253e033..62589b793f 100644 --- a/deal.II/source/multigrid/mg_tools.cc +++ b/deal.II/source/multigrid/mg_tools.cc @@ -611,9 +611,9 @@ namespace MGTools typename DoFHandler::cell_iterator neighbor = cell->neighbor(face); neighbor->get_mg_dof_indices (dofs_on_other_cell); - // only add one direction - // The other is taken care of - // by neighbor. + // only add one direction The other is taken care of by + // neighbor (except when the neighbor is not owned by the same + // processor) for (unsigned int i=0; iis_locally_owned_on_level() == false) + for (unsigned int i=0; i