]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Change argument of DoFRenumbering::downstream() to Tensor<1,dim>.
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 24 Oct 2017 04:03:57 +0000 (22:03 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 24 Oct 2017 13:54:50 +0000 (07:54 -0600)
That's because this kind of argument indicates a *direction*, not a point, and
for the former Tensor<1,dim> is the correct data type.

include/deal.II/dofs/dof_renumbering.h
source/dofs/dof_renumbering.cc
source/dofs/dof_renumbering.inst.in

index e79b96b3479a865ab82b2c512233fca1e17336f4..f7f7694f122a561dafb1e832e50ad9f9e0c1b24a 100644 (file)
@@ -831,9 +831,9 @@ namespace DoFRenumbering
    * numbering is performed cell-wise, otherwise it is performed based on the
    * location of the support points.
    *
-   * The cells are sorted such that the centers of higher numbers are further
+   * The cells are sorted such that the centers of cells numbered higher are further
    * downstream with respect to the constant vector @p direction than the
-   * centers of lower numbers. Even if this yields a downstream numbering with
+   * centers of of cells numbered lower. Even if this yields a downstream numbering with
    * respect to the flux on the edges for fairly general grids, this might not
    * be guaranteed for all meshes.
    *
@@ -852,48 +852,48 @@ namespace DoFRenumbering
    */
   template <typename DoFHandlerType>
   void
-  downstream (DoFHandlerType                               &dof_handler,
-              const Point<DoFHandlerType::space_dimension> &direction,
-              const bool                                    dof_wise_renumbering = false);
+  downstream (DoFHandlerType                                  &dof_handler,
+              const Tensor<1,DoFHandlerType::space_dimension> &direction,
+              const bool                                       dof_wise_renumbering = false);
 
 
   /**
    * Cell-wise downstream numbering with respect to a constant flow direction
-   * on one level. See the other function with the same name.
+   * on one level of a multigrid hierarchy. See the other function with the same name.
    */
   template <typename DoFHandlerType>
   void
-  downstream (DoFHandlerType                               &dof_handler,
-              const unsigned int                            level,
-              const Point<DoFHandlerType::space_dimension> &direction,
-              const bool                                    dof_wise_renumbering = false);
+  downstream (DoFHandlerType                                  &dof_handler,
+              const unsigned int                               level,
+              const Tensor<1,DoFHandlerType::space_dimension> &direction,
+              const bool                                       dof_wise_renumbering = false);
 
   /**
-   * Compute the renumbering vector needed by the downstream() function. Does
+   * Compute the set of renumbering indices needed by the downstream() function. Does
    * not perform the renumbering on the DoFHandler dofs but returns the
    * renumbering vector.
    */
   template <typename DoFHandlerType>
   void
-  compute_downstream (std::vector<types::global_dof_index>         &new_dof_indices,
-                      std::vector<types::global_dof_index>         &reverse,
-                      const DoFHandlerType                         &dof_handler,
-                      const Point<DoFHandlerType::space_dimension> &direction,
-                      const bool                                    dof_wise_renumbering);
+  compute_downstream (std::vector<types::global_dof_index>            &new_dof_indices,
+                      std::vector<types::global_dof_index>            &reverse,
+                      const DoFHandlerType                            &dof_handler,
+                      const Tensor<1,DoFHandlerType::space_dimension> &direction,
+                      const bool                                       dof_wise_renumbering);
 
   /**
-   * Compute the renumbering vector needed by the downstream() function. Does
+   * Compute the set of renumbering indices needed by the downstream() function. Does
    * not perform the renumbering on the DoFHandler dofs but returns the
    * renumbering vector.
    */
   template <typename DoFHandlerType>
   void
-  compute_downstream (std::vector<types::global_dof_index>         &new_dof_indices,
-                      std::vector<types::global_dof_index>         &reverse,
-                      const DoFHandlerType                         &dof_handler,
-                      const unsigned int                            level,
-                      const Point<DoFHandlerType::space_dimension> &direction,
-                      const bool                                    dof_wise_renumbering);
+  compute_downstream (std::vector<types::global_dof_index>            &new_dof_indices,
+                      std::vector<types::global_dof_index>            &reverse,
+                      const DoFHandlerType                            &dof_handler,
+                      const unsigned int                               level,
+                      const Tensor<1,DoFHandlerType::space_dimension> &direction,
+                      const bool                                       dof_wise_renumbering);
 
   /**
    * Cell-wise clockwise numbering.
@@ -910,8 +910,8 @@ namespace DoFRenumbering
                 const bool                                    counter = false);
 
   /**
-   * Cell-wise clockwise numbering on one level. See the other function with
-   * the same name.
+   * Cell-wise clockwise numbering on one level of a multigrid
+   * hierarchy. See the other function with the same name.
    */
   template <typename DoFHandlerType>
   void
@@ -1100,28 +1100,6 @@ namespace DoFRenumbering
   DeclException0 (ExcNotDGFEM);
 }
 
