]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Partial merge from the parallel_mg branch: introduce Triangulation::n_global_levels...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 5 Nov 2012 00:44:55 +0000 (00:44 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 5 Nov 2012 00:44:55 +0000 (00:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@27378 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/include/deal.II/distributed/tria.h
deal.II/source/distributed/tria.cc

index fe01bd696fd63fc623c8b3a62433f841efbf70a9..0a6fcfc76bc20e6d405d294af4d9105f287d027b 100644 (file)
@@ -154,6 +154,12 @@ DoFHandler, in particular removal of specializations.
 <h3>Specific improvements</h3>
 
 <ol>
+<li> New: The parallel::distributed::Triangulation::n_global_levels()
+function returns the maximal refinement level over all involved
+processors.
+<br>
+(Timo Heister, 2012/11/04)
+
 <li> New: In addition to the regular subdomain ids (see
 @ref GlossSubdomainId) there is now a second set of flags called
 "level subdomain ids" that also assigns a subdomain to every cell
index 797d8c436f695c152ab314eb0c0b3dc30042f45c..7516e362e75996f012b145aa55ad75bfec6aa815 100644 (file)
@@ -441,6 +441,11 @@ namespace parallel
                                           */
         unsigned int n_global_active_cells () const;
 
+        /**
+         * Returns the global maximum level. This may be bigger than n_levels.
+         */
+        virtual unsigned int n_global_levels () const;
+
                                          /**
                                           * Return the number of
                                           * active cells owned by each
@@ -627,6 +632,7 @@ namespace parallel
         {
             std::vector<unsigned int> n_locally_owned_active_cells;
             unsigned int              n_global_active_cells;
+            unsigned int              n_global_levels;
         };
 
         NumberCache number_cache;
@@ -825,6 +831,7 @@ namespace parallel
                                           * distributed triangulation.
                                           */
         unsigned int n_global_active_cells () const;
+        virtual unsigned int n_global_levels () const;
 
                                          /**
                                           * Returns a permutation vector for the order the coarse
index e025665818c3256f8a525cce5e267ceabc1a07ef..6796e1c8d7a4af5df1330276cd0ed5c8f6fc35b9 100644 (file)
@@ -2816,6 +2816,7 @@ namespace parallel
         = std::accumulate (number_cache.n_locally_owned_active_cells.begin(),
                            number_cache.n_locally_owned_active_cells.end(),
                            0);
+      number_cache.n_global_levels = Utilities::MPI::max(this->n_levels(), mpi_communicator);
     }
 
 
@@ -2848,6 +2849,15 @@ namespace parallel
 
 
 
+    template <int dim, int spacedim>
+    unsigned int
+    Triangulation<dim,spacedim>::n_global_levels () const
+    {
+      return number_cache.n_global_levels;
+    }
+
+
+
     template <int dim, int spacedim>
     const std::vector<unsigned int> &
     Triangulation<dim,spacedim>::n_locally_owned_active_cells_per_processor () const
@@ -2977,6 +2987,7 @@ namespace parallel
         + MemoryConsumption::memory_consumption(triangulation_has_content)
         + MemoryConsumption::memory_consumption(number_cache.n_locally_owned_active_cells)
         + MemoryConsumption::memory_consumption(number_cache.n_global_active_cells)
+        + MemoryConsumption::memory_consumption(number_cache.n_global_levels)
         + MemoryConsumption::memory_consumption(connectivity)
         + MemoryConsumption::memory_consumption(parallel_forest)
         + MemoryConsumption::memory_consumption(refinement_in_progress)
@@ -3099,6 +3110,15 @@ namespace parallel
     }
 
 
+    template <>
+    unsigned int
+    Triangulation<1,1>::n_global_levels () const
+    {
+      Assert (false, ExcNotImplemented());
+      return 0;
+    }
+
+
     template <>
     MPI_Comm
     Triangulation<1,1>::get_communicator () const
@@ -3148,6 +3168,15 @@ namespace parallel
     }
 
 
+    template <>
+    unsigned int
+    Triangulation<1,2>::n_global_levels () const
+    {
+      Assert (false, ExcNotImplemented());
+      return 0;
+    }
+
+
     template <>
     MPI_Comm
     Triangulation<1,2>::get_communicator () const
@@ -3189,6 +3218,15 @@ namespace parallel
     }
 
 
+    template <>
+    unsigned int
+    Triangulation<1,3>::n_global_levels () const
+    {
+      Assert (false, ExcNotImplemented());
+      return 0;
+    }
+
+
     template <>
     MPI_Comm
     Triangulation<1,3>::get_communicator () const

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.