From 8c78b3bedacca12f70cb28c6a66a283f202d89ac Mon Sep 17 00:00:00 2001 From: heister Date: Tue, 29 May 2012 21:54:54 +0000 Subject: [PATCH] fix bug in GridTools::find_cells_adjacent_to_vertex() (workaround) git-svn-id: https://svn.dealii.org/trunk@25562 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 5 +++++ deal.II/source/grid/grid_tools.cc | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index bb67db78af..ac33954c44 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -207,6 +207,11 @@ enabled due to a missing include file in file

Specific improvements

    +
  1. Fixed: Bug in 3d with hanging nodes in GridTools::find_cells_adjacent_to_vertex() +that caused find_active_cell_around_point() to fail in those cases. +
    +(Timo Heister, 2012/05/29) +
  2. New: The GridIn::read_unv function can now read meshes generated by the Salome framework, see http://www.salome-platform.org/ .
    diff --git a/deal.II/source/grid/grid_tools.cc b/deal.II/source/grid/grid_tools.cc index 2806bc9613..d107d2e9c5 100644 --- a/deal.II/source/grid/grid_tools.cc +++ b/deal.II/source/grid/grid_tools.cc @@ -741,7 +741,35 @@ namespace GridTools break; } if (!found) + { + //TODO: it is not + //enough to walk + //over faces to + //the neighbors + //because the + //point may lie + //in a cell that + //only shares an + //edge with cell + //in 3d. Current + //workaround: add + //all neighbors + //of all + //neighbors if + //this vertex is + //a hanging node + //in 3d. [TH] adj_cells_set.insert(nb); + if (dim==3) + { + for (unsigned faceindex = 0; faceindex < GeometryInfo::faces_per_cell; faceindex++) + { + if (!nb->at_boundary(faceindex) && nb->neighbor(faceindex)->active()) + adj_cells_set.insert(nb->neighbor(faceindex)); + } + } + } + } } } -- 2.39.5