]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove deprecated functioins in GridReordering 15611/head
authorDaniel Arndt <arndtd@ornl.gov>
Sun, 2 Jul 2023 04:06:11 +0000 (00:06 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 3 Jul 2023 04:17:03 +0000 (00:17 -0400)
54 files changed:
doc/news/changes/incompatibilities/20230703DanielArndt [new file with mode: 0644]
include/deal.II/base/geometry_info.h
include/deal.II/grid/grid_in.h
include/deal.II/grid/grid_reordering.h [deleted file]
include/deal.II/grid/grid_tools.h
include/deal.II/grid/tria.h
source/grid/CMakeLists.txt
source/grid/grid_generator.cc
source/grid/grid_in.cc
source/grid/grid_reordering.cc [deleted file]
source/grid/grid_tools.cc
tests/aniso/mesh_3d_21.cc
tests/bits/coarsening_3d.cc
tests/bits/cylinder.cc
tests/bits/distorted_cells_01.cc
tests/bits/distorted_cells_02.cc
tests/bits/distorted_cells_06.cc
tests/bits/distorted_cells_07.cc
tests/bits/neighboring_cells_at_two_faces.cc
tests/bits/q_points.cc
tests/data_out/data_out_curved_cells.cc
tests/grid/grid_generator_10.cc
tests/grid/grid_generator_subdivided_cylinder.cc
tests/grid/grid_invert.cc
tests/grid/mesh_3d.h
tests/grid/mesh_3d_1.cc
tests/grid/mesh_3d_10.cc
tests/grid/mesh_3d_11.cc
tests/grid/mesh_3d_12.cc
tests/grid/mesh_3d_13.cc
tests/grid/mesh_3d_14.cc
tests/grid/mesh_3d_15.cc
tests/grid/mesh_3d_16.cc
tests/grid/mesh_3d_17.cc
tests/grid/mesh_3d_2.cc
tests/grid/mesh_3d_20.cc
tests/grid/mesh_3d_21.cc
tests/grid/mesh_3d_3.cc
tests/grid/mesh_3d_4.cc
tests/grid/mesh_3d_5.cc
tests/grid/mesh_3d_6.cc
tests/grid/mesh_3d_7.cc
tests/grid/mesh_3d_8.cc
tests/grid/mesh_3d_9.cc
tests/manifold/transfinite_manifold_08.cc
tests/manifold/transfinite_manifold_09.cc
tests/mappings/mapping_q1_eulerian_01.cc
tests/mappings/mapping_q_eulerian_01.cc
tests/mappings/mapping_q_eulerian_02.cc
tests/mappings/mapping_q_eulerian_03.cc
tests/mappings/mapping_q_eulerian_07.cc
tests/mappings/mapping_q_eulerian_08.cc
tests/mappings/mapping_q_eulerian_11.cc
tests/matrix_free/interpolate_to_mg.cc

diff --git a/doc/news/changes/incompatibilities/20230703DanielArndt b/doc/news/changes/incompatibilities/20230703DanielArndt
new file mode 100644 (file)
index 0000000..880dbf5
--- /dev/null
@@ -0,0 +1,5 @@
+Removed: The deprecated functions GridReordering::reorder_cells()
+and GridReordering::invert_all_cells_of_negative_grid()
+have been removed.
+<br>
+(Daniel Arndt, 2023/07/03)
index bc03da588f3d4de19000a3eac21261af8662d0ad..02e0359a19b75e9859e490e27161fff3f2ff85ef 100644 (file)
@@ -1633,9 +1633,10 @@ struct GeometryInfo<0>
  * Before a list of cells is passed to an object of the Triangulation class
  * for creation of a triangulation, you therefore have to make sure that cells
  * are oriented in a compatible fashion, so that edge directions are globally
- * according to above convention. However, the GridReordering class can do
- * this for you, by reorienting cells and edges of an arbitrary list of input
- * cells that need not be already sorted.
+ * according to above convention. However, the
+ * GridTools::consistently_order_cells() function can do this for you, by
+ * reorienting cells and edges of an arbitrary list of input cells that need not
+ * be already sorted.
  *
  * <h4>Faces</h4>
  *
index 3dd9db7fa84a3ba9b5869e0d124e32bdad4163e5..b49c113775c7620f693de5dd77b4905b0b31d80b 100644 (file)
@@ -278,11 +278,11 @@ struct CellData;
  * have orientations that need to be taken care of.
  *
  * For this reason, the <tt>read_*</tt> functions of this class that read in
- * grids in various input formats call the GridReordering class to bring the
- * order of vertices that define the cells into an ordering that satisfies the
- * requirements of the Triangulation class. Be sure to read the documentation
- * of that class if you experience unexpected problems when reading grids
- * through this class.
+ * grids in various input formats call the GridTools::consistently_order_cells()
+ * function to bring the order of vertices that define the cells into an
+ * ordering that satisfies the requirements of the Triangulation class. Be sure
+ * to read the documentation of that class if you experience unexpected problems
+ * when reading grids through this class.
  *
  *
  * <h3>Dealing with distorted mesh cells</h3>
diff --git a/include/deal.II/grid/grid_reordering.h b/include/deal.II/grid/grid_reordering.h
deleted file mode 100644 (file)
index c536979..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2000 - 2023 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE.md at
-// the top level directory of deal.II.
-//
-// ---------------------------------------------------------------------
-
-#ifndef dealii_grid_reordering_h
-#define dealii_grid_reordering_h
-
-
-#include <deal.II/base/config.h>
-
-#include <deal.II/grid/tria.h>
-
-#include <vector>
-
-DEAL_II_NAMESPACE_OPEN
-
-/**
- * A class implementing various grid reordering algorithms. For more information
- * see the
- * @ref reordering "reordering module".
- *
- * @deprecated Use GridTools::invert_all_negative_measure_cells() or
- * GridTools::consistently_order_cells() instead of the functions provided by
- * this class. Usage of the old-style numbering is deprecated.
- */
-template <int dim, int spacedim = dim>
-class GridReordering
-{
-public:
-  /**
-   * This is the main function, doing what is announced in the general
-   * documentation of this class for dim=2 and 3 and doing nothing for dim=1.
-   *
-   * If a consistent reordering is not possible in dim=3, the original
-   * connectivity data is restored.
-   *
-   * @param original_cells An object that contains the data that describes the
-   * mesh.
-   * @param use_new_style_ordering If true, then use the standard ordering of
-   * vertices within a cell. If false (the default), then use the "old-style"
-   * ordering of vertices within cells used by deal.II before version 5.2 and
-   * as explained in the documentation of this class.
-   *
-   * @deprecated Use GridTools::consistently_order_cells() instead.
-   */
-  DEAL_II_DEPRECATED
-  static void
-  reorder_cells(std::vector<CellData<dim>> &original_cells,
-                const bool                  use_new_style_ordering = false);
-
-  /**
-   * Grids generated by grid generators may have an orientation of cells which
-   * is the inverse of the orientation required by deal.II.
-   *
-   * In 2d and 3d this function checks whether all cells have negative or
-   * positive measure/volume. In the former case, all cells are inverted. It
-   * does nothing in 1d.
-   *
-   * The inversion of cells might also work when only a subset of all cells
-   * have negative volume. However, grids consisting of a mixture of negative
-   * and positively oriented cells are very likely to be broken. Therefore, an
-   * exception is thrown, in case cells are not uniformly oriented.
-   *
-   * Note, that this function should be called before reorder_cells().
-   *
-   * @param all_vertices The vertices of the mesh.
-   * @param original_cells An object that contains the data that describes the
-   * mesh.
-   * @param use_new_style_ordering If true, then use the standard ordering of
-   * vertices within a cell. If false (the default), then use the "old-style"
-   * ordering of vertices within cells used by deal.II before version 5.2 and
-   * as explained in the documentation of this class.
-   *
-   * @deprecated Use GridTools::invert_all_negative_measure_cells() instead.
-   */
-  DEAL_II_DEPRECATED
-  static void
-  invert_all_cells_of_negative_grid(
-    const std::vector<Point<spacedim>> &all_vertices,
-    std::vector<CellData<dim>> &        original_cells,
-    const bool                          use_new_style_ordering = false);
-};
-
-
-// declaration of explicit specializations
-template <>
-void
-GridReordering<2>::invert_all_cells_of_negative_grid(
-  const std::vector<Point<2>> &all_vertices,
-  std::vector<CellData<2>> &   cells,
-  const bool                   use_new_style_ordering);
-
-template <>
-void
-GridReordering<2, 3>::invert_all_cells_of_negative_grid(
-  const std::vector<Point<3>> &all_vertices,
-  std::vector<CellData<2>> &   cells,
-  const bool                   use_new_style_ordering);
-
-template <>
-void
-GridReordering<3>::invert_all_cells_of_negative_grid(
-  const std::vector<Point<3>> &all_vertices,
-  std::vector<CellData<3>> &   cells,
-  const bool                   use_new_style_ordering);
-
-DEAL_II_NAMESPACE_CLOSE
-
-#endif
index cbfa05a523d85091f442358439d554ee9d76f4b3..ffcab4bc166185ccffe33b171e5d40d50d82dc91 100644 (file)
@@ -3827,24 +3827,20 @@ namespace GridTools
                  << "The given vertex with index " << arg1
                  << " is not used in the given triangulation.");
 
