Loading [MathJax]/extensions/tex2jax.js
MeshKernel
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages Concepts
Constants.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 "MeshKernel/Definitions.hpp"
31
32#include <cmath>
33#include <limits>
34#include <math.h>
35
36#if defined(__linux__) || defined(__APPLE__)
37#pragma GCC diagnostic push
38#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
39#endif
40
41#include <Eigen/Core>
42
43#if defined(__linux__) || defined(__APPLE__)
44#pragma GCC diagnostic pop
45#endif
46
47namespace meshkernel
48{
49
50 namespace constants
51 {
52 // missing values
53 namespace missing
54 {
55 constexpr double innerOuterSeparator = -998.0;
56 constexpr double doubleValue = -999.0;
57 constexpr int intValue = -999;
58 constexpr UInt uintValue = std::numeric_limits<UInt>::max();
59 constexpr Eigen::Index EigenIndexValue = std::numeric_limits<Eigen::Index>::max();
60
61 } // namespace missing
62
63 // often used values
64 namespace numeric
65 {
66 static double const squareRootOfThree = std::sqrt(3.0);
67 constexpr double oneThird = 1.0 / 3.0;
68 constexpr int defaultSnappingIterations = 5;
69
70 } // namespace numeric
71
72 // unit conversion constants
73 namespace conversion
74 {
75 constexpr double degToRad = M_PI / 180.0;
76 constexpr double radToDeg = 1.0 / degToRad;
77
78 } // namespace conversion
79
80 // geometric constants
81 namespace geometric
82 {
83 constexpr double earth_radius = 6378137.0;
84 constexpr double inverse_earth_radius = 1.0 / earth_radius;
85 constexpr double absLatitudeAtPoles = 0.0001;
86 constexpr double refinementTolerance = 1.0e-2;
87 constexpr UInt numNodesInQuadrilateral = 4;
88 constexpr UInt numNodesInTriangle = 3;
89 constexpr UInt numNodesInPentagon = 5;
90 constexpr UInt numNodesInHexagon = 6;
91 constexpr UInt maximumNumberOfEdgesPerNode = 16;
92 constexpr UInt maximumNumberOfEdgesPerFace = 6;
93 constexpr UInt maximumNumberOfNodesPerFace = 6;
94 constexpr UInt maximumNumberOfConnectedNodes = maximumNumberOfEdgesPerNode * 4;
95
96 } // namespace geometric
97
98 namespace physical
99 {
100 constexpr double gravity = 9.80665;
101 static double const sqrt_gravity = std::sqrt(gravity);
102
103 } // namespace physical
104
105 } // namespace constants
106} // namespace meshkernel
Contains the logic of the C++ static library.
Definition AveragingInterpolation.hpp:37
std::uint32_t UInt
Integer type used when indexing mesh graph entities.
Definition Definitions.hpp:39