#include <deal.II/grid/grid_out.h>
#include <deal.II/grid/tria.h>
+#include <set>
+
#include "../tests.h"
#include "./simplex_grids.h"
tria.execute_coarsening_and_refinement();
}
+ // verify that all faces have consistently set orientation flags.
+ std::set<std::pair<unsigned int, unsigned int>> all_faces;
+ for (const auto &cell : tria.active_cell_iterators())
+ {
+ const auto v0 = cell->vertex_index(0);
+ const auto v1 = cell->vertex_index(1);
+ const auto v2 = cell->vertex_index(2);
+
+ const auto p0 = cell->face_orientation(0) ? std::make_pair(v0, v1) :
+ std::make_pair(v1, v0);
+ const auto p1 = cell->face_orientation(1) ? std::make_pair(v1, v2) :
+ std::make_pair(v2, v1);
+ const auto p2 = cell->face_orientation(2) ? std::make_pair(v2, v0) :
+ std::make_pair(v0, v2);
+ const auto p0w = std::make_pair(p0.second, p0.first);
+ const auto p1w = std::make_pair(p1.second, p1.first);
+ const auto p2w = std::make_pair(p2.second, p2.first);
+
+ all_faces.insert(p0);
+ all_faces.insert(p1);
+ all_faces.insert(p2);
+
+ if (all_faces.count(p0w) == 1)
+ deallog << "found inconsistent line (" << p0w.first << ", "
+ << p0w.second << ")" << std::endl;
+ if (all_faces.count(p1w) == 1)
+ deallog << "found inconsistent line (" << p1w.first << ", "
+ << p1w.second << ")" << std::endl;
+ if (all_faces.count(p2w) == 1)
+ deallog << "found inconsistent line (" << p2w.first << ", "
+ << p2w.second << ")" << std::endl;
+ }
+
GridOut grid_out;
#if false
std::ofstream out("mesh." + std::to_string(v) + ".vtk");
#include <deal.II/grid/grid_out.h>
#include <deal.II/grid/tria.h>
+#include <set>
+
#include "../tests.h"
#include "./simplex_grids.h"
tria.execute_coarsening_and_refinement();
}
+ // verify that all faces have consistently set orientation flags.
+ std::set<std::pair<unsigned int, unsigned int>> all_faces;
+ for (const auto &cell : tria.active_cell_iterators())
+ {
+ const auto v0 = cell->vertex_index(0);
+ const auto v1 = cell->vertex_index(1);
+ const auto v2 = cell->vertex_index(2);
+
+ const auto p0 = cell->face_orientation(0) ? std::make_pair(v0, v1) :
+ std::make_pair(v1, v0);
+ const auto p1 = cell->face_orientation(1) ? std::make_pair(v1, v2) :
+ std::make_pair(v2, v1);
+ const auto p2 = cell->face_orientation(2) ? std::make_pair(v2, v0) :
+ std::make_pair(v0, v2);
+ const auto p0w = std::make_pair(p0.second, p0.first);
+ const auto p1w = std::make_pair(p1.second, p1.first);
+ const auto p2w = std::make_pair(p2.second, p2.first);
+
+ all_faces.insert(p0);
+ all_faces.insert(p1);
+ all_faces.insert(p2);
+
+ if (all_faces.count(p0w) == 1)
+ deallog << "found inconsistent line (" << p0w.first << ", "
+ << p0w.second << ")" << std::endl;
+ if (all_faces.count(p1w) == 1)
+ deallog << "found inconsistent line (" << p1w.first << ", "
+ << p1w.second << ")" << std::endl;
+ if (all_faces.count(p2w) == 1)
+ deallog << "found inconsistent line (" << p2w.first << ", "
+ << p2w.second << ")" << std::endl;
+ }
+
for (const auto &cell : tria.active_cell_iterators())
{
deallog << cell->level() << ':' << cell->index() << " ";