]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix computation of get_refinement_edge_boundary_indices
authorTimo Heister <timo.heister@gmail.com>
Sun, 4 Oct 2015 21:03:17 +0000 (17:03 -0400)
committerTimo Heister <timo.heister@gmail.com>
Sun, 4 Oct 2015 21:03:17 +0000 (17:03 -0400)
and update a test to check that it is correct

include/deal.II/multigrid/mg_constrained_dofs.h
tests/multigrid/constrained_dofs_01.cc

index 9b4129bc11f7ff06e7145a993e2a96387980ad62..982201a598323908aef4171aa7013fa326705366 100644 (file)
@@ -307,8 +307,10 @@ MGConstrainedDoFs::get_refinement_edge_boundary_indices () const
       for (unsigned int l=0; l<n_levels; ++l)
         {
           refinement_edge_boundary_indices_old[l].resize(refinement_edge_indices[l].size());
-          for (types::global_dof_index idx=0; idx<refinement_edge_indices[l].size(); ++idx)
-            refinement_edge_boundary_indices_old[l][idx] = this->is_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);
         }
     }
 
index 0fdbe3b8c7d89d572ec5db59e71928b52ca577e4..ea80f9143e3bd316621b3243ad72110c014e9c63 100644 (file)
@@ -140,6 +140,22 @@ void check_fe(FiniteElement<dim> &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<bool> ref = mg_constrained_dofs.get_refinement_edge_boundary_indices()[level];
+
+       unsigned int idx = 0;
+       for (std::vector<bool>::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);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.