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