]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify the template signature of DoFRenumbering::compute_component_wise().
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 8 Jul 2017 13:44:13 +0000 (07:44 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 8 Jul 2017 13:44:13 +0000 (07:44 -0600)
We previously had two template arguments because the types of, for example,
DoFHandler::begin_active() and DoFHandler::end() are different. But this makes
no sense. Just cast the end iterator to the same type as the begin iterator.

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

index 094cc4e0bedcca43df91ecce35a792747544a6d5..9c61467a33d850a8e9dc90036e89edabf3bde4ac 100644 (file)
@@ -639,13 +639,13 @@ namespace DoFRenumbering
    * Does not perform the renumbering on the DoFHandler dofs but returns the
    * renumbering vector.
    */
-  template <int dim, int spacedim, class ITERATOR, class ENDITERATOR>
+  template <int dim, int spacedim, typename CellIterator>
   types::global_dof_index
-  compute_component_wise (std::vector<types::global_dof_index> &new_dof_indices,
-                          const ITERATOR &start,
-                          const ENDITERATOR &end,
-                          const std::vector<unsigned int> &target_component,
-                          bool is_level_operation);
+  compute_component_wise (std::vector<types::global_dof_index>        &new_dof_indices,
+                          const CellIterator                          &start,
+                          const typename identity<CellIterator>::type &end,
+                          const std::vector<unsigned int>             &target_component,
+                          const bool                                   is_level_operation);
 
   /**
    * @}
index fe2ac84df706327f566fc3cee07f7eaeea155618..652efdf5e428b412b2769998a868680787ef31b1 100644 (file)
@@ -510,9 +510,7 @@ namespace DoFRenumbering
     end = dof_handler.end();
 
     const types::global_dof_index result =
-      compute_component_wise<DoFHandlerType::dimension,DoFHandlerType::space_dimension,
-      typename DoFHandlerType::active_cell_iterator,
-      typename DoFHandlerType::level_cell_iterator>
+      compute_component_wise<DoFHandlerType::dimension,DoFHandlerType::space_dimension>
       (renumbering, start, end, component_order_arg, false);
     if (result == 0)
       return;
@@ -552,8 +550,7 @@ namespace DoFRenumbering
     typename DoFHandlerType::level_cell_iterator end = dof_handler.end(level);
 
     const types::global_dof_index result =
-      compute_component_wise<DoFHandlerType::dimension, DoFHandlerType::space_dimension,
-      typename DoFHandlerType::level_cell_iterator, typename DoFHandlerType::level_cell_iterator>
+      compute_component_wise<DoFHandlerType::dimension, DoFHandlerType::space_dimension>
       (renumbering, start, end, component_order_arg, true);
 
     if (result == 0) return;
@@ -567,13 +564,13 @@ namespace DoFRenumbering
 
 
 
-  template <int dim, int spacedim, class ITERATOR, class ENDITERATOR>
+  template <int dim, int spacedim, typename CellIterator>
   types::global_dof_index
-  compute_component_wise (std::vector<types::global_dof_index> &new_indices,
-                          const ITERATOR    &start,
-                          const ENDITERATOR &end,
-                          const std::vector<unsigned int> &component_order_arg,
-                          bool is_level_operation)
+  compute_component_wise (std::vector<types::global_dof_index>        &new_indices,
+                          const CellIterator                          &start,
+                          const typename identity<CellIterator>::type &end,
+                          const std::vector<unsigned int>             &component_order_arg,
+                          const bool                                   is_level_operation)
   {
     const hp::FECollection<dim,spacedim>
     fe_collection (start->get_dof_handler().get_fe ());
@@ -653,7 +650,7 @@ namespace DoFRenumbering
     // take care of that
     std::vector<std::vector<types::global_dof_index> >
     component_to_dof_map (fe_collection.n_components());
-    for (ITERATOR cell=start; cell!=end; ++cell)
+    for (CellIterator cell=start; cell!=end; ++cell)
       {
         if (is_level_operation)
           {

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.