From: wolf Date: Fri, 8 Apr 2005 21:11:55 +0000 (+0000) Subject: Treat a tricky corner case. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=019c5526e95c22f285cfc9991f34ad9a2db7a58d;p=dealii-svn.git Treat a tricky corner case. git-svn-id: https://svn.dealii.org/trunk@10450 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/dofs/dof_constraints.templates.h b/deal.II/deal.II/include/dofs/dof_constraints.templates.h index d62a684319..71ff690cfd 100644 --- a/deal.II/deal.II/include/dofs/dof_constraints.templates.h +++ b/deal.II/deal.II/include/dofs/dof_constraints.templates.h @@ -612,13 +612,48 @@ distribute_local_to_global (const Vector &local_vector, // distribute it, but make // sure we don't touch the // entries of fixed dofs + // + // there is one critical + // point: sometimes a dof + // may be both constrained + // and fixed, for example + // hanging nodes in 3d at + // the boundary. in that + // case, we don't quite + // know what to do -- + // handle the constraint or + // the fixed + // value. however, this + // isn't so hard if all the + // nodes that this node is + // constrained to are also + // fixed nodes, in which + // case we could do both + // but opt to copy the + // element. however, we + // have to check that all + // the nodes to which it is + // constrained are also + // fixed if (position->line != local_dof_indices[i]) global_vector(local_dof_indices[i]) += local_vector(i); else - for (unsigned int j=0; jentries.size(); ++j) - if (!is_fixed(fixed_dofs, position->entries[j].first)) - global_vector(position->entries[j].first) - += local_vector(i) * position->entries[j].second; + { + if (!is_fixed(fixed_dofs, local_dof_indices[i])) + { + for (unsigned int j=0; jentries.size(); ++j) + if (!is_fixed(fixed_dofs, position->entries[j].first)) + global_vector(position->entries[j].first) + += local_vector(i) * position->entries[j].second; + } + else + { + global_vector(local_dof_indices[i]) += local_vector(i); + for (unsigned int j=0; jentries.size(); ++j) + Assert (is_fixed(fixed_dofs, position->entries[j].first), + ExcInternalError()); + } + } } } }