OISEAU
A modern DGTD framework
Loading...
Searching...
No Matches
ref_element_type.hpp
1// Copyright (C) 2026 Tiago V. L. Amorim (@tiagovla)
2//
3// This file is part of oiseau (https://github.com/tiagovla/oiseau)
4//
5// SPDX-License-Identifier: GPL-3.0-or-later
6
7#pragma once
8
9#include <stdexcept>
10
11#include "oiseau/dg/nodal/ref_element.hpp"
12#include "oiseau/mesh/cell.hpp"
13
14namespace oiseau::dg {
15
22inline nodal::RefElementType ref_type_for(mesh::CellKind kind) {
23 switch (kind) {
24 case mesh::CellKind::Interval:
25 return nodal::RefElementType::Line;
26 case mesh::CellKind::Triangle:
27 return nodal::RefElementType::Triangle;
28 case mesh::CellKind::Quadrilateral:
29 return nodal::RefElementType::Quadrilateral;
30 case mesh::CellKind::Tetrahedron:
31 return nodal::RefElementType::Tetrahedron;
32 case mesh::CellKind::Hexahedron:
33 return nodal::RefElementType::Hexahedron;
34 default:
35 throw std::invalid_argument("Unsupported mesh cell kind for DG reference element");
36 }
37}
38
39} // namespace oiseau::dg