From c6c05ad77ff6cb9c2f247afc6dffa1e08ca707b6 Mon Sep 17 00:00:00 2001 From: heister Date: Wed, 4 Sep 2013 19:33:03 +0000 Subject: [PATCH] fix bug in hp::DoFHandler and copy_triangulation(), this fixes tests/hp/copy_tria_bug.cc git-svn-id: https://svn.dealii.org/trunk@30600 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/dofs/dof_handler_policy.cc | 6 +++--- deal.II/source/hp/dof_handler.cc | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/deal.II/source/dofs/dof_handler_policy.cc b/deal.II/source/dofs/dof_handler_policy.cc index 496a9e16f4..c3beb577e7 100644 --- a/deal.II/source/dofs/dof_handler_policy.cc +++ b/deal.II/source/dofs/dof_handler_policy.cc @@ -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 diff --git a/deal.II/source/hp/dof_handler.cc b/deal.II/source/hp/dof_handler.cc index 5786455648..8e2bc5d976 100644 --- a/deal.II/source/hp/dof_handler.cc +++ b/deal.II/source/hp/dof_handler.cc @@ -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); // 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 -- 2.39.5