]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Expose the ability to renumber MG dofs in the DoFHandlerPolicy interface.
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 30 Jun 2017 17:39:37 +0000 (11:39 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 30 Jun 2017 18:12:45 +0000 (12:12 -0600)
include/deal.II/dofs/dof_handler_policy.h
source/dofs/dof_handler_policy.cc

index 9d717adb58357d2c86f562f068e97460ee805f60..a2e48d66bf51a61152469fe74ebffd4ce6f351ff 100644 (file)
@@ -90,6 +90,19 @@ namespace internal
         virtual
         NumberCache
         renumber_dofs (const std::vector<types::global_dof_index> &new_numbers) const = 0;
+
+        /**
+         * Renumber multilevel degrees of freedom on one level of a multigrid
+         * hierarchy. The second argument specifies the set of new DoF
+         * indices.
+         *
+         * Return an updated NumberCache for the specified level of the
+         * DoFHandler after renumbering.
+         */
+        virtual
+        NumberCache
+        renumber_mg_dofs (const unsigned int                          level,
+                          const std::vector<types::global_dof_index> &new_numbers) const = 0;
       };
 
 
@@ -123,6 +136,12 @@ namespace internal
         NumberCache
         renumber_dofs (const std::vector<types::global_dof_index>  &new_numbers) const;
 
+        // documentation is inherited
+        virtual
+        NumberCache
+        renumber_mg_dofs (const unsigned int                          level,
+                          const std::vector<types::global_dof_index> &new_numbers) const;
+
       protected:
         /**
          * The DoFHandler object on which this policy object works.
@@ -130,6 +149,8 @@ namespace internal
         SmartPointer<DoFHandlerType> dof_handler;
       };
 
+
+
       /**
        * This class implements the policy for operations when we use a
        * parallel::shared::Triangulation object.
@@ -177,6 +198,12 @@ namespace internal
         NumberCache
         renumber_dofs (const std::vector<types::global_dof_index>  &new_numbers) const;
 
+        // documentation is inherited
+        virtual
+        NumberCache
+        renumber_mg_dofs (const unsigned int                          level,
+                          const std::vector<types::global_dof_index> &new_numbers) const;
+
       private:
         /**
          * The DoFHandler object on which this policy object works.
@@ -215,6 +242,12 @@ namespace internal
         NumberCache
         renumber_dofs (const std::vector<types::global_dof_index>  &new_numbers) const;
 
+        // documentation is inherited
+        virtual
+        NumberCache
+        renumber_mg_dofs (const unsigned int                          level,
+                          const std::vector<types::global_dof_index> &new_numbers) const;
+
       private:
         /**
          * The DoFHandler object on which this policy object works.
index ddfefe296060b30727fea6181f7df12a8c47da13..5be7b4676fb27e0b588e3d663a3d3baabca97800 100644 (file)
@@ -1169,6 +1169,21 @@ namespace internal
       }
 
 
+
+      template <typename DoFHandlerType>
+      NumberCache
+      Sequential<DoFHandlerType>::
+      renumber_mg_dofs (const unsigned int                          level,
+                        const std::vector<types::global_dof_index> &new_numbers) const
+      {
+        Implementation::renumber_mg_dofs (new_numbers, IndexSet(0),
+                                          *dof_handler, level, true);
+
+        // return a sequential, complete index set
+        return NumberCache (new_numbers.size());
+      }
+
+
       /* --------------------- class ParallelShared ---------------- */
 
 
@@ -1418,13 +1433,15 @@ namespace internal
         // this is not currently implemented; the algorithm should work
         // as above, though: first call the sequential numbering
         // algorithm, then re-enumerate subdomain-wise
-        Assert(false,ExcNotImplemented());
+        Assert(false, ExcNotImplemented());
 
         return std::vector<NumberCache>();
       }
 
 
 
+
+
       template <int dim, int spacedim>
       NumberCache
       ParallelShared<dim,spacedim>::
@@ -1561,6 +1578,22 @@ namespace internal
 #endif
       }
 
+
+
+      template <int dim, int spacedim>
+      NumberCache
+      ParallelShared<dim,spacedim>::
+      renumber_mg_dofs (const unsigned int                          /*level*/,
+                        const std::vector<types::global_dof_index> &/*new_numbers*/) const
+      {
+        // multigrid is not currently implemented for shared triangulations
+        Assert(false, ExcNotImplemented());
+
+        return NumberCache ();
+      }
+
+
+
       /* --------------------- class ParallelDistributed ---------------- */
 
 #ifdef DEAL_II_WITH_P4EST
@@ -3101,6 +3134,24 @@ namespace internal
 
         return number_cache;
       }
+
+
+
+      template <int dim, int spacedim>
+      NumberCache
+      ParallelDistributed<dim,spacedim>::
+      renumber_mg_dofs (const unsigned int                          /*level*/,
+                        const std::vector<types::global_dof_index> &/*new_numbers*/) const
+      {
+        // this is not currently implemented, but should be simple to do by
+        // just calling the function like in the sequential case just with
+        // an appropriate index set argument
+        Assert(false, ExcNotImplemented());
+
+        return NumberCache ();
+      }
+
+
     }
   }
 }

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.