From b65007e7a9ebe8c86f2bfe7a930e23e43b3ad972 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Wed, 30 Sep 2015 16:09:23 -0500 Subject: [PATCH] Fix a bug in 3D. --- source/grid/grid_tools.cc | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) 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; } -- 2.39.5