]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid accessing elements beyond the end of a tensor. Use the opportunity to add an...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 8 Jan 2009 20:09:53 +0000 (20:09 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 8 Jan 2009 20:09:53 +0000 (20:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@18141 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/grid_generator.cc

index 5c7a0dbf6dab2efd3077c0db15054250cefc75a5..a3fd18767fc956d923e61a8a96e1410b26ca62c3 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -533,7 +533,9 @@ GridGenerator::subdivided_hyper_rectangle (
                                       // compare numbers to avoid
                                       // roundoff problems.
       const double epsilon
-        = 0.01 * *std::min_element (&delta[0], &delta[dim]);
+        = 0.01 * *std::min_element (&delta[0], &delta[0]+dim);
+      Assert (epsilon > 0,
+             ExcMessage ("The distance between corner points must be positive."))
     
                                        // actual code is external since
                                        // 1-D is different from 2/3D.

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.