]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fix bug in GridTools::find_cells_adjacent_to_vertex() (workaround)
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 29 May 2012 21:54:54 +0000 (21:54 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 29 May 2012 21:54:54 +0000 (21:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@25562 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/source/grid/grid_tools.cc

index bb67db78afd594952c83ccf8f69c79d42170e1d6..ac33954c444b5898ee346c6f4e2714d4e9b40179 100644 (file)
@@ -207,6 +207,11 @@ enabled due to a missing include file in file
 <h3>Specific improvements</h3>
 
 <ol>
+<li> 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.
+<br>
+(Timo Heister, 2012/05/29)
+
 <li> New: The GridIn::read_unv function can now read meshes generated
 by the Salome framework, see http://www.salome-platform.org/ .
 <br>
index 2806bc96137962f1c5db2f5bfa5b1163adabbb9e..d107d2e9c5a0c986f56bdf4f1a5a02b4e42152da 100644 (file)
@@ -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<dim>::faces_per_cell; faceindex++)
+                               {
+                                 if (!nb->at_boundary(faceindex) && nb->neighbor(faceindex)->active())
+                                   adj_cells_set.insert(nb->neighbor(faceindex));
+                               }
+                           }
+                         }
+                       
                       }
                   }
               }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.