diff --git a/src/mesh/CellType.hpp b/src/mesh/CellType.hpp index 05bd8320e4dc2742c8f7b86ef371a3dc44c40b56..5864210068349ffddf18b458a0df991112efa21c 100644 --- a/src/mesh/CellType.hpp +++ b/src/mesh/CellType.hpp @@ -1,6 +1,9 @@ #ifndef CELL_TYPE_HPP #define CELL_TYPE_HPP +#include <PastisMacros.hpp> +#include <string_view> + enum class CellType : unsigned short { Line = 0, @@ -14,6 +17,18 @@ enum class CellType : unsigned short Hexahedron }; - +PASTIS_INLINE +std::string_view name(const CellType& cell_type) +{ + switch (cell_type) { + case CellType::Line: return "line"; + case CellType::Triangle: return "triangle"; + case CellType::Quadrangle: return "quadrangle"; + case CellType::Tetrahedron: return "tetrahedron"; + case CellType::Pyramid: return "pyramid"; + case CellType::Prism: return "prism"; + case CellType::Hexahedron: return "hexahedron"; + } +} #endif // CELL_TYPE_HPP