From: Bruno Turcksin Date: Wed, 30 Sep 2015 21:09:23 +0000 (-0500) Subject: Fix a bug in 3D. X-Git-Tag: v8.4.0-rc2~354^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b65007e7a9ebe8c86f2bfe7a930e23e43b3ad972;p=dealii.git Fix a bug in 3D. --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 9756b80b16..71f0dadbeb 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -1609,16 +1609,29 @@ next_cell: // Take care of hanging nodes cell = triangulation.begin_active(); for (; cell!=endc; ++cell) - for (unsigned int i=0; i::faces_per_cell; ++i) - { - if ((cell->at_boundary(i)==false) && (cell->neighbor_level(i)level())) - { - typename Triangulation::active_cell_iterator adjacent_cell = - cell->neighbor(i); - for (unsigned int j=0; j::vertices_per_face; ++j) - vertex_to_cell_map[cell->face(i)->vertex_index(j)].insert(adjacent_cell); - } - } + { + for (unsigned int i=0; i::faces_per_cell; ++i) + { + if ((cell->at_boundary(i)==false) && (cell->neighbor(i)->active())) + { + typename Triangulation::active_cell_iterator adjacent_cell = + cell->neighbor(i); + for (unsigned int j=0; j::vertices_per_face; ++j) + vertex_to_cell_map[cell->face(i)->vertex_index(j)].insert(adjacent_cell); + } + } + + // in 3d also loop over the edges + if (dim==3) + { + for (unsigned int i=0; i::lines_per_cell; ++i) + if (cell->line(i)->has_children()) + // the only place where this vertex could have been + // hiding is on the mid-edge point of the edge we + // are looking at + vertex_to_cell_map[cell->line(i)->child(0)->vertex_index(1)].insert(cell); + } + } return vertex_to_cell_map; }