+  /**
+   * An exception that is thrown whenever the edges of a mesh are not
+   * orientable.
+   *
+   * @ingroup Exceptions
+   */
+  DeclExceptionMsg(ExcMeshNotOrientable,
+                   "The edges of the mesh are not consistently orientable.");
+
   /** @} */
 
 } /*namespace GridTools*/
 
 
-/**
- * An exception that is thrown whenever the edges of a mesh are not
- * orientable.
- *
- * @note for backwards compatibility with the old GridReordering class this
- * exception is not in the GridTools namespace.
- *
- * @ingroup Exceptions
- */
-DeclExceptionMsg(ExcMeshNotOrientable,
-                 "The edges of the mesh are not consistently orientable.");
-
-
 
 /* ----------------- Template function --------------- */
 
index cd10daeed10ccb60af09c3fb5803fca1e24a62d0..f3b01b39767cbb8a18cfef2a17c3e8e04bd54230 100644 (file)
@@ -555,9 +555,9 @@ namespace internal
  * numbering within cells. They do not only hold for the data read from an UCD
  * or any other input file, but also for the data passed to
  * create_triangulation(). See the documentation for the GridIn class for more
- * details on this, and above all to the GridReordering class that explains
- * many of the problems and an algorithm to reorder cells such that they
- * satisfy the conditions outlined above.
+ * details on this, and above all to the GridTools::consistently_order_cells()
+ * function that explains many of the problems and an algorithm to reorder cells
+ * such that they satisfy the conditions outlined above.
  *
  * <li> Copying a triangulation: when computing on time dependent meshes or
  * when using adaptive refinement, you will often want to create a new
