#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
+#include "../tests/test_grids.h"
void
create_two_cubes(Triangulation<3> &coarse_grid)
#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
+#include "../tests/test_grids.h"
template <int dim>
void
#include "../tests.h"
+#include "../tests/test_grids.h"
// generate two cubes that are attached to each other in a way so that
// the edges are all ok, but the normals of the common face don't
// 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)
{
#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}};
-
- /**
- * 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];
- }
- }
-
- /**
- * 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]);
- }
-} // namespace
+#include "../tests/test_grids.h"
static unsigned subcells[6][4] = {{0, 1, 2, 3},
#include "../tests.h"
+#include "../tests/test_grids.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
void
GridGenerator::subdivided_hyper_rectangle(tr, repetitions, p1, p2);
Assert(tr.n_global_active_cells() == n_cells, ExcInternalError());
}
+
+ /**
+ * In the past, we used a different ordering for the vertices in a hex
+ * cell than we do now. We provide a conversion function to facilitate
+ * updating tests that are using the old ordering.
+ */
+ constexpr std::array<unsigned int, 8> local_vertex_numbering{
+ {0, 1, 5, 4, 2, 3, 7, 6}};
+
+ inline 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];
+ }
+ }
+
+ inline void
+ reorder_old_to_new_style(std::vector<CellData<2>> &cells)
+ {
+ for (auto &cell : cells)
+ std::swap(cell.vertices[2], cell.vertices[3]);
+ }
} // namespace TestGrids