From 551f9407b001a409f167de845b8ebf3b8ad5fdba Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 8 Jan 2009 20:09:53 +0000 Subject: [PATCH] Avoid accessing elements beyond the end of a tensor. Use the opportunity to add an assertion. git-svn-id: https://svn.dealii.org/trunk@18141 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/grid/grid_generator.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deal.II/deal.II/source/grid/grid_generator.cc b/deal.II/deal.II/source/grid/grid_generator.cc index 5c7a0dbf6d..a3fd18767f 100644 --- a/deal.II/deal.II/source/grid/grid_generator.cc +++ b/deal.II/deal.II/source/grid/grid_generator.cc @@ -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. -- 2.39.5