From f7dc9ca868b38d3a60fdec3a5e6413fc60f7cb85 Mon Sep 17 00:00:00 2001 From: wolf Date: Tue, 8 Dec 1998 16:58:45 +0000 Subject: [PATCH] Fix a stupid bug in the renumbering code. This seems to have not been tested for a long long time, att least since the changes were made which allowed for coarsening of grids. git-svn-id: https://svn.dealii.org/trunk@685 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/dofs/dof_handler.cc | 32 +++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/deal.II/deal.II/source/dofs/dof_handler.cc b/deal.II/deal.II/source/dofs/dof_handler.cc index fa5a5a71be..8ca1817549 100644 --- a/deal.II/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/deal.II/source/dofs/dof_handler.cc @@ -1215,12 +1215,18 @@ void DoFHandler<1>::do_renumbering (const vector &new_numbers) { // renumber the dofs on the interface of // two cells more than once. Anyway, this // way it's not only more correct but also - // faster + // faster; note, however, that dof numbers + // may be -1, namely when the appropriate + // vertex/line/etc is unused for (vector::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i) - { - Assert (*i != -1, ExcInternalError()); + if (*i != -1) *i = new_numbers[*i]; - }; + else + // if index is -1: check if this one + // really is unused + Assert (tria->vertices_used[(i-vertex_dofs.begin()) / + selected_fe->dofs_per_vertex] == false, + ExcInternalError ()); for (unsigned int level=0; level::iterator i=levels[level]->line_dofs.begin(); @@ -1238,11 +1244,23 @@ template <> void DoFHandler<2>::do_renumbering (const vector &new_numbers) { Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete()); + // note that we can not use cell iterators + // in this function since then we would + // renumber the dofs on the interface of + // two cells more than once. Anyway, this + // way it's not only more correct but also + // faster; note, however, that dof numbers + // may be -1, namely when the appropriate + // vertex/line/etc is unused for (vector::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i) - { - Assert (*i != -1, ExcInternalError()); + if (*i != -1) *i = new_numbers[*i]; - }; + else + // if index is -1: check if this one + // really is unused + Assert (tria->vertices_used[(i-vertex_dofs.begin()) / + selected_fe->dofs_per_vertex] == false, + ExcInternalError ()); for (unsigned int level=0; level