]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix smal bug in delete_cell<1>
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 18 May 1999 13:06:56 +0000 (13:06 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 18 May 1999 13:06:56 +0000 (13:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@1340 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/tria.cc

index 5a0acc63643ab825309a58f554c6ed931a216aa6..aea27aec7ed6270c22e3dbf8c91caf3da30070df 100644 (file)
@@ -6520,53 +6520,55 @@ void Triangulation<1>::delete_children (cell_iterator &cell) {
   
                                   // first do it for the cells to the
                                   // left
-  if (cell->neighbor(0)->has_children())
-    {
-      cell_iterator neighbor = cell->neighbor(0);
-      Assert (neighbor->level() == cell->level(), ExcInternalError());
-      
-                                      // right child
-      neighbor = neighbor->child(1);
-      while (1)
-       {
-         Assert (neighbor->neighbor(1) == cell->child(0),
-                 ExcInternalError());
-         neighbor->set_neighbor (1, cell);
-
-                                          // move on to further children
-                                          // on the boundary between this
-                                          // cell and its neighbor
-         if (neighbor->has_children())
-           neighbor = neighbor->child(1);
-         else
-           break;
-       };
-    };
+  if (cell->neighbor(0).state() == valid)
+    if (cell->neighbor(0)->has_children())
+      {
+       cell_iterator neighbor = cell->neighbor(0);
+       Assert (neighbor->level() == cell->level(), ExcInternalError());
+       
+                                        // right child
+       neighbor = neighbor->child(1);
+       while (1)
+         {
+           Assert (neighbor->neighbor(1) == cell->child(0),
+                   ExcInternalError());
+           neighbor->set_neighbor (1, cell);
+           
+                                            // move on to further children
+                                            // on the boundary between this
+                                            // cell and its neighbor
+           if (neighbor->has_children())
+             neighbor = neighbor->child(1);
+           else
+             break;
+         };
+      };
 
                                   // now do it for the cells to the
                                   // left
-  if (cell->neighbor(1)->has_children())
-    {
-      cell_iterator neighbor = cell->neighbor(1);
-      Assert (neighbor->level() == cell->level(), ExcInternalError());
-      
-                                      // left child
-      neighbor = neighbor->child(0);
-      while (1)
-       {
-         Assert (neighbor->neighbor(0) == cell->child(1),
-                 ExcInternalError());
-         neighbor->set_neighbor (0, cell);
-
-                                          // move on to further children
-                                          // on the boundary between this
-                                          // cell and its neighbor
-         if (neighbor->has_children())
-           neighbor = neighbor->child(0);
-         else
-           break;
-       };
-    };
+  if (cell->neighbor(1).state() == valid)
+    if (cell->neighbor(1)->has_children())
+      {
+       cell_iterator neighbor = cell->neighbor(1);
+       Assert (neighbor->level() == cell->level(), ExcInternalError());
+       
+                                        // left child
+       neighbor = neighbor->child(0);
+       while (1)
+         {
+           Assert (neighbor->neighbor(0) == cell->child(1),
+                   ExcInternalError());
+           neighbor->set_neighbor (0, cell);
+           
+                                            // move on to further children
+                                            // on the boundary between this
+                                            // cell and its neighbor
+           if (neighbor->has_children())
+             neighbor = neighbor->child(0);
+           else
+             break;
+         };
+      };
 
        
                                   // delete the vertex which will not be

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.