]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove DoFHandlerType from grid_tools.h and trilinos_precondition.h
authorPeter Munch <peterrmuench@gmail.com>
Mon, 29 Jun 2020 06:40:29 +0000 (08:40 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Mon, 29 Jun 2020 06:40:29 +0000 (08:40 +0200)
include/deal.II/grid/grid_tools.h
include/deal.II/lac/trilinos_precondition.h
source/grid/grid_tools_dof_handlers.cc
source/grid/grid_tools_dof_handlers.inst.in

index c0febf279d3d7c7f7f2db5f066f7dcc4e0ee6783..3d6e6fd29adc219ad5a7d6a6e5b1daafe1008b19 100644 (file)
@@ -2398,14 +2398,14 @@ namespace GridTools
 
   /**
    * This function runs through the degrees of freedom defined by the
-   * DoFHandlerType and for each dof constructs a vector of
+   * DoFHandler and for each dof constructs a vector of
    * active_cell_iterators representing the cells of support of the associated
    * basis element at that degree of freedom. This function was originally
    * designed for the implementation of local projections, for instance the
    * Clement interpolant, in conjunction with other local patch functions like
    * GridTools::build_triangulation_from_patch.
    *
-   * DoFHandlerType's built on top of Triangulation or
+   * DoFHandler's built on top of Triangulation or
    * parallel:distributed::Triangulation are supported and handled
    * appropriately.
    *
@@ -2418,21 +2418,20 @@ namespace GridTools
    * consist exclusively of the single cell on which the degree of freedom is
    * located.
    *
-   * @tparam DoFHandlerType The DoFHandlerType should be a DoFHandler or
-   * hp::DoFHandler.
-   * @param[in] dof_handler The DoFHandlerType which could be built on a
+   * @param[in] dof_handler The DoFHandler which could be built on a
    * Triangulation or a parallel::distributed::Triangulation with a finite
    * element that has degrees of freedom that are logically associated to a
    * vertex, line, quad, or hex.
    * @return A map from the global_dof_index of
    * degrees of freedom on locally relevant cells to vectors containing
-   * DoFHandlerType::active_cell_iterators of cells in the support of the basis
+   * DoFHandler::active_cell_iterators of cells in the support of the basis
    * function at that degree of freedom.
    */
-  template <class DoFHandlerType>
-  std::map<types::global_dof_index,
-           std::vector<typename DoFHandlerType::active_cell_iterator>>
-  get_dof_to_support_patch_map(DoFHandlerType &dof_handler);
+  template <int dim, int spacedim>
+  std::map<
+    types::global_dof_index,
+    std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>>
+  get_dof_to_support_patch_map(DoFHandler<dim, spacedim> &dof_handler);
 
 
   /*@}*/
index 986a309aba2c6c314c4e65ce39eafcfa84bdac85..e4b5b471eb22cad5f485e328f32d848d76b10209 100644 (file)
@@ -1366,7 +1366,7 @@ namespace TrilinosWrappers
        *   #include <deal.II/dofs/dof_tools.h>
        *   ...
        *
-       *   DoFHandlerType<...> dof_handler;
+       *   DoFHandler<...> dof_handler;
        *   FEValuesExtractors::Type... field_extractor;
        *   ...
        *
index 2933623d74ab28e0f3540a5e73e02efad3bfdc03..8f782e61bf7b2e1bf885b136d2faf732d6dce2b6 100644 (file)
@@ -1706,10 +1706,11 @@ namespace GridTools
 
 
 
-  template <class DoFHandlerType>
-  std::map<types::global_dof_index,
-           std::vector<typename DoFHandlerType::active_cell_iterator>>
-  get_dof_to_support_patch_map(DoFHandlerType &dof_handler)
+  template <int dim, int spacedim>
+  std::map<
+    types::global_dof_index,
+    std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>>
+  get_dof_to_support_patch_map(DoFHandler<dim, spacedim> &dof_handler)
   {
     // This is the map from global_dof_index to
     // a set of cells on patch.  We first map into
@@ -1722,7 +1723,7 @@ namespace GridTools
     // since that is the preferred output for other
     // functions.
     std::map<types::global_dof_index,
-             std::set<typename DoFHandlerType::active_cell_iterator>>
+             std::set<typename DoFHandler<dim, spacedim>::active_cell_iterator>>
       dof_to_set_of_cells_map;
 
     std::vector<types::global_dof_index> local_dof_indices;
@@ -1736,22 +1737,21 @@ namespace GridTools
 
     // in 3d, we need pointers from active lines to the
     // active parent lines, so we construct it as needed.
-    std::map<typename DoFHandlerType::active_line_iterator,
-             typename DoFHandlerType::line_iterator>
+    std::map<typename DoFHandler<dim, spacedim>::active_line_iterator,
+             typename DoFHandler<dim, spacedim>::line_iterator>
       lines_to_parent_lines_map;
-    if (DoFHandlerType::dimension == 3)
+    if (dim == 3)
       {
         // save user flags as they will be modified and then later restored
         dof_handler.get_triangulation().save_user_flags(user_flags);
-        const_cast<dealii::Triangulation<DoFHandlerType::dimension,
-                                         DoFHandlerType::space_dimension> &>(
+        const_cast<dealii::Triangulation<dim, spacedim> &>(
           dof_handler.get_triangulation())
           .clear_user_flags();
 
 
-        typename DoFHandlerType::active_cell_iterator cell = dof_handler
-                                                               .begin_active(),
-                                                      endc = dof_handler.end();
+        typename DoFHandler<dim, spacedim>::active_cell_iterator
+          cell = dof_handler.begin_active(),
+          endc = dof_handler.end();
         for (; cell != endc; ++cell)
           {
             // We only want lines that are locally_relevant
@@ -1760,9 +1760,7 @@ namespace GridTools
             // few and we don't have to use them.
             if (cell->is_artificial() == false)
               {
-                for (unsigned int l = 0;
-                     l <
-                     GeometryInfo<DoFHandlerType::dimension>::lines_per_cell;
+                for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell;
                      ++l)
                   if (cell->line(l)->has_children())
                     for (unsigned int c = 0; c < cell->line(l)->n_children();
@@ -1785,9 +1783,9 @@ namespace GridTools
     // which it is a part, mainly the ones that must
     // be added on account of adaptivity hanging node
     // constraints.
-    typename DoFHandlerType::active_cell_iterator cell =
-                                                    dof_handler.begin_active(),
-                                                  endc = dof_handler.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
     for (; cell != endc; ++cell)
       {
         // Need to loop through all cells that could
@@ -1812,8 +1810,7 @@ namespace GridTools
             // face (or line).
 
             // Take care of dofs on neighbor faces
-            for (const unsigned int f :
-                 GeometryInfo<DoFHandlerType::dimension>::face_indices())
+            for (const unsigned int f : GeometryInfo<dim>::face_indices())
               {
                 if (cell->face(f)->has_children())
                   {
@@ -1918,11 +1915,9 @@ namespace GridTools
             // if cell's line has an active parent, then
             // distribute cell to dofs on parent line
             // and dofs on all children of parent line.
-            if (DoFHandlerType::dimension == 3)
+            if (dim == 3)
               {
-                for (unsigned int l = 0;
-                     l <
-                     GeometryInfo<DoFHandlerType::dimension>::lines_per_cell;
+                for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell;
                      ++l)
                   {
                     if (cell->line(l)->has_children())
@@ -1955,8 +1950,9 @@ namespace GridTools
                     // children
                     else if (cell->line(l)->user_flag_set() == true)
                       {
-                        typename DoFHandlerType::line_iterator parent_line =
-                          lines_to_parent_lines_map[cell->line(l)];
+                        typename DoFHandler<dim, spacedim>::line_iterator
+                          parent_line =
+                            lines_to_parent_lines_map[cell->line(l)];
                         Assert(parent_line->has_children(), ExcInternalError());
 
                         // dofs_per_line returns number of dofs
@@ -1991,30 +1987,31 @@ namespace GridTools
                           }
                       }
                   } // for lines l
-              }     // if DoFHandlerType::dimension == 3
+              }     // if dim == 3
           }         // if cell->is_locally_owned()
       }             // for cells
 
 
-    if (DoFHandlerType::dimension == 3)
+    if (dim == 3)
       {
         // finally, restore user flags that were changed above
         // to when we constructed the pointers to parent of lines
         // Since dof_handler is const, we must leave it unchanged.
-        const_cast<dealii::Triangulation<DoFHandlerType::dimension,
-                                         DoFHandlerType::space_dimension> &>(
+        const_cast<dealii::Triangulation<dim, spacedim> &>(
           dof_handler.get_triangulation())
           .load_user_flags(user_flags);
       }
 
     // Finally, we copy map of sets to
     // map of vectors using the std::vector::assign() function
-    std::map<types::global_dof_index,
-             std::vector<typename DoFHandlerType::active_cell_iterator>>
+    std::map<
+      types::global_dof_index,
+      std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>>
       dof_to_cell_patches;
 
-    typename std::map<types::global_dof_index,
-                      std::set<typename DoFHandlerType::active_cell_iterator>>::
+    typename std::map<
+      types::global_dof_index,
+      std::set<typename DoFHandler<dim, spacedim>::active_cell_iterator>>::
       iterator it     = dof_to_set_of_cells_map.begin(),
                it_end = dof_to_set_of_cells_map.end();
     for (; it != it_end; ++it)
index a8df05c2c5ef7fe2d56d1423301f89d2f1c081f2..18920f929e52aaee93c7a2e7c0dd71eae1944c34 100644 (file)
@@ -216,8 +216,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS;
 
 
 
-for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS;
-     Container : DOFHANDLER_TEMPLATE)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
   {
 #if deal_II_dimension <= deal_II_space_dimension
     namespace GridTools
@@ -225,11 +224,10 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS;
 
       template std::map<
         types::global_dof_index,
-        std::vector<Container<deal_II_dimension,
-                              deal_II_space_dimension>::active_cell_iterator>>
-      get_dof_to_support_patch_map<
-        Container<deal_II_dimension, deal_II_space_dimension>>(
-        Container<deal_II_dimension, deal_II_space_dimension> &dof_handler);
+        std::vector<DoFHandler<deal_II_dimension,
+                               deal_II_space_dimension>::active_cell_iterator>>
+      get_dof_to_support_patch_map<deal_II_dimension, deal_II_space_dimension>(
+        DoFHandler<deal_II_dimension, deal_II_space_dimension> &dof_handler);
 
     \}
 #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.