From fc3bb6491329e031ff4a9cc4f0d680f69e814e4d Mon Sep 17 00:00:00 2001 From: heister Date: Sat, 23 Nov 2013 22:06:02 +0000 Subject: [PATCH] fix bug in make_hanging_node_constraints in parallel with elements like RaviartThomas git-svn-id: https://svn.dealii.org/trunk@31779 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 7 ++++++ deal.II/source/dofs/dof_tools_constraints.cc | 24 +++++++++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 83b3ab3d4b..af4c024ec6 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -212,6 +212,13 @@ inconvenience this causes.

Specific improvements

    +
  1. Fixed: make_hanging_node_constraints failed with an exception in a + parallel::distributed computation if the element is + RaviartThomas (and probably others). +
    + (Timo Heister, 2013/11/23) +
  2. +
  3. Improved: CMake: Added a configuration check for incompatible ninja + icc setup, fixed several setup and performance issues with the testsuite diff --git a/deal.II/source/dofs/dof_tools_constraints.cc b/deal.II/source/dofs/dof_tools_constraints.cc index 25c01c21cf..2f32ccfacf 100644 --- a/deal.II/source/dofs/dof_tools_constraints.cc +++ b/deal.II/source/dofs/dof_tools_constraints.cc @@ -809,7 +809,10 @@ namespace DoFTools n_dofs_on_children = fe.dofs_per_vertex + 2*fe.dofs_per_line; dofs_on_mother.resize (n_dofs_on_mother); - dofs_on_children.resize (n_dofs_on_children); + // we might not use all of those in case of artificial cells, + // so do not resize(), but reserve() and use push_back later. + dofs_on_children.clear(); + dofs_on_children.reserve (n_dofs_on_children); Assert(n_dofs_on_mother == fe.constraints().n(), ExcDimensionMismatch(n_dofs_on_mother, @@ -831,15 +834,20 @@ namespace DoFTools dofs_on_mother[next_index++] = this_face->dof_index(dof, fe_index); AssertDimension (next_index, dofs_on_mother.size()); - next_index = 0; for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof) - dofs_on_children[next_index++] - = this_face->child(0)->vertex_dof_index(1,dof,fe_index); + dofs_on_children.push_back( + this_face->child(0)->vertex_dof_index(1,dof,fe_index)); for (unsigned int child=0; child<2; ++child) - for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof) - dofs_on_children[next_index++] - = this_face->child(child)->dof_index(dof, fe_index); - AssertDimension (next_index, dofs_on_children.size()); + { + // skip artificial cells + if (cell->neighbor_child_on_subface (face, child)->is_artificial()) + continue; + for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof) + dofs_on_children.push_back( + this_face->child(child)->dof_index(dof, fe_index)); + } + // note: can get fewer DoFs when we have artificial cells + Assert(dofs_on_children.size() <= n_dofs_on_children, ExcInternalError()); // for each row in the constraint matrix for this line: for (unsigned int row=0; row!=dofs_on_children.size(); ++row) -- 2.39.5