]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove last_active(level) and last(level), as suggested by bug report 2.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 19 Jul 2013 16:18:48 +0000 (16:18 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 19 Jul 2013 16:18:48 +0000 (16:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@30061 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/grid/tria.h
deal.II/source/grid/tria.cc

index c15be6032f00b5f14127e4ce48c0f61b30284fec..72b71db88f3b1686ab5ece69a927d98ff12488ce 100644 (file)
@@ -2655,23 +2655,11 @@ public:
    */
   cell_iterator        last () const;
 
-  /**
-   *  Return an iterator pointing to the
-   *  last used cell on level @p level.
-   */
-  cell_iterator        last (const unsigned int level) const;
-
   /**
    *  Return an iterator pointing to the
    *  last active cell.
    */
   active_cell_iterator last_active () const;
-
-  /**
-   *  Return an iterator pointing to the
-   *  last active cell on level @p level.
-   */
-  active_cell_iterator last_active (const unsigned int level) const;
   /*@}*/
 
   /*---------------------------------------*/
index 4a9ba696f2a5b7d00de7b7094ffda78adf4cd010..620f40017ee3d834f77c7117d159285429ef29e1 100644 (file)
@@ -10999,15 +10999,8 @@ template <int dim, int spacedim>
 typename Triangulation<dim,spacedim>::cell_iterator
 Triangulation<dim,spacedim>::last () const
 {
-  return last (levels.size()-1);
-}
-
-
+  const unsigned int level = levels.size()-1;
 
-template <int dim, int spacedim>
-typename Triangulation<dim,spacedim>::cell_iterator
-Triangulation<dim,spacedim>::last (const unsigned int level) const
-{
   Assert (level<n_global_levels() || level<levels.size(), ExcInvalidLevel(level));
   if (levels[level]->cells.cells.size() ==0)
     return end(level);
@@ -11050,27 +11043,6 @@ Triangulation<dim,spacedim>::last_active () const
 
 
 
-template <int dim, int spacedim>
-typename Triangulation<dim,spacedim>::active_cell_iterator
-Triangulation<dim,spacedim>::last_active (const unsigned int level) const
-{
-  // get the last used cell on this level
-  cell_iterator cell = last(level);
-
-  if (cell != end(level))
-    {
-      // then move to the last active one
-      if (cell->active()==true)
-        return cell;
-      while ((--cell).state() == IteratorState::valid)
-        if (cell->active()==true)
-          return cell;
-    }
-  return cell;
-}
-
-
-
 template <int dim, int spacedim>
 typename Triangulation<dim,spacedim>::cell_iterator
 Triangulation<dim,spacedim>::end () const
@@ -12234,10 +12206,9 @@ void Triangulation<dim, spacedim>::execute_coarsening ()
   // deleted (if the latter are on a
   // higher level for example)
   //
-  // if there is only one level,
-  // there can not be anything to do
-  if (levels.size() >= 2)
-    for (cell = last(levels.size()-2); cell!=endc; --cell)
+  // cells on level 0 are never coarsened, so we can skip it
+  for (unsigned int level = n_levels()-1; level>=1; --level)
+    for (cell = begin(level); cell!=end(level); --cell)
       if (cell->user_flag_set())
         // use a separate function,
         // since this is dimension

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.