]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify instantiation of DoFHandler and hp::DoFHandler 9811/head
authorPeter Munch <peterrmuench@gmail.com>
Fri, 3 Apr 2020 21:46:50 +0000 (23:46 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Fri, 3 Apr 2020 21:46:50 +0000 (23:46 +0200)
source/dofs/dof_handler.inst.in
source/hp/dof_handler.inst.in

index 39a5ff67ed16258c579c00b9af65eb924b7da979..42ee541349a949854177e60e4b489fd597c29630 100644 (file)
 // ---------------------------------------------------------------------
 
 
-for (deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS)
   {
-    namespace internal
-    \{
-      template const types::global_dof_index *
-      dummy<deal_II_dimension, deal_II_dimension>();
-      template std::string
-      policy_to_string(
-        const dealii::internal::DoFHandlerImplementation::Policy::
-          PolicyBase<deal_II_dimension, deal_II_dimension> &);
+#if deal_II_dimension <= deal_II_space_dimension
+    template class DoFHandler<deal_II_dimension, deal_II_space_dimension>;
 
-#if deal_II_dimension < 3
-      template const types::global_dof_index *
-      dummy<deal_II_dimension, deal_II_dimension + 1>();
-      template std::string
-      policy_to_string(
-        const dealii::internal::DoFHandlerImplementation::Policy::
-          PolicyBase<deal_II_dimension, deal_II_dimension + 1> &);
+    template std::string internal::policy_to_string(
+      const dealii::internal::DoFHandlerImplementation::Policy::
+        PolicyBase<deal_II_dimension, deal_II_space_dimension> &policy);
 #endif
-    \}
-
-
-    template class DoFHandler<deal_II_dimension>;
-
-#if deal_II_dimension < 3
-    template class DoFHandler<deal_II_dimension, deal_II_dimension + 1>;
-#endif
-
-#if deal_II_dimension == 3
-    template class DoFHandler<1, deal_II_dimension>;
-
-    template types::global_dof_index DoFHandler<1, 3>::get_dof_index<1>(
-      const unsigned int obj_level,
-      const unsigned int obj_index,
-      const unsigned int fe_index,
-      const unsigned int local_index) const;
-#endif
-
-    template types::global_dof_index
-    DoFHandler<deal_II_dimension, deal_II_dimension>::get_dof_index<1>(
-      const unsigned int obj_level,
-      const unsigned int obj_index,
-      const unsigned int fe_index,
-      const unsigned int local_index) const;
-
-#if deal_II_dimension < 3
-    template types::global_dof_index
-    DoFHandler<deal_II_dimension, deal_II_dimension + 1>::get_dof_index<1>(
-      const unsigned int obj_level,
-      const unsigned int obj_index,
-      const unsigned int fe_index,
-      const unsigned int local_index) const;
-#endif
-
-#if deal_II_dimension >= 2
-    template types::global_dof_index
-    DoFHandler<deal_II_dimension, deal_II_dimension>::get_dof_index<2>(
-      const unsigned int obj_level,
-      const unsigned int obj_index,
-      const unsigned int fe_index,
-      const unsigned int local_index) const;
+  }
 
-#  if deal_II_dimension < 3
-    template types::global_dof_index
-    DoFHandler<deal_II_dimension, deal_II_dimension + 1>::get_dof_index<2>(
-      const unsigned int obj_level,
-      const unsigned int obj_index,
-      const unsigned int fe_index,
-      const unsigned int local_index) const;
-#  endif
 
-#  if deal_II_dimension >= 3
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS;
+     deal_II_component : DIMENSIONS)
+  {
+#if deal_II_component <= deal_II_dimension && \
+  deal_II_dimension <= deal_II_space_dimension
     template types::global_dof_index
-    DoFHandler<deal_II_dimension, deal_II_dimension>::get_dof_index<3>(
-      const unsigned int obj_level,
-      const unsigned int obj_index,
-      const unsigned int fe_index,
-      const unsigned int local_index) const;
-#  endif
-#endif
-
-    template void
-    DoFHandler<deal_II_dimension, deal_II_dimension>::set_dof_index<1>(
-      const unsigned int            obj_level,
-      const unsigned int            obj_index,
-      const unsigned int            fe_index,
-      const unsigned int            local_index,
-      const types::global_dof_index global_index) const;
-
-#if deal_II_dimension < 3
-    template void
-    DoFHandler<deal_II_dimension, deal_II_dimension + 1>::set_dof_index<1>(
-      const unsigned int            obj_level,
-      const unsigned int            obj_index,
-      const unsigned int            fe_index,
-      const unsigned int            local_index,
-      const types::global_dof_index global_index) const;
-#endif
-
-#if deal_II_dimension < 2
-    template void
-    DoFHandler<deal_II_dimension, deal_II_dimension + 2>::set_dof_index<1>(
-      const unsigned int            obj_level,
-      const unsigned int            obj_index,
-      const unsigned int            fe_index,
-      const unsigned int            local_index,
-      const types::global_dof_index global_index) const;
-#endif
-
-#if deal_II_dimension >= 2
-    template void
-    DoFHandler<deal_II_dimension, deal_II_dimension>::set_dof_index<2>(
-      const unsigned int            obj_level,
-      const unsigned int            obj_index,
-      const unsigned int            fe_index,
-      const unsigned int            local_index,
-      const types::global_dof_index global_index) const;
-
-#  if deal_II_dimension < 3
-    template void
-    DoFHandler<deal_II_dimension, deal_II_dimension + 1>::set_dof_index<2>(
-      const unsigned int            obj_level,
-      const unsigned int            obj_index,
-      const unsigned int            fe_index,
-      const unsigned int            local_index,
-      const types::global_dof_index global_index) const;
-#  endif
+    DoFHandler<deal_II_dimension, deal_II_space_dimension>::get_dof_index<
+      deal_II_component>(const unsigned int obj_level,
+                         const unsigned int obj_index,
+                         const unsigned int fe_index,
+                         const unsigned int local_index) const;
 
-#  if deal_II_dimension >= 3
     template void
-    DoFHandler<deal_II_dimension, deal_II_dimension>::set_dof_index<3>(
-      const unsigned int            obj_level,
-      const unsigned int            obj_index,
-      const unsigned int            fe_index,
-      const unsigned int            local_index,
-      const types::global_dof_index global_index) const;
-#  endif
+    DoFHandler<deal_II_dimension, deal_II_space_dimension>::set_dof_index<
+      deal_II_component>(const unsigned int            obj_level,
+                         const unsigned int            obj_index,
+                         const unsigned int            fe_index,
+                         const unsigned int            local_index,
+                         const types::global_dof_index global_index) const;
 #endif
   }