@@ -1838,7 +1838,8 @@ public:
    * constraints; see the general class documentation for this.
    *
    * For conditions when this function can generate a valid triangulation, see
-   * the documentation of this class, and the GridIn and GridReordering class.
+   * the documentation of this class, and the GridIn and
+   * GridTools::consistently_order_cells() function.
    *
    * If the <code>check_for_distorted_cells</code> flag was specified upon
    * creation of this object, at the very end of its operation, the current
index d26cd13bb346711195ff8bba076eb8374295b6fe..3d70ba8095710f43f9019e8eb33da461829b2e92 100644 (file)
@@ -33,7 +33,6 @@ endif()
 set(_unity_include_src
   cell_id.cc
   grid_refinement.cc
-  grid_reordering.cc
   intergrid_map.cc
   manifold.cc
   manifold_lib.cc
index e0a2ed86994372e17341e886efae037c7aa78902..5b911d8088549bb35ba8803a852ab2cbf6ea1991 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <deal.II/grid/filtered_iterator.h>
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/intergrid_map.h>
 #include <deal.II/grid/manifold_lib.h>
index 29b1c9656944d06e5a995fb714084290e48a2c53..92a068b609b183a70f5525bc65cfe08cf5a327cb 100644 (file)
@@ -20,7 +20,6 @@
 #include <deal.II/base/utilities.h>
 
 #include <deal.II/grid/grid_in.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 
diff --git a/source/grid/grid_reordering.cc b/source/grid/grid_reordering.cc
deleted file mode 100644 (file)
index d8aa598..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2000 - 2023 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE.md at
-// the top level directory of deal.II.
-//
-// ---------------------------------------------------------------------
-
-
-#include <deal.II/base/timer.h>
-#include <deal.II/base/utilities.h>
-
-#include <deal.II/grid/grid_reordering.h>
-#include <deal.II/grid/grid_tools.h>
-
-#include <algorithm>
-#include <fstream>
-#include <functional>
-#include <iostream>
-
-DEAL_II_NAMESPACE_OPEN
-
-
-// anonymous namespace for internal helper functions
-namespace
-{
-  /**
-   * This file uses a different ordering for the vertices in a hex
-   * cell than we usually do in deal.II. The different convention used
-   * here originates in what we believed the ordering to be in UCD
-   * format, until it was discovered in 2022 that UCD will interpret
-   * this ordering to correspond to inverted cells -- as a
-   * consequence, the UCD ordering was fixed, but the current file is
-   * stuck on the old ordering.
-   */
-  constexpr std::array<unsigned int, 8> local_vertex_numbering{
-    {0, 1, 5, 4, 2, 3, 7, 6}};
-
-  /**
-   * Following is a set of functions that reorder the data from the
-   * "current" to the "classic" format of vertex numbering of cells
-   * and faces. These functions do the reordering of their arguments
-   * in-place.
-   */
-  void
-  reorder_new_to_old_style(std::vector<CellData<1>> &)
-  {}
-
-
-  void
-  reorder_new_to_old_style(std::vector<CellData<2>> &cells)
-  {
-    for (auto &cell : cells)
-      std::swap(cell.vertices[2], cell.vertices[3]);
-  }
-
-
-  void
-  reorder_new_to_old_style(std::vector<CellData<3>> &cells)
-  {
-    unsigned int tmp[GeometryInfo<3>::vertices_per_cell];
-    for (auto &cell : cells)
-      {
-        for (const unsigned int i : GeometryInfo<3>::vertex_indices())
-          tmp[i] = cell.vertices[i];
-        for (const unsigned int i : GeometryInfo<3>::vertex_indices())
-          cell.vertices[i] = tmp[local_vertex_numbering[i]];
-      }
-  }
-
-
-  /**
-   * And now also in the opposite direction.
-   */
-  void
-  reorder_old_to_new_style(std::vector<CellData<1>> &)
-  {}
-
-
-  void
-  reorder_old_to_new_style(std::vector<CellData<2>> &cells)
-  {
-    // just invert the permutation:
-    reorder_new_to_old_style(cells);
-  }
-
-
-  void
-  reorder_old_to_new_style(std::vector<CellData<3>> &cells)
-  {
-    // undo the ordering above
-    unsigned int tmp[GeometryInfo<3>::vertices_per_cell];
-    for (auto &cell : cells)
-      {
-        for (const unsigned int i : GeometryInfo<3>::vertex_indices())
-          tmp[i] = cell.vertices[i];
-        for (const unsigned int i : GeometryInfo<3>::vertex_indices())
-          cell.vertices[local_vertex_numbering[i]] = tmp[i];
-      }
-  }
-} // namespace
-
-
-
-template <int dim, int spacedim>
-void
-GridReordering<dim, spacedim>::reorder_cells(std::vector<CellData<dim>> &cells,
-                                             const bool use_new_style_ordering)
-{
-  Assert(cells.size() != 0,
-         ExcMessage("List of elements to orient must have at least one cell"));
-
-  // there is nothing for us to do in 1d
-  if (dim == 1)
-    return;
-
-  // if necessary, convert to new-style format
-  if (use_new_style_ordering == false)
-    reorder_old_to_new_style(cells);
-
-  GridTools::consistently_order_cells(cells);
-
-  // and convert back if necessary
-  if (use_new_style_ordering == false)
-    reorder_new_to_old_style(cells);
-}
-
-
-
-template <>
-void
-GridReordering<1>::invert_all_cells_of_negative_grid(
-  const std::vector<Point<1>> &,
-  std::vector<CellData<1>> &,
-  const bool)
-{
-  // nothing to be done in 1d
-}
-
-
-
-template <>
-void
-GridReordering<1, 2>::invert_all_cells_of_negative_grid(
-  const std::vector<Point<2>> &,
-  std::vector<CellData<1>> &,
-  const bool)
-{
-  // nothing to be done in 1d
-}
-
-
-
-template <>
-void
-GridReordering<1, 3>::invert_all_cells_of_negative_grid(
-  const std::vector<Point<3>> &,
-  std::vector<CellData<1>> &,
-  const bool)
-{
-  // nothing to be done in 1d
-}
-
-
-template <>
-void
-GridReordering<2>::invert_all_cells_of_negative_grid(
-  const std::vector<Point<2>> &all_vertices,
-  std::vector<CellData<2>> &   cells,
-  const bool                   use_new_style_ordering)
-{
-  if (!use_new_style_ordering)
-    reorder_old_to_new_style(cells);
-
-  GridTools::invert_all_negative_measure_cells(all_vertices, cells);
-
-  if (!use_new_style_ordering)
-    reorder_new_to_old_style(cells);
-}
-
-
-
-template <>
-void
-GridReordering<2, 3>::invert_all_cells_of_negative_grid(
-  const std::vector<Point<3>> &,
-  std::vector<CellData<2>> &,
-  const bool)
-{
-  Assert(false, ExcNotImplemented());
-}
-
-
-
-template <>
-void
-GridReordering<3>::invert_all_cells_of_negative_grid(
-  const std::vector<Point<3>> &all_vertices,
-  std::vector<CellData<3>> &   cells,
-  const bool                   use_new_style_ordering)
-{
-  if (!use_new_style_ordering)
-    reorder_old_to_new_style(cells);
-
-  GridTools::invert_all_negative_measure_cells(all_vertices, cells);
-
-  if (!use_new_style_ordering)
-    reorder_new_to_old_style(cells);
-}
-
-
-
-/* ------------------------ explicit instantiations ------------------- */
-template class GridReordering<1, 1>;
-template class GridReordering<1, 2>;
-template class GridReordering<1, 3>;
-template class GridReordering<2, 2>;
-template class GridReordering<2, 3>;
-template class GridReordering<3, 3>;
-
-DEAL_II_NAMESPACE_CLOSE
index b8680497eae8a5f012fb4facae15c48fe6b30611..d0cde0410d484557ae5ee676385c7e7a551e06fd 100644 (file)
@@ -41,7 +41,6 @@
 #include <deal.II/fe/mapping_q.h>
 
 #include <deal.II/grid/filtered_iterator.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/grid_tools_cache.h>
 #include <deal.II/grid/manifold.h>
index a3332cc8ba79fa494f05737389e18e3dc40278ab..af5c1f33a557c03cfb1aa37c1d5b3d46ae280b5b 100644 (file)
@@ -28,7 +28,7 @@
 #include <deal.II/fe/mapping_q.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index ac7b6742e4a4bc9264feccb70deb0adc018fc746..738aa9bb08023690fe270751b8a0f147c10eee2c 100644 (file)
@@ -19,7 +19,7 @@
 // functions
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 527a492e48b73ff91bbc4a3e19261f5bff93a7e3..e043db79529a52dda8e38353e6000c55421876cc 100644 (file)
@@ -17,7 +17,8 @@
 // similar to the hyper_ball_3d test, but for the cylinder grid. here,
 // the cause for the failure was different, though: the description of
 // the cells was wrong, and they were not sent through the
-// GridReordering class which would have cured the problem.
+// GridTools::consistently_order_cells() function which would have cured the
+// problem.
 
 
 #include <deal.II/grid/grid_generator.h>
index e7b9298b827c67d92150112454f875ef008bea54..284e573680ffbfbf2b9fee7dc17760d4a120270e 100644 (file)
@@ -26,7 +26,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 6b1cdf0f8156242a389c9aa6b90a0aaa0c11780c..3de85fbdf081bca16e1cfced36f2127ee687f3cf 100644 (file)
@@ -27,7 +27,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_in.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 6255781a0ad2d8ceca6888869a4c490d014001f6..8acb90ffec6099638975df07df27ec391e9643b4 100644 (file)
@@ -27,7 +27,6 @@
 
 #include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_out.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/manifold.h>
 #include <deal.II/grid/tria.h>
index 079a2ac326acc9debad0fac1cf04f30ccb02a5aa..f9edac2f155ffe2cbda13781ff0e043258db39e8 100644 (file)
@@ -26,7 +26,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 7644d105a9d229ce1d97b36efb89505aa9115e07..4ad6151b44f7f5e91196398bc72d2288dbd1857e 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <deal.II/base/geometry_info.h>
 
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
@@ -69,7 +69,7 @@ create_grid(Triangulation<2> &tria)
 
   // generate a triangulation
   // out of this
-  GridReordering<2>::reorder_cells(cells);
+  GridTools::consistently_order_cells(cells);
   try
     {
       tria.create_triangulation_compatibility(vertices, cells, SubCellData());
index 9c5f3c75ea095fd8ab33735f5cede5dfb428b85f..d5b04dd97a9dd144e1149bc281f21d66e8c4c16f 100644 (file)
@@ -29,7 +29,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
@@ -69,7 +69,7 @@ create_two_cubes(Triangulation<3> &coarse_grid)
 
   // finally generate a triangulation
   // out of this
-  GridReordering<3>::reorder_cells(cells);
+  GridTools::consistently_order_cells(cells);
   coarse_grid.create_triangulation_compatibility(vertices,
                                                  cells,
                                                  SubCellData());
index 35a4245915d967cdb9f3d5054b5f2f14998ffe8e..cea603b2999ec2bf263823d86b986f6f181404d6 100644 (file)
@@ -31,7 +31,6 @@
 #include <deal.II/fe/mapping_q_eulerian.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
index f403567903bbb205e02129b33859a13ddcb3bc58..e6fa88d3e8e1d9b94547be64a2a1ebb4cb7a93bd 100644 (file)
 
 
 
-// Test GridReordering<3>::reorder_cells
+// Test GridTools::consistently_order_cells
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_iterator.h>
 
@@ -76,7 +76,7 @@ my_cylinder(Triangulation<3> &tria,
       cells[i].material_id = 0;
     };
 
-  GridReordering<3>::reorder_cells(cells);
+  GridTools::consistently_order_cells(cells);
   tria.create_triangulation(std::vector<Point<3>>(&vertices[0], &vertices[16]),
                             cells,
                             SubCellData()); // no boundary information
index 41c29fcedb51ccefa2bba8f54b5e189e53cbec71..79d59f78261ab0baaee01a84c8dc114b8e697af3 100644 (file)
@@ -15,7 +15,7 @@
 
 
 
-// Test GridReordering<3>::reorder_cells
+// Test GridTools::consistently_order_cells
 
 #include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_out.h>
index 2572c9a36a79b7e8db6202f563072ab92d0de516..d55dfb56d46c194197bf004f0d908140fce833bb 100644 (file)
 #include <deal.II/dofs/dof_handler.h>
 
 #include <deal.II/grid/grid_out.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 
 #include <string>
 
 #include "../tests.h"
 
+namespace
+{
+  /**
+   * This file uses a different ordering for the vertices in a hex
+   * cell than we usually do in deal.II. The different convention used
+   * here originates in what we believed the ordering to be in UCD
+   * format, until it was discovered in 2022 that UCD will interpret
+   * this ordering to correspond to inverted cells -- as a
+   * consequence, the UCD ordering was fixed, but the current file is
+   * stuck on the old ordering.
+   */
+  constexpr std::array<unsigned int, 8> local_vertex_numbering{
+    {0, 1, 5, 4, 2, 3, 7, 6}};
+
+  /**
+   * Following is a set of functions that reorder the data from the
+   * "current" to the "classic" format of vertex numbering of cells
+   * and faces. These functions do the reordering of their arguments
+   * in-place.
+   */
+  void
+  reorder_old_to_new_style(std::vector<CellData<2>> &cells)
+  {
+    for (auto &cell : cells)
+      std::swap(cell.vertices[2], cell.vertices[3]);
+  }
+
+
+  void
+  reorder_old_to_new_style(std::vector<CellData<3>> &cells)
+  {
+    // undo the ordering above
+    unsigned int tmp[GeometryInfo<3>::vertices_per_cell];
+    for (auto &cell : cells)
+      {
+        for (const unsigned int i : GeometryInfo<3>::vertex_indices())
+          tmp[i] = cell.vertices[i];
+        for (const unsigned int i : GeometryInfo<3>::vertex_indices())
+          cell.vertices[local_vertex_numbering[i]] = tmp[i];
+      }
+  }
+} // namespace
+
 template <int dim>
 void
 test(bool second_case = false)
@@ -55,10 +98,12 @@ test(bool second_case = false)
     }
 
   SubCellData subcelldata;
-  GridReordering<dim>::invert_all_cells_of_negative_grid(vertices, cells);
+
+  reorder_old_to_new_style(cells);
+  GridTools::invert_all_negative_measure_cells(vertices, cells);
 
   Triangulation<dim> tria;
-  tria.create_triangulation_compatibility(vertices, cells, subcelldata);
+  tria.create_triangulation(vertices, cells, subcelldata);
 
   std::ostream &logfile = deallog.get_file_stream();
   logfile << "---------------------------------------------" << std::endl
index 8ffd7d2c370f0b8360de1ca2d7bf980bbc2416c5..a7d5d3b317ecd3038f939e9b578644630c2420b1 100644 (file)
@@ -13,7 +13,7 @@
 //
 // ---------------------------------------------------------------------
 
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
 // match up for the standard orientation of the normals. we thus have
 // to store the face orientation in each cell
 
+namespace
+{
+  /**
+   * This file uses a different ordering for the vertices in a hex
+   * cell than we usually do in deal.II. The different convention used
+   * here originates in what we believed the ordering to be in UCD
+   * format, until it was discovered in 2022 that UCD will interpret
+   * this ordering to correspond to inverted cells -- as a
+   * consequence, the UCD ordering was fixed, but the current file is
+   * stuck on the old ordering.
+   */
+  constexpr std::array<unsigned int, 8> local_vertex_numbering{
+    {0, 1, 5, 4, 2, 3, 7, 6}};
+
+  /**
+   * And now also in the opposite direction.
+   */
+  void
+  reorder_old_to_new_style(std::vector<CellData<3>> &cells)
+  {
+    // undo the ordering above
+    unsigned int tmp[GeometryInfo<3>::vertices_per_cell];
+    for (auto &cell : cells)
+      {
+        for (const unsigned int i : GeometryInfo<3>::vertex_indices())
+          tmp[i] = cell.vertices[i];
+        for (const unsigned int i : GeometryInfo<3>::vertex_indices())
+          cell.vertices[local_vertex_numbering[i]] = tmp[i];
+      }
+  }
+} // namespace
+
 void
 create_two_cubes(Triangulation<3> &coarse_grid)
 {
@@ -57,10 +89,10 @@ create_two_cubes(Triangulation<3> &coarse_grid)
 
   // finally generate a triangulation
   // out of this
-  GridReordering<3>::reorder_cells(cells);
-  coarse_grid.create_triangulation_compatibility(vertices,
-                                                 cells,
-                                                 SubCellData());
+  // if necessary, convert to new-style format
+  reorder_old_to_new_style(cells);
+  GridTools::consistently_order_cells(cells);
+  coarse_grid.create_triangulation(vertices, cells, SubCellData());
 }
 
 
@@ -159,10 +191,9 @@ create_L_shape(Triangulation<3> &coarse_grid)
 
   // finally generate a triangulation
   // out of this
-  GridReordering<3>::reorder_cells(cells);
-  coarse_grid.create_triangulation_compatibility(vertices,
-                                                 cells,
-                                                 SubCellData());
+  reorder_old_to_new_style(cells);
+  GridTools::consistently_order_cells(cells);
+  coarse_grid.create_triangulation(vertices, cells, SubCellData());
 }
 
 
