Loading [MathJax]/extensions/tex2jax.js
MeshKernel
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages Concepts
Definitions.hpp
1//---- GPL ---------------------------------------------------------------------
2//
3// Copyright (C) Stichting Deltares, 2011-2021.
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation version 3.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//
17// contact: delft3d.support@deltares.nl
18// Stichting Deltares
19// P.O. Box 177
20// 2600 MH Delft, The Netherlands
21//
22// All indications and logos of, and references to, "Delft3D" and "Deltares"
23// are registered trademarks of Stichting Deltares, and remain the property of
24// Stichting Deltares. All rights reserved.
25//
26//------------------------------------------------------------------------------
27
28#pragma once
29
30#include <concepts>
31#include <cstdint>
32#include <map>
33#include <string>
34#include <vector>
35
36namespace meshkernel
37{
39 using UInt = std::uint32_t;
40
42 enum class Projection
43 {
44 cartesian = 0, // jsferic = 0
45 spherical = 1, // jsferic = 1
46 sphericalAccurate = 2 // jasfer3D = 1
47 };
48
50 const std::vector<int>& GetValidProjections();
51
53 const std::vector<int>& GetValidDeletionOptions();
54
60
62 const std::string& ProjectionToString(Projection projection);
63
65 // PolygonTraversalDirection? too long
66 // PolygonOrientation
68 {
69 Clockwise,
71 };
72
75 enum class Location
76 {
77 Faces = 0,
78 Nodes = 1,
79 Edges = 2,
80 Unknown = 3
81 };
82
84 inline static std::map<Location, std::string> const LocationToString = {
85 {Location::Faces, "Faces"},
86 {Location::Nodes, "Nodes"},
87 {Location::Edges, "Edges"},
88 {Location::Unknown, "Unknown"}};
89
92 {
93 M,
94 N
95 };
96
100 {
101 Short = 0,
102 Float = 1,
103 Int = 2,
104 Double = 3,
105 };
106
112
115
123 {
124 public:
126 Boolean() = default;
127
129 Boolean(const bool val) : m_value(val) {}
130
132 Boolean& operator=(const bool val)
133 {
134 m_value = val;
135 return *this;
136 }
137
139 operator bool() const { return m_value; }
140
141 private:
143 bool m_value = false;
144 };
145
147 enum class MeshNodeType : std::int8_t
148 {
149 Hanging = -1,
151 Internal,
152 Boundary,
153 Corner
154 };
155
156} // namespace meshkernel
Boolean value designed for use in std::vector.
Definition Definitions.hpp:123
Boolean()=default
Default constructor.
Boolean & operator=(const bool val)
Assignment operator.
Definition Definitions.hpp:132
Boolean(const bool val)
Constructor.
Definition Definitions.hpp:129
Contains the logic of the C++ static library.
Definition AveragingInterpolation.hpp:37
Projection
Enumerator describing the supported projections.
Definition Definitions.hpp:43
MeshNodeType
Possible unstructured node types.
Definition Definitions.hpp:148
@ Corner
Nodes at corners.
@ Unspecified
Initial value, unspecified or invalid nodes.
@ Hanging
Hanging node.
@ Internal
Nodes in interior of domain.
@ Boundary
Nodes on boundary of domain, except corners.
const std::vector< int > & GetValidDeletionOptions()
Gets the valid deletion options as vector of integers.
Location
Mesh locations enumeration.
Definition Definitions.hpp:76
Projection GetProjectionValue(int projection)
Convert an integer value to the Projection enumeration type.
TraversalDirection
Indicator for traversal direction of the points specifying a polygon.
Definition Definitions.hpp:68
@ AntiClockwise
Points define a anti-clockwise (counter-clockwise) traversal of the polygon.
@ Clockwise
Points define a clockwise traversal of the polygon.
std::uint32_t UInt
Integer type used when indexing mesh graph entities.
Definition Definitions.hpp:39
const std::string & ProjectionToString(Projection projection)
Get the string representation of the Projection enumeration values.
InterpolationDataTypes
The possible types of the values to be interpolated in the gridded sample.
Definition Definitions.hpp:100
CurvilinearDirection
Direction to use in curvilinear grid algorithms.
Definition Definitions.hpp:92
CurvilinearDirection GetCurvilinearDirectionValue(int direction)
Convert an integer value to the CurvilinearDirection enumeration type.
const std::string & CurvilinearDirectionToString(CurvilinearDirection direction)
Get the string representation of the CurvilinearDirection enumeration values.
const std::vector< int > & GetValidProjections()
Gets the valid projectionbs as vector of integers.