]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move another function to grid_tools_geometry.h.
authorDavid Wells <drwells@email.unc.edu>
Thu, 19 Oct 2023 13:49:14 +0000 (09:49 -0400)
committerDavid Wells <drwells@email.unc.edu>
Thu, 19 Oct 2023 16:18:09 +0000 (12:18 -0400)
include/deal.II/grid/grid_tools.h
include/deal.II/grid/grid_tools_geometry.h
source/grid/grid_tools.cc
source/grid/grid_tools.inst.in
source/grid/grid_tools_geometry.cc
source/grid/grid_tools_geometry.inst.in

index b1aa321e4d70dcc994321101880a411b558c6220..d8fe63670696a4f87147e77601d4e7ea9b3bffbf 100644 (file)
@@ -2112,22 +2112,6 @@ namespace GridTools
   compute_local_to_global_vertex_index_map(
     const parallel::distributed::Triangulation<dim, spacedim> &triangulation);
 
-  /**
-   * Return the highest value among ratios between extents in each of the
-   * coordinate directions of a @p cell. Moreover, return the dimension
-   * relative to the highest elongation.
-   *
-   * @param[in] cell an iterator pointing to the cell.
-   *
-   * @return  A std::pair<unsigned int, double> such that the @p first value
-   * is the dimension of the highest elongation and the @p second value is the
-   * ratio among the dimensions of the @p cell.
-   */
-  template <int dim, int spacedim>
-  std::pair<unsigned int, double>
-  get_longest_direction(
-    typename Triangulation<dim, spacedim>::active_cell_iterator cell);
-
   /** @} */
   /**
    * @name Partitions and subdomains of triangulations
index 53b8bd5773d980e8d2416b0b980122a6cccfc990..5c7879503a4232d4733eee34970dbca0ccbef5a4 100644 (file)
@@ -31,6 +31,7 @@
 #include <algorithm>
 #include <array>
 #include <cmath>
+#include <utility>
 #include <vector>
 
 DEAL_II_NAMESPACE_OPEN
@@ -181,6 +182,22 @@ namespace GridTools
   cell_measure(const std::vector<Point<dim>>       &all_vertices,
                const ArrayView<const unsigned int> &vertex_indices);
 
+  /**
+   * Return the highest value among ratios between extents in each of the
+   * coordinate directions of a @p cell. Moreover, return the dimension
+   * relative to the highest elongation.
+   *
+   * @param[in] cell an iterator pointing to the cell.
+   *
+   * @return  A std::pair<unsigned int, double> such that the @p first value
+   * is the dimension of the highest elongation and the @p second value is the
+   * ratio among the dimensions of the @p cell.
+   */
+  template <int dim, int spacedim>
+  std::pair<unsigned int, double>
+  get_longest_direction(
+    typename Triangulation<dim, spacedim>::active_cell_iterator cell);
+
   /**
    * This function computes an affine approximation of the map from the unit
    * coordinates to the real coordinates of the form $p_\text{real} = A
index cec677b5cbf0d866be2ebe0df69c2fda269f6d3d..e21c012af94c128dfac18534739222e7bde37772 100644 (file)
@@ -4803,38 +4803,6 @@ namespace GridTools
 
 
 
-  template <int dim, int spacedim>
-  std::pair<unsigned int, double>
-  get_longest_direction(
-    typename Triangulation<dim, spacedim>::active_cell_iterator cell)
-  {
-    double       max_ratio = 1;
-    unsigned int index     = 0;
-
-    for (unsigned int i = 0; i < dim; ++i)
-      for (unsigned int j = i + 1; j < dim; ++j)
-        {
-          unsigned int ax      = i % dim;
-          unsigned int next_ax = j % dim;
-
-          double ratio =
-            cell->extent_in_direction(ax) / cell->extent_in_direction(next_ax);
-
-          if (ratio > max_ratio)
-            {
-              max_ratio = ratio;
-              index     = ax;
-            }
-          else if (1.0 / ratio > max_ratio)
-            {
-              max_ratio = 1.0 / ratio;
-              index     = next_ax;
-            }
-        }
-    return std::make_pair(index, max_ratio);
-  }
-
-
   template <int dim, int spacedim>
   void
   remove_hanging_nodes(Triangulation<dim, spacedim> &tria,
index 4824f738883d84d027a21bf6a36bcb53d718c6b2..3f4fd209e71af04331a5c8c28d876798c5fd4df7 100644 (file)
@@ -498,42 +498,6 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
 #endif
   }
 
-
-for (deal_II_dimension : DIMENSIONS)
-  {
-    template std::pair<unsigned int, double>
-      GridTools::get_longest_direction<deal_II_dimension, deal_II_dimension>(
-        Triangulation<deal_II_dimension>::active_cell_iterator);
-
-    template void
-    GridTools::remove_hanging_nodes<deal_II_dimension, deal_II_dimension>(
-      Triangulation<deal_II_dimension> & tria, bool, unsigned int);
-
-    template void
-    GridTools::remove_anisotropy<deal_II_dimension, deal_II_dimension>(
-      Triangulation<deal_II_dimension> &, double, unsigned int);
-
-#if deal_II_dimension < 3
-    template std::pair<unsigned int, double>
-      GridTools::get_longest_direction<deal_II_dimension,
-                                       deal_II_dimension + 1>(
-        Triangulation<deal_II_dimension,
-                      deal_II_dimension + 1>::active_cell_iterator);
-
-    template void
-    GridTools::remove_hanging_nodes<deal_II_dimension, deal_II_dimension + 1>(
-      Triangulation<deal_II_dimension, deal_II_dimension + 1> & tria,
-      bool,
-      unsigned int);
-
-    template void
-    GridTools::remove_anisotropy<deal_II_dimension, deal_II_dimension + 1>(
-      Triangulation<deal_II_dimension, deal_II_dimension + 1> &,
-      double,
-      unsigned int);
-#endif
-  }
-
 for (deal_II_vec : REAL_NONBLOCK_VECTORS; deal_II_dimension : DIMENSIONS)
   {
     template class GridTools::MarchingCubeAlgorithm<deal_II_dimension,
index fd20d885730e307c98313e574bee6c7c394f9778..51104b17fa27dc0b46510162774f189bf56e4ee0 100644 (file)
@@ -158,6 +158,39 @@ namespace GridTools
 
 
 
+  template <int dim, int spacedim>
+  std::pair<unsigned int, double>
+  get_longest_direction(
+    typename Triangulation<dim, spacedim>::active_cell_iterator cell)
+  {
+    double       max_ratio = 1;
+    unsigned int index     = 0;
+
+    for (unsigned int i = 0; i < dim; ++i)
+      for (unsigned int j = i + 1; j < dim; ++j)
+        {
+          unsigned int ax      = i % dim;
+          unsigned int next_ax = j % dim;
+
+          double ratio =
+            cell->extent_in_direction(ax) / cell->extent_in_direction(next_ax);
+
+          if (ratio > max_ratio)
+            {
+              max_ratio = ratio;
+              index     = ax;
+            }
+          else if (1.0 / ratio > max_ratio)
+            {
+              max_ratio = 1.0 / ratio;
+              index     = next_ax;
+            }
+        }
+    return std::make_pair(index, max_ratio);
+  }
+
+
+
   namespace
   {
     /**
index 5695304d95b5a3cb033dd01bf5bbbb7d377b66e0..49befa1ffdeb0dae97aead710d740ec88de71e31 100644 (file)
@@ -71,3 +71,18 @@ for (deal_II_space_dimension : SPACE_DIMENSIONS)
         const Quadrature<deal_II_space_dimension> &);
     \}
   }
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template std::pair<unsigned int, double>
+      GridTools::get_longest_direction<deal_II_dimension, deal_II_dimension>(
+        Triangulation<deal_II_dimension>::active_cell_iterator);
+
+#if deal_II_dimension < 3
+    template std::pair<unsigned int, double>
+      GridTools::get_longest_direction<deal_II_dimension,
+                                       deal_II_dimension + 1>(
+        Triangulation<deal_II_dimension,
+                      deal_II_dimension + 1>::active_cell_iterator);
+#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.