]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move an iterator declaration that is now completely generic.
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 4 Aug 2017 12:04:30 +0000 (06:04 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 4 Aug 2017 12:04:30 +0000 (06:04 -0600)
The internal::Triangulation::Iterators class was meant to abstract away things
that look differently between dimensions. But we can now do better because at
least the vertex iterators are completely generic now. So move the typedef from
there to the Triangulation class, where it easier to find for users.

include/deal.II/grid/tria.h
include/deal.II/grid/tria_accessor.h
include/deal.II/grid/tria_accessor.templates.h
include/deal.II/grid/tria_iterator_selector.h

index fc26bb647fc41cc95382d740f26db7bd97542a2e..70a29275743bdec0f41613404d72c59ddcd291a8 100644 (file)
@@ -1503,8 +1503,8 @@ public:
   typedef TriaIterator      <TriaAccessor<dim-1, dim, spacedim> > face_iterator;
   typedef TriaActiveIterator<TriaAccessor<dim-1, dim, spacedim> > active_face_iterator;
 
-  typedef typename IteratorSelector::vertex_iterator        vertex_iterator;
-  typedef typename IteratorSelector::active_vertex_iterator active_vertex_iterator;
+  typedef TriaIterator      <dealii::TriaAccessor<0, dim, spacedim> > vertex_iterator;
+  typedef TriaActiveIterator<dealii::TriaAccessor<0, dim, spacedim> > active_vertex_iterator;
 
   typedef typename IteratorSelector::line_iterator        line_iterator;
   typedef typename IteratorSelector::active_line_iterator active_line_iterator;
@@ -3245,12 +3245,12 @@ private:
    * Since users should never have to access these internal properties of how
    * we store data, these iterator types are made private.
    */
-  typedef TriaRawIterator   <CellAccessor<dim,spacedim>         > raw_cell_iterator;
-  typedef TriaRawIterator   <TriaAccessor<dim-1, dim, spacedim> > raw_face_iterator;
-  typedef typename IteratorSelector::raw_vertex_iterator          raw_vertex_iterator;
-  typedef typename IteratorSelector::raw_line_iterator            raw_line_iterator;
-  typedef typename IteratorSelector::raw_quad_iterator            raw_quad_iterator;
-  typedef typename IteratorSelector::raw_hex_iterator             raw_hex_iterator;
+  typedef TriaRawIterator<CellAccessor<dim,spacedim>         >     raw_cell_iterator;
+  typedef TriaRawIterator<TriaAccessor<dim-1, dim, spacedim> >     raw_face_iterator;
+  typedef TriaRawIterator<dealii::TriaAccessor<0, dim, spacedim> > raw_vertex_iterator;
+  typedef typename IteratorSelector::raw_line_iterator             raw_line_iterator;
+  typedef typename IteratorSelector::raw_quad_iterator             raw_quad_iterator;
+  typedef typename IteratorSelector::raw_hex_iterator              raw_hex_iterator;
 
   /**
    * Iterator to the first cell, used or not, on level @p level. If a level
index 664cfc970b1a153d9f97957282e9368d77e9a99f..dc5531a53428d3dd22847ce80fd6159ffd613a77 100644 (file)
@@ -655,7 +655,7 @@ public:
    * Pointer to the @p ith vertex bounding this object. Throw an exception if
    * <code>dim=1</code>.
    */
-  typename dealii::internal::Triangulation::Iterators<dim,spacedim>::vertex_iterator
+  TriaIterator<TriaAccessor<0,dim,spacedim> >
   vertex_iterator (const unsigned int i) const;
 
   /**
index 9d6252cad119e8deacb6cf425725ce429ccc5c4f..6529d22ab9a37cbb1b82e7ca0d7546027ef80a5d 100644 (file)
@@ -1189,11 +1189,10 @@ TriaAccessor<structdim,dim,spacedim>::used () const
 
 template <int structdim, int dim, int spacedim>
 inline
-typename dealii::internal::Triangulation::Iterators<dim,spacedim>::vertex_iterator
+TriaIterator<TriaAccessor<0,dim,spacedim> >
 TriaAccessor<structdim,dim,spacedim>::vertex_iterator (const unsigned int i) const
 {
-  return typename dealii::internal::Triangulation::Iterators<dim,spacedim>::vertex_iterator
-         (this->tria, 0, vertex_index (i));
+  return TriaIterator<TriaAccessor<0,dim,spacedim> >(this->tria, 0, vertex_index (i));
 }
 
 
index 47ea96f54a7f2bbe7d823356640cfca000b23fb9..18c1a9342e2253d62c6acb151355ef470d62b909 100644 (file)
@@ -42,9 +42,6 @@ namespace internal
      * @ref Iterators
      * module for more information.
      *
-     * A @p vertex_iterator is typedef'd to an iterator operating on the @p
-     * vertices member variable of a <tt>Triangulation<1></tt> object.
-     *
      * A @p line_iterator is typedef'd to an iterator operating on the @p
      * lines member variable of a <tt>Triangulation<1></tt> object. An @p
      * active_line_iterator only operates on the active lines. @p
@@ -72,10 +69,6 @@ namespace internal
     template <int spacedim>
     struct Iterators<1,spacedim>
     {
-      typedef TriaRawIterator   <dealii::TriaAccessor<0, 1, spacedim> > raw_vertex_iterator;
-      typedef TriaIterator      <dealii::TriaAccessor<0, 1, spacedim> > vertex_iterator;
-      typedef TriaActiveIterator<dealii::TriaAccessor<0, 1, spacedim> > active_vertex_iterator;
-
       typedef TriaRawIterator   <dealii::CellAccessor<1,spacedim> > raw_line_iterator;
       typedef TriaIterator      <dealii::CellAccessor<1,spacedim> > line_iterator;
       typedef TriaActiveIterator<dealii::CellAccessor<1,spacedim> > active_line_iterator;
@@ -99,9 +92,6 @@ namespace internal
      * @ref Iterators
      * module for more information.
      *
-     * A @p vertex_iterator is typedef'd to an iterator operating on the @p
-     * vertices member variable of a <tt>Triangulation<2></tt> object.
-     *
      * A @p line_iterator is typedef'd to an iterator operating on the @p
      * lines member variable of a <tt>Triangulation<2></tt> object. An @p
      * active_line_iterator only operates on the active lines. @p
@@ -135,10 +125,6 @@ namespace internal
     template <int spacedim>
     struct Iterators<2,spacedim>
     {
-      typedef TriaRawIterator   <dealii::TriaAccessor<0, 2, spacedim> > raw_vertex_iterator;
-      typedef TriaIterator      <dealii::TriaAccessor<0, 2, spacedim> > vertex_iterator;
-      typedef TriaActiveIterator<dealii::TriaAccessor<0, 2, spacedim> > active_vertex_iterator;
-
       typedef TriaRawIterator   <dealii::TriaAccessor<1, 2, spacedim> > raw_line_iterator;
       typedef TriaIterator      <dealii::TriaAccessor<1, 2, spacedim> > line_iterator;
       typedef TriaActiveIterator<dealii::TriaAccessor<1, 2, spacedim> > active_line_iterator;
@@ -179,10 +165,6 @@ namespace internal
     template <int spacedim>
     struct Iterators<3,spacedim>
     {
-      typedef TriaRawIterator   <dealii::TriaAccessor<0, 3, spacedim> > raw_vertex_iterator;
-      typedef TriaIterator      <dealii::TriaAccessor<0, 3, spacedim> > vertex_iterator;
-      typedef TriaActiveIterator<dealii::TriaAccessor<0, 3, spacedim> > active_vertex_iterator;
-
       typedef TriaRawIterator   <dealii::TriaAccessor<1, 3, spacedim> > raw_line_iterator;
       typedef TriaIterator      <dealii::TriaAccessor<1, 3, spacedim> > line_iterator;
       typedef TriaActiveIterator<dealii::TriaAccessor<1, 3, spacedim> > active_line_iterator;

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.