]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Check in an assert that breaks the program sometimes. Something is
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 29 Nov 2001 14:08:43 +0000 (14:08 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 29 Nov 2001 14:08:43 +0000 (14:08 +0000)
wrong here.

git-svn-id: https://svn.dealii.org/trunk@5308 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/grid_reordering.cc

index 646d67b77ef790fb1109a8f027841ed860245ed6..499acaf2358b8ffc11ecff4fc75fd039a0aa0610 100644 (file)
@@ -1168,7 +1168,8 @@ GridReordering<dim>::presort_cells (typename std::vector<Cell>       &cells,
       unique_copy (new_next_round_cells.begin(), new_next_round_cells.end(),
                   back_inserter(next_round_cells));
     };
-  Assert (std::find (new_cell_numbers.begin(), new_cell_numbers.end(), invalid_cell_number)
+  Assert (std::find (new_cell_numbers.begin(), new_cell_numbers.end(),
+                    invalid_cell_number)
          ==
          new_cell_numbers.end(),
          ExcInternalError());
@@ -1190,7 +1191,11 @@ GridReordering<dim>::presort_cells (typename std::vector<Cell>       &cells,
       Assert (cells[c].cell_no == c, ExcInternalError());
 
       for (unsigned int n=0; n<GeometryInfo<dim>::faces_per_cell; ++n)
-       cells[c].neighbors[n] = new_cell_numbers[cells[c].neighbors[n]];
+       {
+         Assert (cells[c].neighbors[n] < new_cell_numbers.size(),
+                 ExcInternalError());
+         cells[c].neighbors[n] = new_cell_numbers[cells[c].neighbors[n]];
+       };
     };
 
   for (typename std::map<Face,FaceData>::iterator i=faces.begin(); i!=faces.end(); ++i)

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.