From: Timo Heister Date: Sun, 4 Oct 2015 21:03:17 +0000 (-0400) Subject: fix computation of get_refinement_edge_boundary_indices X-Git-Tag: v8.4.0-rc2~277^2~20 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6696bf277715cd3ccce78ed910b382501b29c0bb;p=dealii.git fix computation of get_refinement_edge_boundary_indices and update a test to check that it is correct --- diff --git a/include/deal.II/multigrid/mg_constrained_dofs.h b/include/deal.II/multigrid/mg_constrained_dofs.h index 9b4129bc11..982201a598 100644 --- a/include/deal.II/multigrid/mg_constrained_dofs.h +++ b/include/deal.II/multigrid/mg_constrained_dofs.h @@ -307,8 +307,10 @@ MGConstrainedDoFs::get_refinement_edge_boundary_indices () const for (unsigned int l=0; lis_boundary_index(l, idx); + for (IndexSet::ElementIterator it = refinement_edge_indices[l].begin(); + it != refinement_edge_indices[l].end(); + ++it) + refinement_edge_boundary_indices_old[l][*it] = this->is_boundary_index(l, *it); } } diff --git a/tests/multigrid/constrained_dofs_01.cc b/tests/multigrid/constrained_dofs_01.cc index 0fdbe3b8c7..ea80f9143e 100644 --- a/tests/multigrid/constrained_dofs_01.cc +++ b/tests/multigrid/constrained_dofs_01.cc @@ -140,6 +140,22 @@ void check_fe(FiniteElement &fe) deallog << "get_boundary_indices:" << std::endl; bi.print(deallog); + { + // check that refinement_edge_boundary_indices (deprecated) is really + // the intersection of the sets above: + IndexSet intersect = rei & bi; + std::vector ref = mg_constrained_dofs.get_refinement_edge_boundary_indices()[level]; + + unsigned int idx = 0; + for (std::vector::iterator it = ref.begin(); it != ref.end(); ++it, ++idx) + { + if ((*it == true) != intersect.is_element(idx)) + deallog << "mismatch idx=" << idx << " " + << (*it == true) << " " << intersect.is_element(idx) << std::endl; + } + } + + IndexSet relevant; DoFTools::extract_locally_relevant_mg_dofs (dofh, relevant, level);