index 1d78f2275b25985b2302406a6dca6e791cbf4550..47ee87531eb0eb8f3bf95fbe249606371c3553ed 100644 (file)
@@ -22,7 +22,7 @@
 // coarsening_3d), but we can check this fact much earlier already (done
 // here)
 
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index e58fa8979895ee33f2ae4fef182700c0503c4a84..cb12fbce899fe108d0f03cd1b1c898303c0fbf32 100644 (file)
@@ -29,7 +29,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index ae0e59c7c7001b16adfc75c33320e1c8e5a5573d..36335a844f2dd86475088cea87bed1b22ba7220c 100644 (file)
@@ -30,7 +30,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 210dbfeed42f6a885842a5babb3fd85caeb74218..427f799d6b677853e403d211218abb8addc8a29e 100644 (file)
@@ -29,7 +29,7 @@
 #include <deal.II/fe/fe_q.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index ab52e7bff7ec90b38fc6a4c277cfcb0713cb6b8f..e11e6369973058e44c7df0e76967b77a0fe1fb3f 100644 (file)
@@ -25,7 +25,7 @@
 #include <deal.II/base/quadrature_lib.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index aa761c08119c5e0cd6d9b6c41af63eff69be2e72..2cc5b9c9e49b5b0117b42add4d65e5501e1340fa 100644 (file)
