]> https://gitweb.dealii.org/ - dealii.git/commitdiff
child_index function call only allowed for cells with children.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Fri, 9 Dec 2005 08:36:17 +0000 (08:36 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Fri, 9 Dec 2005 08:36:17 +0000 (08:36 +0000)
git-svn-id: https://svn.dealii.org/trunk@11846 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria_accessor.h
deal.II/deal.II/include/grid/tria_accessor.templates.h
deal.II/doc/news/changes.html

index 5fb17917d773e56198a677f7a612e23c3c29d9b3..11d9a7009f26330ab631287e0283c662f600a53a 100644 (file)
@@ -240,6 +240,10 @@ class TriaAccessor
                                     /**
                                      * @ingroup Exceptions
                                      */
+    DeclException0 (ExcCellHasNoChildren);
+                                    /**
+                                     * @ingroup Exceptions
+                                     */
     DeclException0 (ExcUnusedCellAsChild);
                                     /**
                                      * @ingroup Exceptions
index 8d54a2a9fafbbf8097502389852d718b371d52c4..c27c9c1720cf95642bfe645cda1187837c530841 100644 (file)
@@ -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<dim>::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<dim>::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<dim>::ExcCellHasNoChildren());
   return this->tria->levels[this->present_level]->hexes.children[this->present_index]+i;
 }
 
index 5d5f7b13f0dd55176fd78434fbe79ebd0fddea93..96a93e2fcd6baee5ece441684ccc50e5c9e99892 100644 (file)
@@ -221,6 +221,15 @@ inconvenience this causes.
 <h3>deal.II</h3>
 
 <ol>
+  <li> <p>
+       Improved: A new <code>TriaAccessor::ExcCellHasNoChildren</code>
+       exception will be raised if the <code
+       class="member">TriaObjectAccessor::child_index</code> function
+       is invoked for cells without children.
+       <br> 
+       (RH 2005/12/09)
+       </p>
+
   <li> <p>
        Fixed: We had a bug in <code class="member">DataOut::build_patches</code>
        that, when used in multithreaded mode, caused an exception to be

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.