]> https://gitweb.dealii.org/ - dealii.git/commitdiff
allow multigrid for distributed Triangulation with a constructor flag. Still work...
authorTimo Heister <timo.heister@gmail.com>
Fri, 11 Jan 2013 18:27:08 +0000 (18:27 +0000)
committerTimo Heister <timo.heister@gmail.com>
Fri, 11 Jan 2013 18:27:08 +0000 (18:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@28024 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/distributed/tria.h
deal.II/source/distributed/tria.cc
deal.II/source/dofs/dof_handler_policy.cc

index 2893c8f50d04c5e113c0d93fd0a1a3fa98934670..91fc256ede87e84b5553555ddf63ead8a717cf73 100644 (file)
@@ -240,11 +240,19 @@ namespace parallel
        * cell ordering, this flag is
        * required to get reproducible
        * behaviour after snapshot/resume.
+       *
+       * The flag construct_multigrid_hierarchy
+       * needs to be set to use the geometric
+       * multigrid functionality. This option
+       * requires additional computation and
+       * communication. Note: geometric
+       * multigrid is still a work in progress.
        */
       enum Settings
       {
         default_setting = 0x0,
-        mesh_reconstruction_after_repartitioning = 0x1
+        mesh_reconstruction_after_repartitioning = 0x1,
+        construct_multigrid_hierarchy = 0x2
       };
 
 
@@ -866,6 +874,21 @@ namespace parallel
        */
       std::vector<unsigned int> coarse_cell_to_p4est_tree_permutation;
       std::vector<unsigned int> p4est_tree_to_coarse_cell_permutation;
+
+      /**
+       * dummy settings
+       */
+      enum Settings
+      {
+        default_setting = 0x0,
+        mesh_reconstruction_after_repartitioning = 0x1,
+        construct_multigrid_hierarchy = 0x2
+      };
+      /**
+       * dummy settings object
+       */
+      Settings settings;
+
     };
   }
 }
index a933e79b34efd0b10970e8928ea4d988e28fa714..f5dbb393bb55a3bb8a0cb899bb8145cffdbb25f3 100644 (file)
@@ -2691,10 +2691,9 @@ namespace parallel
 
 
       // fill level_subdomain_ids for geometric multigrid
-      // This is disabled for now until it works correctly.
       // the level ownership of a cell is defined as the owner if the cell is active or as the owner of child(0)
       // we need this information for all our ancestors and the same-level neighbors of our own cells (=level ghosts)
-      if (false)
+      if (settings & construct_multigrid_hierarchy)
         {
           // step 1: We set our own ids all the way down and all the others to -1. Note that we do not fill
           // other cells we could figure out the same way, because we might accidentally set an id for a
index fa280fadb2dce0e7b854bbc7d995ae35bd4308da..31fcba27e5172f13a0bcea1304813d949f662feb 100644 (file)
@@ -2128,15 +2128,17 @@ namespace internal
         Assert (false, ExcNotImplemented());
 #else
 
-        // TODO: distributed geometric multigrid is not complete yet
-        Assert (false, ExcNotImplemented());
-        return;
-
         parallel::distributed::Triangulation< dim, spacedim > *tr
           = (dynamic_cast<parallel::distributed::Triangulation<dim,spacedim>*>
              (const_cast<dealii::Triangulation< dim, spacedim >*>
               (&dof_handler.get_tria())));
         Assert (tr != 0, ExcInternalError());
+
+        AssertThrow(
+            (tr->settings &  parallel::distributed::Triangulation< dim, spacedim >::construct_multigrid_hierarchy),
+            ExcMessage("Multigrid DoFs can only be distributed on a parallel Triangulation if the flag construct_multigrid_hierarchy is set in the constructor."));
+
+
         const unsigned int
         n_cpus = Utilities::MPI::n_mpi_processes (tr->get_communicator());
 

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.