From: Wolfgang Bangerth Date: Thu, 10 Aug 2017 18:47:10 +0000 (-0600) Subject: Be careful for which cells and objects we enumerate DoFs. X-Git-Tag: v9.0.0-rc1~1299^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=243470c3227739bc04f4192a917aff25c1fa7001;p=dealii.git Be careful for which cells and objects we enumerate DoFs. --- diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index a5e5d20460..eb4fa1f43a 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -1126,20 +1126,22 @@ namespace internal Assert (dof_handler.get_triangulation().n_levels() > 0, ExcMessage("Empty triangulation")); - // Step 1: distribute dofs on all cells + // Step 1: distribute dofs on all cells, but definitely + // exclude artificial cells types::global_dof_index next_free_dof = 0; typename DoFHandlerType::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); for (; cell != endc; ++cell) - if ((subdomain_id == numbers::invalid_subdomain_id) - || - (cell->subdomain_id() == subdomain_id)) - next_free_dof - = Implementation::distribute_dofs_on_cell (dof_handler, - cell, - next_free_dof); + if (! cell->is_artificial()) + if ((subdomain_id == numbers::invalid_subdomain_id) + || + (cell->subdomain_id() == subdomain_id)) + next_free_dof + = Implementation::distribute_dofs_on_cell (dof_handler, + cell, + next_free_dof); // Step 2: unify dof indices in case this is an hp DoFHandler next_free_dof = unify_dof_indices (dof_handler, next_free_dof);