OGS
MeshEnums.h
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#pragma once
5
6#include <string>
7#include <vector>
8
9namespace MeshLib
10{
11
20
22static constexpr char const* mesh_item_type_strings[] = {
23 "node", "edge", "face", "cell", "integration_point"};
24
26static constexpr char const* toString(const MeshItemType t)
27{
28 return mesh_item_type_strings[static_cast<int>(t)];
29}
30
31std::ostream& operator<<(std::ostream& os, MeshItemType const& t);
32
37enum class MeshElemType
38{
40 POINT = 1,
41 LINE = 3,
42 QUAD = 9,
46 PRISM = 16,
48};
49
53enum class CellType
54{
56 POINT1 = 1,
57 LINE2 = 2,
58 LINE3 = 3,
59 TRI3 = 4,
60 TRI6 = 5,
61 QUAD4 = 6,
62 QUAD8 = 7,
63 QUAD9 = 8,
64 TET4 = 9,
65 TET10 = 10,
66 HEX8 = 11,
67 HEX20 = 12,
68 HEX27 = 13,
69 PRISM6 = 14,
70 PRISM15 = 15,
71 PRISM18 = 16,
75};
76
89
100
102std::string MeshElemType2String(const MeshElemType t);
103
105std::string MeshElemType2StringShort(const MeshElemType t);
106
109MeshElemType String2MeshElemType(const std::string& s);
110
112std::vector<MeshElemType> getMeshElemTypes();
113
115std::vector<std::string> getMeshElemTypeStringsShort();
116
118constexpr unsigned getDimension(MeshElemType t)
119{
120 switch (t)
121 {
123 return 1;
126 return 2;
131 return 3;
134 return 0;
135 }
136 return 0;
137}
138
140std::string CellType2String(const CellType t);
141
142std::string MeshQualityType2String(const MeshQualityType t);
144
145} // namespace MeshLib
MeshElemType String2MeshElemType(const std::string &s)
Definition MeshEnums.cpp:84
CellType
Types of mesh elements supported by OpenGeoSys.
Definition MeshEnums.h:54
static constexpr char const * mesh_item_type_strings[]
Char array names for all of MeshItemType values.
Definition MeshEnums.h:22
MeshLib::MeshQualityType String2MeshQualityType(std::string const &s)
std::string MeshElemType2String(const MeshElemType t)
Given a MeshElemType this returns the appropriate string.
Definition MeshEnums.cpp:10
MeshQualityType
Describes a mesh quality metric.
Definition MeshEnums.h:81
std::vector< MeshElemType > getMeshElemTypes()
Returns a vector of all mesh element types.
std::string MeshElemType2StringShort(const MeshElemType t)
Given a MeshElemType this returns the appropriate string with a short name.
Definition MeshEnums.cpp:47
std::vector< std::string > getMeshElemTypeStringsShort()
Returns a vector of strings of mesh element types.
std::string CellType2String(const CellType t)
Given a MeshElemType this returns the appropriate string.
std::string MeshQualityType2String(const MeshQualityType t)
constexpr unsigned getDimension(MeshElemType t)
Returns the dimension of the given MeshElemType.
Definition MeshEnums.h:118
std::ostream & operator<<(std::ostream &os, Element const &e)
Definition Element.cpp:97
UseIntensityAs
Selection of possible interpretations for intensities.
Definition MeshEnums.h:94
static constexpr char const * toString(const MeshItemType t)
Returns a char array for a specific MeshItemType.
Definition MeshEnums.h:26
MeshElemType
Types of mesh elements supported by OpenGeoSys. Values are from VTKCellType enum.
Definition MeshEnums.h:38