]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify a function declaration. 15255/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 23 May 2023 16:37:18 +0000 (10:37 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 23 May 2023 16:37:18 +0000 (10:37 -0600)
include/deal.II/grid/grid_tools.h
source/grid/grid_tools_dof_handlers.cc

index 45a1ee3c97d6f42a848eaca22e71cd95a58056d1..2fb63134e058467b6194b22b42f49e48c46a355c 100644 (file)
@@ -1460,20 +1460,20 @@ namespace GridTools
    * for this case.
    *
    * @dealiiConceptRequires{
-   *   concepts::is_triangulation_or_dof_handler<MeshType<dim, spacedim>>}
+   *   concepts::is_triangulation_or_dof_handler<MeshType>}
    */
-  template <int dim, template <int, int> class MeshType, int spacedim>
-  DEAL_II_CXX20_REQUIRES(
-    (concepts::is_triangulation_or_dof_handler<MeshType<dim, spacedim>>))
+  template <class MeshType>
+  DEAL_II_CXX20_REQUIRES((concepts::is_triangulation_or_dof_handler<MeshType>))
 #ifndef _MSC_VER
-  std::vector<typename MeshType<dim, spacedim>::active_cell_iterator>
+  std::vector<typename MeshType::active_cell_iterator>
 #else
   std::vector<
-    typename dealii::internal::
-      ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type>
+    typename dealii::internal::ActiveCellIterator<MeshType::dimension,
+                                                  MeshType::space_dimension,
+                                                  MeshType>::type>
 #endif
-    find_cells_adjacent_to_vertex(const MeshType<dim, spacedim> &container,
-                                  const unsigned int             vertex_index);
+    find_cells_adjacent_to_vertex(const MeshType &   container,
+                                  const unsigned int vertex_index);
 
   /**
    * Find an active non-artificial cell that surrounds a given point @p p. The return type
index 8ada7e4b1bb480667875a317ef04292b745b503c..ed10afe884c68fca4f7b6b1ddae9d336970f50ff 100644 (file)
@@ -189,19 +189,22 @@ namespace GridTools
 
 
 
-  template <int dim, template <int, int> class MeshType, int spacedim>
-  DEAL_II_CXX20_REQUIRES(
-    (concepts::is_triangulation_or_dof_handler<MeshType<dim, spacedim>>))
+  template <class MeshType>
+  DEAL_II_CXX20_REQUIRES((concepts::is_triangulation_or_dof_handler<MeshType>))
 #ifndef _MSC_VER
-  std::vector<typename MeshType<dim, spacedim>::active_cell_iterator>
+  std::vector<typename MeshType::active_cell_iterator>
 #else
   std::vector<
-    typename dealii::internal::
-      ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type>
+    typename dealii::internal::ActiveCellIterator<MeshType::dimension,
+                                                  MeshType::space_dimension,
+                                                  MeshType>::type>
 #endif
-    find_cells_adjacent_to_vertex(const MeshType<dim, spacedim> &mesh,
-                                  const unsigned int             vertex)
+    find_cells_adjacent_to_vertex(const MeshType &   mesh,
+                                  const unsigned int vertex)
   {
+    const int dim      = MeshType::dimension;
+    const int spacedim = MeshType::space_dimension;
+
     // make sure that the given vertex is
     // an active vertex of the underlying
     // triangulation
@@ -213,13 +216,12 @@ namespace GridTools
     // to ensure that cells are inserted only
     // once
     std::set<typename dealii::internal::
-               ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type>
+               ActiveCellIterator<dim, spacedim, MeshType>::type>
       adjacent_cells;
 
-    typename dealii::internal::
-      ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type
-        cell = mesh.begin_active(),
-        endc = mesh.end();
+    typename dealii::internal::ActiveCellIterator<dim, spacedim, MeshType>::type
+      cell = mesh.begin_active(),
+      endc = mesh.end();
 
     // go through all active cells and look if the vertex is part of that cell
     //
@@ -322,9 +324,8 @@ namespace GridTools
     Assert(adjacent_cells.size() > 0, ExcInternalError());
 
     // return the result as a vector, rather than the set we built above
-    return std::vector<
-      typename dealii::internal::
-        ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type>(
+    return std::vector<typename dealii::internal::
+                         ActiveCellIterator<dim, spacedim, MeshType>::type>(
       adjacent_cells.begin(), adjacent_cells.end());
   }
 

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.