]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make the sequential policy class compile for hp::DoFHandler.
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 27 Jun 2017 14:22:39 +0000 (08:22 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 28 Jun 2017 16:01:21 +0000 (10:01 -0600)
Do so by making some code generic, and providing stubs for functions
that will be moved from the hp::DoFHandler class properly.

source/dofs/dof_handler_policy.cc
source/dofs/dof_handler_policy.inst.in

index 66a4aca15693b40893bd80dc45512fe2f85458e5..2cd9303f1dea829aa397ae4cdad6dc7c3c40f979 100644 (file)
@@ -56,6 +56,10 @@ namespace internal
       // the following
       using dealii::DoFHandler;
 
+      namespace hp
+      {
+        using dealii::hp::DoFHandler;
+      }
 
 
       namespace
@@ -281,23 +285,70 @@ namespace internal
         }
 
 
+
+        // same for the hp::DoFHandler
+        template <int spacedim>
+        static
+        types::global_dof_index
+        distribute_dofs_on_cell (const hp::DoFHandler<1,spacedim>                                &dof_handler,
+                                 const typename hp::DoFHandler<1,spacedim>::active_cell_iterator &cell,
+                                 types::global_dof_index                                          next_free_dof)
+        {
+          (void)dof_handler;
+          (void)cell;
+          (void)next_free_dof;
+          return 0;
+        }
+
+
+
+        template <int spacedim>
+        static
+        types::global_dof_index
+        distribute_dofs_on_cell (const hp::DoFHandler<2,spacedim>                                &dof_handler,
+                                 const typename hp::DoFHandler<2,spacedim>::active_cell_iterator &cell,
+                                 types::global_dof_index                                          next_free_dof)
+        {
+          (void)dof_handler;
+          (void)cell;
+          (void)next_free_dof;
+          return 0;
+        }
+
+
+
+        template <int spacedim>
+        static
+        types::global_dof_index
+        distribute_dofs_on_cell (const hp::DoFHandler<3,spacedim>                                &dof_handler,
+                                 const typename hp::DoFHandler<3,spacedim>::active_cell_iterator &cell,
+                                 types::global_dof_index                                          next_free_dof)
+        {
+          (void)dof_handler;
+          (void)cell;
+          (void)next_free_dof;
+          return 0;
+        }
+
+
+
         /**
          * Distribute degrees of freedom on all cells, or on cells with the
          * correct subdomain_id if the corresponding argument is not equal to
          * numbers::invalid_subdomain_id. Return the total number of dofs
          * distributed.
          */
