]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve documentation.
authorBruno Turcksin <bruno.turcksin@gmail.com>
Tue, 17 Nov 2015 00:30:10 +0000 (18:30 -0600)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Tue, 17 Nov 2015 00:30:10 +0000 (18:30 -0600)
include/deal.II/grid/tria.h
include/deal.II/grid/tria_accessor.h
include/deal.II/grid/tria_accessor.templates.h
source/grid/tria.cc

index 6609920cbd9af9f02d564b3e7b47dbfeb9e02fc8..1e1e54f780f42655a25126924484ccb7b9c49fb9 100644 (file)
@@ -2559,19 +2559,22 @@ public:
    */
 
   /**
-   * Iterator to the first used vertex.
+   * Iterator to the first used vertex. This function can only be used if dim is
+   * not one.
    */
   vertex_iterator        begin_vertex() const;
 
   /**
    * Iterator to the first active vertex. Because all vertices are active,
-   * begin_vertex() and begin_active_vertex() return the same vertex.
+   * begin_vertex() and begin_active_vertex() return the same vertex. This
+   * function can only be used if dim is not one.
    */
   active_vertex_iterator begin_active_vertex() const;
 
   /**
    * Iterator past the end; this iterator serves for comparisons of iterators
-   * with past-the-end or before-the-beginning states.
+   * with past-the-end or before-the-beginning states. This function can only be
+   * used if dim is not one.
    */
   vertex_iterator        end_vertex() const;
 
index aa5e0170f842a335a4606edd9ea0a09cc9c02bee..025217ee31f448364e30a414adf03f96586eb0d0 100644 (file)
@@ -1815,6 +1815,12 @@ protected:
    * The global vertex index of the vertex this object corresponds to.
    */
   unsigned int  global_vertex_index;
+
+private:
+
+  template <typename Accessor> friend class TriaRawIterator;
+  template <typename Accessor> friend class TriaIterator;
+  template <typename Accessor> friend class TriaActiveIterator;
 };
 
 
index 03a760adfa94f78bc757c45379ba5ca45a45cbb4..4e68cf6f98c1dfc7e6121240173419cf9a257ac7 100644 (file)
@@ -2241,7 +2241,11 @@ void
 TriaAccessor<0, dim, spacedim>::operator -- ()
 {
   if (global_vertex_index!=numbers::invalid_unsigned_int)
-    --global_vertex_index;
+    {
+      --global_vertex_index;
+      if (global_vertex_index==static_cast<unsigned int>(-1))
+        global_vertex_index = numbers::invalid_unsigned_int;
+    }
 }
 
 
index d37c7e20a30107fb05639c82913d963da3cc6bf4..8ace37f5b3252a550fa72d41581f5510fec2d18f 100644 (file)
@@ -10614,6 +10614,8 @@ Triangulation<dim,spacedim>::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();
     }
@@ -10624,6 +10626,7 @@ Triangulation<dim,spacedim>::begin_vertex() const
                                               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;

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.