index 039f6f25181f9c9d17281721d014028c0298ccec..87a0ac500ad805affe1d7a88810e5b67bebf10d8 100644 (file)
 //
 // ---------------------------------------------------------------------
 
-
-for (deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS)
   {
+#if deal_II_dimension <= deal_II_space_dimension
     namespace hp
     \{
-      template class DoFHandler<deal_II_dimension>;
-
-#if deal_II_dimension != 3
-      template class DoFHandler<deal_II_dimension, deal_II_dimension + 1>;
-
-      template types::global_dof_index
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>::get_dof_index<1>(
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const unsigned int) const;
-
-      template void
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>::set_dof_index<1>(
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const types::global_dof_index) const;
-
-#  if deal_II_dimension >= 2
-      template types::global_dof_index
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>::get_dof_index<2>(
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const unsigned int) const;
-
-      template void
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>::set_dof_index<2>(
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const types::global_dof_index) const;
-#  endif
-#endif
-
-#if deal_II_dimension == 3
-      template class DoFHandler<1, 3>;
-
-      template types::global_dof_index
-      DoFHandler<1, 3>::get_dof_index<1>(const unsigned int,
-                                         const unsigned int,
-                                         const unsigned int,
-                                         const unsigned int) const;
-
-      template void
-      DoFHandler<1, 3>::set_dof_index<1>(const unsigned int,
-                                         const unsigned int,
-                                         const unsigned int,
-                                         const unsigned int,
-                                         const types::global_dof_index) const;
-#endif
-
-      template types::global_dof_index
-      DoFHandler<deal_II_dimension>::get_dof_index<1>(const unsigned int,
-                                                      const unsigned int,
-                                                      const unsigned int,
-                                                      const unsigned int) const;
-
-#if deal_II_dimension >= 2
-      template types::global_dof_index
-      DoFHandler<deal_II_dimension>::get_dof_index<2>(const unsigned int,
-                                                      const unsigned int,
-                                                      const unsigned int,
-                                                      const unsigned int) const;
-
-#  if deal_II_dimension >= 3
-      template types::global_dof_index
-      DoFHandler<deal_II_dimension>::get_dof_index<3>(const unsigned int,
-                                                      const unsigned int,
-                                                      const unsigned int,
-                                                      const unsigned int) const;
-#  endif
+      template class DoFHandler<deal_II_dimension, deal_II_space_dimension>;
+    \}
 #endif
+  }
 
-      template void
-      DoFHandler<deal_II_dimension>::set_dof_index<1>(
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const types::global_dof_index) const;
-
-#if deal_II_dimension >= 2
-      template void
-      DoFHandler<deal_II_dimension>::set_dof_index<2>(
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const types::global_dof_index) const;
 
-#  if deal_II_dimension >= 3
-      template void
-      DoFHandler<deal_II_dimension>::set_dof_index<3>(
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const unsigned int,
-        const types::global_dof_index) const;
-#  endif
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS;
+     deal_II_component : DIMENSIONS)
+  {
+#if deal_II_component <= deal_II_dimension && \
+  deal_II_dimension <= deal_II_space_dimension
+    template types::global_dof_index
+    hp::DoFHandler<deal_II_dimension, deal_II_space_dimension>::get_dof_index<
+      deal_II_component>(const unsigned int obj_level,
+                         const unsigned int obj_index,
+                         const unsigned int fe_index,
+                         const unsigned int local_index) const;
+
+    template void
+    hp::DoFHandler<deal_II_dimension, deal_II_space_dimension>::set_dof_index<
+      deal_II_component>(const unsigned int            obj_level,
+                         const unsigned int            obj_index,
+                         const unsigned int            fe_index,
+                         const unsigned int            local_index,
+                         const types::global_dof_index global_index) const;
 #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.