From: Ralf Hartmann Date: Fri, 9 Dec 2005 08:36:17 +0000 (+0000) Subject: child_index function call only allowed for cells with children. X-Git-Tag: v8.0.0~12790 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e7ecf7533b65e8e5273122265fb3632ba989b21;p=dealii.git child_index function call only allowed for cells with children. git-svn-id: https://svn.dealii.org/trunk@11846 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/tria_accessor.h b/deal.II/deal.II/include/grid/tria_accessor.h index 5fb17917d7..11d9a7009f 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.h +++ b/deal.II/deal.II/include/grid/tria_accessor.h @@ -240,6 +240,10 @@ class TriaAccessor /** * @ingroup Exceptions */ + DeclException0 (ExcCellHasNoChildren); + /** + * @ingroup Exceptions + */ DeclException0 (ExcUnusedCellAsChild); /** * @ingroup Exceptions diff --git a/deal.II/deal.II/include/grid/tria_accessor.templates.h b/deal.II/deal.II/include/grid/tria_accessor.templates.h index 8d54a2a9fa..c27c9c1720 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.templates.h +++ b/deal.II/deal.II/include/grid/tria_accessor.templates.h @@ -207,6 +207,7 @@ int TriaObjectAccessor<1,dim>::child_index (unsigned const int i) const { Assert (i<2, ExcIndexRange(i,0,2)); + Assert (has_children(), typename TriaAccessor::ExcCellHasNoChildren()); return this->tria->levels[this->present_level]->lines.children[this->present_index]+i; } @@ -414,6 +415,7 @@ inline int TriaObjectAccessor<2,dim>::child_index (const unsigned int i) const { Assert (i<4, ExcIndexRange(i,0,4)); + Assert (has_children(), typename TriaAccessor::ExcCellHasNoChildren()); return this->tria->levels[this->present_level]->quads.children[this->present_index]+i; } @@ -705,6 +707,7 @@ inline int TriaObjectAccessor<3,dim>::child_index (const unsigned int i) const { Assert (i<8, ExcIndexRange(i,0,8)); + Assert (has_children(), typename TriaAccessor::ExcCellHasNoChildren()); return this->tria->levels[this->present_level]->hexes.children[this->present_index]+i; } diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index 5d5f7b13f0..96a93e2fcd 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -221,6 +221,15 @@ inconvenience this causes.

deal.II

    +
  1. + Improved: A new TriaAccessor::ExcCellHasNoChildren + exception will be raised if the TriaObjectAccessor::child_index function + is invoked for cells without children. +
    + (RH 2005/12/09) +

    +
  2. Fixed: We had a bug in DataOut::build_patches that, when used in multithreaded mode, caused an exception to be