]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix bug in hp::DoFHandler and copy_triangulation(), this fixes tests/hp/copy_tria_bug.cc
authorTimo Heister <timo.heister@gmail.com>
Wed, 4 Sep 2013 19:33:03 +0000 (19:33 +0000)
committerTimo Heister <timo.heister@gmail.com>
Wed, 4 Sep 2013 19:33:03 +0000 (19:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@30600 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/dofs/dof_handler_policy.cc
deal.II/source/hp/dof_handler.cc

index 496a9e16f41430c6394432d2d8912854d72525d6..c3beb577e787378a782035ef5c23a889b69669c1 100644 (file)
@@ -1888,15 +1888,15 @@ namespace internal
 
 
 #ifdef DEBUG
-          {
+          {MPI_Barrier(tr->get_communicator());
             //check all msgs got sent and received
             unsigned int sum_send=0;
             unsigned int sum_recv=0;
             unsigned int sent=needs_to_get_cells.size();
             unsigned int recv=senders.size();
 
-            MPI_Reduce(&sent, &sum_send, 1, MPI_UNSIGNED, MPI_SUM, 0, tr->get_communicator());
-            MPI_Reduce(&recv, &sum_recv, 1, MPI_UNSIGNED, MPI_SUM, 0, tr->get_communicator());
+            MPI_Reduce(&sent, &sum_send, 1, MPI_UNSIGNED, MPI_SUM, 56345, tr->get_communicator());
+            MPI_Reduce(&recv, &sum_recv, 1, MPI_UNSIGNED, MPI_SUM, 56346, tr->get_communicator());
             Assert(sum_send==sum_recv, ExcInternalError());
           }
 #endif
index 5786455648f4a1609ad73ba23e315fa075ca4e01..8e2bc5d9768d72cb5efdd3297b818cfbad5f05fa 100644 (file)
@@ -3161,11 +3161,9 @@ namespace hp
   {
     Assert (has_children.size () == levels.size (), ExcInternalError ());
 
-    // In each refinement at most one new
-    // new level may appear. If that happened
-    // it is appended to the DoFHandler
-    // levels.
-    if (levels.size () < tria->n_levels ())
+    // Normally only one level is added, but if this Triangulation
+    // is created by copy_triangulation, it can be more than one level.
+    while (levels.size () < tria->n_levels ())
       levels.push_back (new dealii::internal::hp::DoFLevel<dim>);
 
     // Coarsening can lead to the loss
@@ -3176,6 +3174,8 @@ namespace hp
         levels.pop_back ();
       }
 
+    Assert(levels.size () == tria->n_levels (), ExcInternalError());
+
     // Resize active_fe_indices
     // vectors. use zero indicator to
     // extend

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.