14#include "oiseau/mesh/cell.hpp"
16namespace oiseau::dg::detail {
19inline std::vector<std::size_t> reference_ordered_vertices(
20 mesh::CellType cell_type, std::span<const std::size_t> mesh_vertices) {
21 if (cell_type ==
nullptr)
throw std::invalid_argument(
"Mesh cell type cannot be null");
22 if (mesh_vertices.size() !=
static_cast<std::size_t
>(cell_type->num_sub_entities(0))) {
23 throw std::invalid_argument(
"Cell connectivity does not match its cell type");
26 std::vector<std::size_t> vertices(mesh_vertices.begin(), mesh_vertices.end());
27 const auto kind = cell_type->kind();
28 if (kind == mesh::CellKind::Quadrilateral || kind == mesh::CellKind::Hexahedron) {
31 std::swap(vertices[2], vertices[3]);
32 if (kind == mesh::CellKind::Hexahedron) std::swap(vertices[6], vertices[7]);