-/* ------------------------- inline functions -------------- */
-
-#ifndef DOXYGEN
-namespace DoFRenumbering
-{
-  template <typename DoFHandlerType>
-  void
-  inline
-  downstream (DoFHandlerType                               &dof,
-              const Point<DoFHandlerType::space_dimension> &direction,
-              const bool                                    dof_wise_renumbering)
-  {
-    std::vector<types::global_dof_index> renumbering(dof.n_dofs());
-    std::vector<types::global_dof_index> reverse(dof.n_dofs());
-    compute_downstream(renumbering, reverse, dof, direction,
-                       dof_wise_renumbering);
-
-    dof.renumber_dofs(renumbering);
-  }
-}
-#endif
-
 
 DEAL_II_NAMESPACE_CLOSE
 
index 0786896e6a39b7c6f5fd85459e0b7c5cc5ff0d4a..2788416f46d88a3568f9b3d6c429ff0ccf3a9bfe 100644 (file)
@@ -1487,18 +1487,30 @@ namespace DoFRenumbering
 
 
 
+  template <typename DoFHandlerType>
+  void
+  downstream (DoFHandlerType                                  &dof,
+              const Tensor<1,DoFHandlerType::space_dimension> &direction,
+              const bool                                       dof_wise_renumbering)
+  {
+    std::vector<types::global_dof_index> renumbering(dof.n_dofs());
+    std::vector<types::global_dof_index> reverse(dof.n_dofs());
+    compute_downstream(renumbering, reverse, dof, direction,
+                       dof_wise_renumbering);
 
+    dof.renumber_dofs(renumbering);
+  }
 
 
 
   template <typename DoFHandlerType>
   void
   compute_downstream
-  (std::vector<types::global_dof_index>         &new_indices,
-   std::vector<types::global_dof_index>         &reverse,
-   const DoFHandlerType                         &dof,
-   const Point<DoFHandlerType::space_dimension> &direction,
-   const bool                                    dof_wise_renumbering)
+  (std::vector<types::global_dof_index>            &new_indices,
+   std::vector<types::global_dof_index>            &reverse,
+   const DoFHandlerType                            &dof,
+   const Tensor<1,DoFHandlerType::space_dimension> &direction,
+   const bool                                       dof_wise_renumbering)
   {
     if (dof_wise_renumbering == false)
       {
@@ -1583,10 +1595,10 @@ namespace DoFRenumbering
 
 
   template <typename DoFHandlerType>
-  void downstream (DoFHandlerType                               &dof,
-                   const unsigned int                            level,
-                   const Point<DoFHandlerType::space_dimension> &direction,
-                   const bool                                    dof_wise_renumbering)
+  void downstream (DoFHandlerType                                  &dof,
+                   const unsigned int                               level,
+                   const Tensor<1,DoFHandlerType::space_dimension> &direction,
+                   const bool                                       dof_wise_renumbering)
   {
     std::vector<types::global_dof_index> renumbering(dof.n_dofs(level));
     std::vector<types::global_dof_index> reverse(dof.n_dofs(level));
@@ -1601,12 +1613,12 @@ namespace DoFRenumbering
   template <typename DoFHandlerType>
   void
   compute_downstream
-  (std::vector<types::global_dof_index>         &new_indices,
-   std::vector<types::global_dof_index>         &reverse,
-   const DoFHandlerType                         &dof,
-   const unsigned int                            level,
-   const Point<DoFHandlerType::space_dimension> &direction,
-   const bool                                    dof_wise_renumbering)
+  (std::vector<types::global_dof_index>            &new_indices,
+   std::vector<types::global_dof_index>            &reverse,
+   const DoFHandlerType                            &dof,
+   const unsigned int                               level,
+   const Tensor<1,DoFHandlerType::space_dimension> &direction,
+   const bool                                       dof_wise_renumbering)
   {
     if (dof_wise_renumbering == false)
       {
index 8ba908e2e5e5f69292acf93d818f8b67dd7f8a89..b76ea6a0b6dd9adba41b05fcc4bd3071db186ac4 100644 (file)
@@ -198,7 +198,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
     template void
     compute_downstream<DoFHandler<deal_II_dimension> >
     (std::vector<types::global_dof_index>&,std::vector<types::global_dof_index>&,
-     const DoFHandler<deal_II_dimension>&, const Point<deal_II_dimension>&,
+     const DoFHandler<deal_II_dimension>&, const Tensor<1,deal_II_dimension>&,
      const bool);
 
     template
@@ -229,7 +229,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
     compute_downstream<hp::DoFHandler<deal_II_dimension> >
     (std::vector<types::global_dof_index>&,std::vector<types::global_dof_index>&,
      const hp::DoFHandler<deal_II_dimension>&,
-     const Point<deal_II_dimension>&,
+     const Tensor<1,deal_II_dimension>&,
      const bool);
 
     template
@@ -252,7 +252,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
     void downstream
     (DoFHandler<deal_II_dimension>&,
      const unsigned int,
-     const Point<deal_II_dimension>&,
+     const Tensor<1,deal_II_dimension>&,
      const bool);
 
     template

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.