Skip to content
Snippets Groups Projects
Commit 873195ad authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add comprehensive name function for CellType

parent 5b84b716
No related branches found
No related tags found
1 merge request!11Feature/mpi
#ifndef CELL_TYPE_HPP #ifndef CELL_TYPE_HPP
#define CELL_TYPE_HPP #define CELL_TYPE_HPP
#include <PastisMacros.hpp>
#include <string_view>
enum class CellType : unsigned short enum class CellType : unsigned short
{ {
Line = 0, Line = 0,
...@@ -14,6 +17,18 @@ enum class CellType : unsigned short ...@@ -14,6 +17,18 @@ enum class CellType : unsigned short
Hexahedron 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 #endif // CELL_TYPE_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment