GEOSX
ElementType.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_MESH_ELEMENTTYPE_HPP
20 #define GEOS_MESH_ELEMENTTYPE_HPP
21 
22 #include "codingUtilities/EnumStrings.hpp"
23 
24 namespace geos
25 {
26 
30 enum class ElementType : integer
31 {
32  Vertex,
33  Line,
34  Triangle,
36  Polygon,
37  Tetrahedron,
38  Pyramid,
39  Wedge,
40  Hexahedron,
41  Prism5,
42  Prism6,
43  Prism7,
44  Prism8,
45  Prism9,
46  Prism10,
47  Prism11,
48  Polyhedron,
49  // NOTE: If you add anything below Polyhedron,
50  // don't forget to update numElementTypes() below.
51 };
52 
57 inline constexpr integer numElementTypes()
58 {
59  return static_cast< integer >( ElementType::Polyhedron ) + 1;
60 }
61 
67 inline int getElementDim( ElementType const elementType )
68 {
69  switch( elementType )
70  {
71  case ElementType::Vertex: return 0;
72  case ElementType::Line: return 1;
75  case ElementType::Polygon: return 2;
78  case ElementType::Wedge:
87  case ElementType::Polyhedron: return 3;
88  }
89  return 0;
90 }
91 
94  "Vertex",
95  "BEAM",
96  "C2D3",
97  "C2D4",
98  "Polygon",
99  "C3D4",
100  "C3D5",
101  "C3D6",
102  "C3D8",
103  "PentagonalPrism",
104  "HexagonalPrism",
105  "HeptagonalPrism",
106  "OctagonalPrism",
107  "NonagonalPrism",
108  "DecagonalPrism",
109  "HendecagonalPrism",
110  "Polyhedron" );
111 
113 inline auto constexpr generalMeshErrorAdvice = "Consider checking the validity of your mesh with "
114  "the `mesh_doctor` GEOS python tools (documentation at"
115  "https://geosx-geosx.readthedocs-hosted.com/en/latest/docs/sphinx/pythonTools/mesh_doctor.html).";
116 
117 } // namespace geos
118 
119 #endif //GEOS_MESH_ELEMENTTYPE_HPP
constexpr integer numElementTypes()
Definition: ElementType.hpp:57
ENUM_STRINGS(LinearSolverParameters::SolverType, "direct", "cg", "gmres", "fgmres", "bicgstab", "preconditioner")
Declare strings associated with enumeration values.
int getElementDim(ElementType const elementType)
Get number of spatial dimensions of element type.
Definition: ElementType.hpp:67
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
ElementType
Denotes type of cell/element shape.
Definition: ElementType.hpp:31
@ Wedge
Six-node wedge element.
@ Prism6
Twelve-node hexagonal prism.
@ Polyhedron
General polyhedral element.
@ Prism7
Heptagonal prism.
@ Line
Two-node line segment.
@ Polygon
General polygonal element.
@ Triangle
Three-node triangle.
@ Pyramid
Five-node pyramid element.
@ Prism10
Decagonal prism.
@ Prism9
Nonagonal prism.
@ Hexahedron
Eight-node hexahedral element.
@ Prism8
Octagonal prism.
@ Quadrilateral
Four-node quadrilateral.
@ Vertex
Single-node vertex element.
@ Prism11
Hendecagonal prism.
@ Tetrahedron
Four-node tetrahedral element.
@ Prism5
Ten-node pentagonal prism.
constexpr auto generalMeshErrorAdvice
String available for mesh errors.