From: Wolfgang Bangerth Date: Thu, 23 Aug 2018 21:21:33 +0000 (-0600) Subject: Simplify two functions. X-Git-Tag: v9.1.0-rc1~784^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f83cc6522ad3d7ff011c876e5f1539de4c278530;p=dealii.git Simplify two functions. These functions threw an exception in 1d, but this is not the right place to check that condition: the assertion is currently thrown because some other class does not implement a function. In particular, this is about TriaAccessor<0,1>::operator++(), but that already has the correct assertion that, if ever lifted, would make the place that currently *also* checks the condition work automatically. --- diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 42190f0bb3..5f98cf9d3f 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -12181,27 +12181,15 @@ template typename Triangulation::vertex_iterator Triangulation::begin_vertex() const { - if (dim == 1) - { - // This does not work if dim==1 because TriaAccessor<0,1,spacedim> does - // not implement operator++ - Assert(false, ExcNotImplemented()); - return raw_vertex_iterator(); - } - else - { - vertex_iterator i = - raw_vertex_iterator(const_cast *>(this), - 0, - 0); - if (i.state() != IteratorState::valid) - return i; - // This loop will end because every triangulation has used vertices. - while (i->used() == false) - if ((++i).state() != IteratorState::valid) - return i; + vertex_iterator i = + raw_vertex_iterator(const_cast *>(this), 0, 0); + if (i.state() != IteratorState::valid) + return i; + // This loop will end because every triangulation has used vertices. + while (i->used() == false) + if ((++i).state() != IteratorState::valid) return i; - } + return i; } @@ -12210,6 +12198,7 @@ template typename Triangulation::active_vertex_iterator Triangulation::begin_active_vertex() const { + // every vertex is active return begin_vertex(); } @@ -12219,15 +12208,9 @@ template typename Triangulation::vertex_iterator Triangulation::end_vertex() const { - if (dim == 1) - { - Assert(false, ExcNotImplemented()); - return raw_vertex_iterator(); - } - else - return raw_vertex_iterator(const_cast *>(this), - -1, - numbers::invalid_unsigned_int); + return raw_vertex_iterator(const_cast *>(this), + -1, + numbers::invalid_unsigned_int); }