@@ -28,7 +28,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 6f89d0bb7053432240a44a705075e26b50d6b32d..86f63168383af5f4e3d4246a581408f26b3a390c 100644 (file)
@@ -28,7 +28,7 @@
 #include <deal.II/fe/fe_q.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 4ab961ef8ca1173dd26a11f2e97d431f93627303..c238dde5e7f0478384b189bbec8c91bc511913a8 100644 (file)
@@ -28,7 +28,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 2a54cf8051c483d4ae2b29efb48c783f278a8425..6dbbb8afd05e786c4687ee2dabad0ebe8986b674 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <deal.II/grid/grid_in.h>
 #include <deal.II/grid/grid_out.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 6dd1feec9febe1fc065ca259e787df8a43713d2c..d9a5eee45e10498cee167c3567ea08a8094130d4 100644 (file)
@@ -23,7 +23,7 @@
 // this test just checks that such a mesh can be created. further
 // tests check that we are still producing consistent states with this
 
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index c95487e02f744962c2e8979ac53b80704ca79e6c..c148938c4c18c13ba7227b62bc67d6f0bcfa0dbb 100644 (file)
@@ -26,7 +26,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 63507e0ed7776b7c0351fd9f17c638b7657f4924..7c9b27be8ea43da67fe3b6c3727f023706b54af4 100644 (file)
@@ -25,7 +25,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index dac69db1b79332cceaec58ac129d0fbab9312ff9..c70c5c26a6309f312b9a5bb5af4439a7f6daf16a 100644 (file)
@@ -22,7 +22,7 @@
 //
 // for this grid, check that vertex numbers still match up
 
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 98f750251576e7dd607fa42ddb4c497c598ee7ba..ee24e105e81d7f2c8cb9ac7eb045669d3bd606a7 100644 (file)
@@ -19,7 +19,7 @@
 // counting them
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 5e90aa1315bcacf1711daf31555989f9dbf4d03a..9605fc0439cc446b78a3f9be1609b0924509b8e7 100644 (file)
@@ -19,7 +19,7 @@
 // looking at them and checking their children
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index f05968e16126dafb83347a1a2bf4a837e3862204..b565ab6e4af4e9b5a78bd9abbb4ff6cd6841a357 100644 (file)
@@ -27,7 +27,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 36b1c862693c2f896ef6a35ff6149c8cc75e40da..13baa9e4e6867c8a87be7fc9c972212fe83b8088 100644 (file)
@@ -26,7 +26,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 7cd8cb50fc4b6002480edd83290edf0d6d9556f2..6d7c49788627572077119ac54e7088102c1b5bf6 100644 (file)
@@ -28,7 +28,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index cd4ee47e3515cf8eb89e9afafd79c9ce908cb417..15fce9ea983b077a4bc27628e521fc8cd5a9714a 100644 (file)
@@ -29,7 +29,7 @@
 #include <deal.II/fe/fe_values.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
