From 27584ba9888b67f0430864b29c47a3fd2f751ae4 Mon Sep 17 00:00:00 2001 From: kanschat Date: Thu, 17 Jul 2008 10:03:08 +0000 Subject: [PATCH] an unrefined cell has no children git-svn-id: https://svn.dealii.org/trunk@16447 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/tria_accessor.h | 24 +++---------------- .../include/grid/tria_accessor.templates.h | 6 +---- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/deal.II/deal.II/include/grid/tria_accessor.h b/deal.II/deal.II/include/grid/tria_accessor.h index 83bb7515ca..0db0d91440 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.h +++ b/deal.II/deal.II/include/grid/tria_accessor.h @@ -894,12 +894,9 @@ class TriaObjectAccessor : public TriaAccessor /** * Return the number of immediate - * children of this object. - * - * An assertion assures that this - * function can only be called - * for TriaObjects with - * has_children()==true. + * children of this object. The + * number of children of an + * unrefined cell is zero. */ unsigned int n_children() const; @@ -1647,11 +1644,6 @@ class TriaObjectAccessor<1, dim> : public TriaAccessor<1,dim> /** * Return the number of immediate * children of this object. - * - * An assertion assures that this - * function can only be called - * for TriaObjects with - * has_children()==true. */ unsigned int n_children() const; @@ -2372,11 +2364,6 @@ class TriaObjectAccessor<2, dim> : public TriaAccessor<2,dim> /** * Return the number of immediate * children of this object. - * - * An assertion assures that this - * function can only be called - * for TriaObjects with - * has_children()==true. */ unsigned int n_children() const; @@ -3152,11 +3139,6 @@ class TriaObjectAccessor<3, dim> : public TriaAccessor<3,dim> /** * Return the number of immediate * children of this object. - * - * An assertion assures that this - * function can only be called - * for TriaObjects with - * has_children()==true. */ unsigned int n_children() const; 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 87326b5840..955b57c124 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.templates.h +++ b/deal.II/deal.II/include/grid/tria_accessor.templates.h @@ -395,8 +395,7 @@ inline unsigned int TriaObjectAccessor<1,dim>::n_children () const { - Assert (has_children()==true, TriaAccessorExceptions::ExcCellHasNoChildren()); - return GeometryInfo<1>::max_children_per_cell; + return (has_children() ? GeometryInfo<1>::max_children_per_cell : 0); } @@ -833,12 +832,10 @@ inline unsigned int TriaObjectAccessor<2,dim>::n_children () const { - Assert (has_children()==true, TriaAccessorExceptions::ExcCellHasNoChildren()); Assert (static_cast (this->present_index) < objects().refinement_cases.size(), ExcIndexRange(this->present_index, 0, objects().refinement_cases.size())); - return GeometryInfo<2>::n_children(refinement_case()); } @@ -1301,7 +1298,6 @@ inline unsigned int TriaObjectAccessor<3,3>::n_children () const { - Assert (has_children()==true, TriaAccessorExceptions::ExcCellHasNoChildren()); Assert (static_cast (this->present_index) < this->tria->levels[this->present_level]->cells.refinement_cases.size(), ExcIndexRange(this->present_index, 0, -- 2.39.5