]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Safety update in initialize: the loops terminated more or less by chance, the only...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 28 Feb 1999 19:29:00 +0000 (19:29 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 28 Feb 1999 19:29:00 +0000 (19:29 +0000)
git-svn-id: https://svn.dealii.org/trunk@928 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_system.cc

index 4415ea60f76c05d60e046cb255d09dcd3ad6a0a4..5aa717b8e4ca4216dca5b8dbb95850237cd47ffc 100644 (file)
@@ -60,7 +60,8 @@ void FESystem<dim>::initialize ()
     }
   
                                   // 2. Lines
-  for (unsigned line_number= 0 ; line_number < GeometryInfo<dim>::lines_per_cell ;
+  for (unsigned line_number= 0 ; ((line_number < GeometryInfo<dim>::lines_per_cell) &&
+                                 (GeometryInfo<dim>::lines_per_cell > 0));
        ++line_number)
     {
       unsigned comp_start = 0;
@@ -85,7 +86,8 @@ void FESystem<dim>::initialize ()
     }
   
                                   // 3. Quads
-  for (unsigned quad_number= 0 ; quad_number < GeometryInfo<dim>::quads_per_cell ;
+  for (unsigned quad_number= 0 ; ((quad_number < GeometryInfo<dim>::quads_per_cell) &&
+                                 (GeometryInfo<dim>::quads_per_cell > 0));
        ++quad_number)
     {
       unsigned comp_start = 0;
@@ -110,7 +112,8 @@ void FESystem<dim>::initialize ()
     }
   
                                   // 4. Hex
-  for (unsigned hex_number= 0 ; hex_number < GeometryInfo<dim>::hexes_per_cell ;
+  for (unsigned hex_number= 0 ; ((hex_number < GeometryInfo<dim>::hexes_per_cell) &&
+                                (GeometryInfo<dim>::hexes_per_cell > 0));
        ++hex_number)
     {
       unsigned comp_start = 0;

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.