+#include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
index 0dd290ea822d98a83041258e7c23f6be4b4a9cec..e4db06b3ef5b9c2a9ba4d65ea7546e19693c99d4 100644 (file)
@@ -17,7 +17,6 @@
 // This test verifies that the transfinite interpolation works on a cylinder
 // with oblique faces
 
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/manifold_lib.h>
 #include <deal.II/grid/tria.h>
index d80947c783525aa80ec6c7fa091086ce311d76b2..4857783be2fd0a662a0bdc2c1da05852ed067526 100644 (file)
@@ -17,7 +17,6 @@
 // This test verifies that the transfinite interpolation works on a distorted
 // cylinder with some given coordinates
 
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/manifold_lib.h>
 #include <deal.II/grid/tria.h>
index e972a149ea2a57d4aceaa732fa4a4d5685f8f820..723512f3b38e33d7ef81165c129e97fe3a72192c 100644 (file)
@@ -34,7 +34,6 @@
 #include <deal.II/fe/mapping_q1_eulerian.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
index 0d42bb6ead2861bc385d28336f7c1c5564698c4f..7c0de2e18c59184246f894f535ad232fc0d5167a 100644 (file)
@@ -32,7 +32,6 @@
 #include <deal.II/fe/mapping_q_eulerian.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
index 69cfad5565fb439dacd9be6f7876a81b76435988..f216cc97edf81968061e3b6c4c3922013bb48dae 100644 (file)
@@ -34,7 +34,6 @@
 #include <deal.II/fe/mapping_q_eulerian.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
