OGS
VtkOGSEnum.cpp
Go to the documentation of this file.
1
11
#include "
VtkOGSEnum.h
"
12
13
#include <vtkCellType.h>
14
15
#include "
BaseLib/Error.h
"
16
#include "
BaseLib/cpp23.h
"
17
18
int
OGSToVtkCellType
(
MeshLib::CellType
ogs)
19
{
20
switch
(ogs)
21
{
22
case
MeshLib::CellType::POINT1
:
23
return
VTK_VERTEX;
24
case
MeshLib::CellType::LINE2
:
25
return
VTK_LINE;
26
case
MeshLib::CellType::LINE3
:
27
return
VTK_QUADRATIC_EDGE;
28
case
MeshLib::CellType::TRI3
:
29
return
VTK_TRIANGLE;
30
case
MeshLib::CellType::TRI6
:
31
return
VTK_QUADRATIC_TRIANGLE;
32
case
MeshLib::CellType::QUAD4
:
33
return
VTK_QUAD;
34
case
MeshLib::CellType::QUAD8
:
35
return
VTK_QUADRATIC_QUAD;
36
case
MeshLib::CellType::QUAD9
:
37
return
VTK_BIQUADRATIC_QUAD;
38
case
MeshLib::CellType::HEX8
:
39
return
VTK_HEXAHEDRON;
40
case
MeshLib::CellType::HEX20
:
41
return
VTK_QUADRATIC_HEXAHEDRON;
42
case
MeshLib::CellType::HEX27
:
43
return
VTK_TRIQUADRATIC_HEXAHEDRON;
44
case
MeshLib::CellType::TET4
:
45
return
VTK_TETRA;
46
case
MeshLib::CellType::TET10
:
47
return
VTK_QUADRATIC_TETRA;
48
case
MeshLib::CellType::PRISM6
:
49
return
VTK_WEDGE;
50
case
MeshLib::CellType::PRISM15
:
51
return
VTK_QUADRATIC_WEDGE;
52
case
MeshLib::CellType::PRISM18
:
53
return
VTK_BIQUADRATIC_QUADRATIC_WEDGE;
54
case
MeshLib::CellType::PYRAMID5
:
55
return
VTK_PYRAMID;
56
case
MeshLib::CellType::PYRAMID13
:
57
return
VTK_QUADRATIC_PYRAMID;
58
case
MeshLib::CellType::INVALID
:
59
return
-1;
60
default
:
61
OGS_FATAL
(
62
"Unknown cell type in conversion from OGS to VTK. Given cell "
63
"type value is {}."
,
64
BaseLib::to_underlying
(ogs));
65
}
66
}
Error.h
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:26
OGSToVtkCellType
int OGSToVtkCellType(MeshLib::CellType ogs)
Definition
VtkOGSEnum.cpp:18
VtkOGSEnum.h
cpp23.h
BaseLib::to_underlying
constexpr auto to_underlying(E e) noexcept
Converts an enumeration to its underlying type.
Definition
cpp23.h:29
MeshLib::CellType
CellType
Types of mesh elements supported by OpenGeoSys.
Definition
MeshEnums.h:43
MeshLib::CellType::PRISM15
@ PRISM15
MeshLib::CellType::HEX27
@ HEX27
MeshLib::CellType::HEX8
@ HEX8
MeshLib::CellType::QUAD9
@ QUAD9
MeshLib::CellType::HEX20
@ HEX20
MeshLib::CellType::PYRAMID5
@ PYRAMID5
MeshLib::CellType::QUAD4
@ QUAD4
MeshLib::CellType::TRI3
@ TRI3
MeshLib::CellType::LINE3
@ LINE3
MeshLib::CellType::PRISM18
@ PRISM18
MeshLib::CellType::TET4
@ TET4
MeshLib::CellType::POINT1
@ POINT1
MeshLib::CellType::PYRAMID13
@ PYRAMID13
MeshLib::CellType::PRISM6
@ PRISM6
MeshLib::CellType::INVALID
@ INVALID
MeshLib::CellType::TRI6
@ TRI6
MeshLib::CellType::LINE2
@ LINE2
MeshLib::CellType::TET10
@ TET10
MeshLib::CellType::QUAD8
@ QUAD8
MeshLib
VtkOGSEnum.cpp
Generated by
1.11.0