-        template <int dim, int spacedim>
+        template <typename DoFHandlerType>
         static
         types::global_dof_index
         distribute_dofs (const types::subdomain_id     subdomain_id,
-                         DoFHandler<dim,spacedim>     &dof_handler)
+                         DoFHandlerType               &dof_handler)
         {
           Assert (dof_handler.get_triangulation().n_levels() > 0,
                   ExcMessage("Empty triangulation"));
 
           types::global_dof_index next_free_dof = 0;
-          typename DoFHandler<dim,spacedim>::active_cell_iterator
+          typename DoFHandlerType::active_cell_iterator
           cell = dof_handler.begin_active(),
           endc = dof_handler.end();
 
@@ -483,13 +534,62 @@ namespace internal
 
 
 
-        template <int dim, int spacedim>
+        // same for the hp::DoFHandler
+        template <int spacedim>
+        static
+        types::global_dof_index
+        distribute_mg_dofs_on_cell (const hp::DoFHandler<1,spacedim>                                &dof_handler,
+                                    const typename hp::DoFHandler<1,spacedim>::active_cell_iterator &cell,
+                                    types::global_dof_index                                          next_free_dof)
+        {
+          (void)dof_handler;
+          (void)cell;
+          (void)next_free_dof;
+          return 0;
+        }
+
+
+
+        template <int spacedim>
+        static
+        types::global_dof_index
+        distribute_mg_dofs_on_cell (const hp::DoFHandler<2,spacedim>                                &dof_handler,
+                                    const typename hp::DoFHandler<2,spacedim>::active_cell_iterator &cell,
+                                    types::global_dof_index                                          next_free_dof)
+        {
+          (void)dof_handler;
+          (void)cell;
+          (void)next_free_dof;
+          return 0;
+        }
+
+
+
+        template <int spacedim>
+        static
+        types::global_dof_index
+        distribute_mg_dofs_on_cell (const hp::DoFHandler<3,spacedim>                                &dof_handler,
+                                    const typename hp::DoFHandler<3,spacedim>::active_cell_iterator &cell,
+                                    types::global_dof_index                                          next_free_dof)
+        {
+          (void)dof_handler;
+          (void)cell;
+          (void)next_free_dof;
+          return 0;
+        }
+
+
+
+        template <typename DoFHandlerType>
         static
         types::global_dof_index
         distribute_dofs_on_level (const types::subdomain_id level_subdomain_id,
-                                  DoFHandler<dim,spacedim> &dof_handler,
+                                  DoFHandlerType           &dof_handler,
                                   const unsigned int        level)
         {
+          const unsigned int dim      = DoFHandlerType::dimension;
+          const unsigned int spacedim = DoFHandlerType::space_dimension;
+
           const dealii::Triangulation<dim,spacedim> &tria
             = dof_handler.get_triangulation();
           Assert (tria.n_levels() > 0, ExcMessage("Empty triangulation"));
@@ -943,6 +1043,32 @@ namespace internal
         }
 
 
+
+        template <int dim, int spacedim>
+        static
+        void
+        renumber_dofs (const std::vector<types::global_dof_index> &/*new_numbers*/,
+                       const IndexSet                             &/*indices*/,
+                       hp::DoFHandler<dim,spacedim>               &/*dof_handler*/,
+                       const bool                                  /*check_validity*/)
+        {
+          Assert (false, ExcNotImplemented());
+        }
+
+
+
+        template <int dim, int spacedim>
+        static
+        void
+        renumber_mg_dofs (const std::vector<dealii::types::global_dof_index> &/*new_numbers*/,
+                          const IndexSet                                     &/*indices*/,
+                          hp::DoFHandler<dim,spacedim>                       &/*dof_handler*/,
+                          const unsigned int                                  /*level*/,
+                          const bool                                          /*check_validity*/)
+        {
+          Assert (false, ExcNotImplemented());
+        }
+
       };
 
 
index 1c75b7be975d4fa2d329a122e85327e98fd22fcc..c9cddc153685eaa91cca2c249d671b89aec4944d 100644 (file)
@@ -24,12 +24,14 @@ for (deal_II_dimension : DIMENSIONS)
     \{
     template class PolicyBase<deal_II_dimension,deal_II_dimension>;
     template class Sequential<dealii::DoFHandler<deal_II_dimension,deal_II_dimension> >;
+    template class Sequential<dealii::hp::DoFHandler<deal_II_dimension,deal_II_dimension> >;
     template class ParallelShared<deal_II_dimension,deal_II_dimension>;
     template class ParallelDistributed<deal_II_dimension,deal_II_dimension>;
 
 #if deal_II_dimension==1 || deal_II_dimension==2
     template class PolicyBase<deal_II_dimension,deal_II_dimension+1>;
     template class Sequential<dealii::DoFHandler<deal_II_dimension,deal_II_dimension+1> >;
+    template class Sequential<dealii::hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >;
     template class ParallelShared<deal_II_dimension,deal_II_dimension+1>;
     template class ParallelDistributed<deal_II_dimension,deal_II_dimension+1>;
 #endif
@@ -37,6 +39,7 @@ for (deal_II_dimension : DIMENSIONS)
 #if deal_II_dimension==3
     template class PolicyBase<1,3>;
     template class Sequential<dealii::DoFHandler<1,3> >;
+    template class Sequential<dealii::hp::DoFHandler<1,3> >;
     template class ParallelShared<1,3>;
     template class ParallelDistributed<1,3>;
 #endif

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.