index 90bbf9ca7a3ed0291b4916236b55a420445dfd90..a8f1ada2b3e212a3ff939baf89da9c49df6f0ea1 100644 (file)
@@ -35,7 +35,6 @@
 #include <deal.II/fe/mapping_q_eulerian.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
index 07652bdc79e024040bbe916d53d3eddc4a1391ff..d53ee1e8551b63497dc118231f4e6b8e86905dad 100644 (file)
@@ -35,7 +35,6 @@
 #include <deal.II/fe/mapping_q_eulerian.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
index 75bd58c2a56fb210040a6ad0f7c54bdcc2717342..5139b342ad8f7f6debf4ba678aa836b4cd1e3223 100644 (file)
@@ -37,7 +37,6 @@
 #include <deal.II/fe/mapping_q_eulerian.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
index 8c69e8e12df248bd02147a3ee1d211600fc78ddd..35ca3eac2738f9ea97f307178d006ff4af1bbfab 100644 (file)
@@ -34,7 +34,6 @@
 #include <deal.II/fe/mapping_q_eulerian.h>
 
 #include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>
index 2843c00ec4f764e0fb709e0f9355c231d03804d5..aa60ed9879811064e54c810d5f7670b2e54169e5 100644 (file)
@@ -35,7 +35,6 @@
 
 #include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_out.h>
-#include <deal.II/grid/grid_reordering.h>
 #include <deal.II/grid/grid_tools.h>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/tria_accessor.h>

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.