]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use subdomain_id consistently for ghost owners.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 27 Oct 2016 17:37:29 +0000 (12:37 -0500)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 27 Oct 2016 17:37:29 +0000 (12:37 -0500)
include/deal.II/distributed/tria_base.h
source/distributed/shared_tria.cc
source/distributed/tria.cc
source/distributed/tria_base.cc

index f395fc8840f34e51ddd4c982de89cc497ded8d94..047cce0a98f3b720ba53c31f787af4f190e838fb 100644 (file)
@@ -137,7 +137,8 @@ namespace parallel
      * @note: If @p i is contained in the list of processor @p j, then @p j
      * will also be contained in the list of processor @p i.
      */
-    const std::set<unsigned int> &ghost_owners () const;
+    const std::set<types::subdomain_id> &
+    ghost_owners () const;
 
     /**
      * Return a set of MPI ranks of the processors that have at least one
@@ -148,7 +149,8 @@ namespace parallel
      * @note: If @p i is contained in the list of processor @p j, then @p j
      * will also be contained in the list of processor @p i.
      */
-    const std::set<unsigned int> &level_ghost_owners () const;
+    const std::set<types::subdomain_id> &
+    level_ghost_owners () const;
 
   protected:
     /**
@@ -179,28 +181,28 @@ namespace parallel
        * This vector stores the number of locally owned active cells per MPI
        * rank.
        */
-      std::vector<unsigned int> n_locally_owned_active_cells;
+      std::vector<unsigned int>     n_locally_owned_active_cells;
       /**
        * The total number of active cells (sum of @p
        * n_locally_owned_active_cells).
        */
-      types::global_dof_index   n_global_active_cells;
+      types::global_dof_index       n_global_active_cells;
       /**
        * The global number of levels computed as the maximum number of levels
        * taken over all MPI ranks, so <tt>n_levels()<=n_global_levels =
        * max(n_levels() on proc i)</tt>.
        */
-      unsigned int              n_global_levels;
+      unsigned int                  n_global_levels;
       /**
        * A set containing the subdomain_id (MPI rank) of the owners of the
        * ghost cells on this processor.
        */
-      std::set<unsigned int> ghost_owners;
+      std::set<types::subdomain_id> ghost_owners;
       /**
        * A set containing the MPI ranks of the owners of the level ghost cells
        * on this processor (for all levels).
        */
-      std::set<unsigned int> level_ghost_owners;
+      std::set<types::subdomain_id> level_ghost_owners;
 
       NumberCache();
     };
@@ -211,8 +213,6 @@ namespace parallel
      * Update the number_cache variable after mesh creation or refinement.
      */
     virtual void update_number_cache ();
-
-
   };
 
 } // namespace parallel
index fc064e922b64e11a349c7426ff20768c15f78fad..ea0b8025cc54d45f767fe18c519e3a405f497857 100644 (file)
@@ -93,7 +93,7 @@ namespace parallel
     }
 
     template <int dim, int spacedim>
-    const std::vector<unsigned int> &
+    const std::vector<types::subdomain_id> &
     Triangulation<dim,spacedim>::get_true_subdomain_ids_of_cells() const
     {
       return true_subdomain_ids_of_cells;
index 2712756b45c5dbe93e8c38b61778ea50d0bc5cf4..f277ad2cce1c4f63198e93f2337005c03d82dae9 100644 (file)
@@ -516,10 +516,10 @@ namespace
 
   template <int dim, int spacedim>
   void
-  match_quadrant (const dealii::Triangulation<dim,spacedim> *tria,
-                  unsigned int dealii_index,
+  match_quadrant (const dealii::Triangulation<dim,spacedim>      *tria,
+                  unsigned int                                    dealii_index,
                   typename internal::p4est::types<dim>::quadrant &ghost_quadrant,
-                  unsigned int ghost_owner)
+                  types::subdomain_id                             ghost_owner)
   {
     int i, child_id;
     int l = ghost_quadrant.level;
@@ -937,7 +937,7 @@ namespace
 
     void build_lists (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
                       const typename internal::p4est::types<dim>::quadrant &p4est_cell,
-                      const unsigned int myid);
+                      const types::subdomain_id myid);
   };
 
 
@@ -1935,21 +1935,27 @@ namespace parallel
             int dummy = 0;
             unsigned int req_counter = 0;
 
-            for (std::set<unsigned int>::iterator it = this->number_cache.level_ghost_owners.begin();
+            for (std::set<types::subdomain_id>::iterator it = this->number_cache.level_ghost_owners.begin();
                  it != this->number_cache.level_ghost_owners.end();
                  ++it, ++req_counter)
               {
-                MPI_Isend(&dummy, 1, MPI_INT,
+                Assert (typeid(types::subdomain_id)
+                        == typeid(unsigned int),
+                        ExcNotImplemented());
+                MPI_Isend(&dummy, 1, MPI_UNSIGNED,
                           *it, 9001, this->mpi_communicator,
                           &requests[req_counter]);
               }
 
-            for (std::set<unsigned int>::iterator it = this->number_cache.level_ghost_owners.begin();
+            for (std::set<types::subdomain_id>::iterator it = this->number_cache.level_ghost_owners.begin();
                  it != this->number_cache.level_ghost_owners.end();
                  ++it)
               {
-                int dummy;
-                MPI_Recv(&dummy, 1, MPI_INT,
+                Assert (typeid(types::subdomain_id)
+                        == typeid(unsigned int),
+                        ExcNotImplemented());
+                unsigned int dummy;
+                MPI_Recv(&dummy, 1, MPI_UNSIGNED,
                          *it, 9001, this->mpi_communicator,
                          MPI_STATUS_IGNORE);
               }
@@ -1961,7 +1967,8 @@ namespace parallel
           }
 #endif
 
-          Assert(this->number_cache.level_ghost_owners.size() < Utilities::MPI::n_mpi_processes(this->mpi_communicator), ExcInternalError());
+          Assert(this->number_cache.level_ghost_owners.size() < Utilities::MPI::n_mpi_processes(this->mpi_communicator),
+                 ExcInternalError());
         }
     }
 
@@ -2629,7 +2636,7 @@ namespace parallel
           // every ghostquadrant, find corresponding deal coarsecell and
           // recurse.
           typename dealii::internal::p4est::types<dim>::quadrant *quadr;
-          unsigned int ghost_owner=0;
+          types::subdomain_id ghost_owner=0;
           typename dealii::internal::p4est::types<dim>::topidx ghost_tree=0;
 
           for (unsigned int g_idx=0; g_idx<parallel_ghost->ghosts.elem_count; ++g_idx)
index 15020f7b1177d0ca6d25a7ec2a6e76333de19814..af05030c335a8d0d338e8505af2ae449060137bd 100644 (file)
@@ -230,7 +230,7 @@ namespace parallel
   }
 
   template <int dim, int spacedim>
-  const std::set<unsigned int> &
+  const std::set<types::subdomain_id> &
   Triangulation<dim,spacedim>::
   ghost_owners () const
   {
@@ -238,7 +238,7 @@ namespace parallel
   }
 
   template <int dim, int spacedim>
-  const std::set<unsigned int> &
+  const std::set<types::subdomain_id> &
   Triangulation<dim,spacedim>::
   level_ghost_owners () 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.