numericConstants.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 #ifndef __numericConstants_hpp__
22 #define __numericConstants_hpp__
23 
24 
25 #include <limits>
26 #include "builtinTypes.hpp"
27 
28 
29 namespace pFlow
30 {
31 
32  const inline real Pi = real(3.1415926535897932384626433832);
33  const inline real smallValue = 1.0e-15;
34  const inline real verySmallValue = 1.0e-30;
35  const inline real largeValue = 1.0e15;
36  const inline real veryLargeValue = 1.0e30;
37 
38  // - largest negative value
39  template<typename T>
40  constexpr inline T largestNegative()
41  {
42  return std::numeric_limits<T>::lowest();
43  }
44 
45  template<typename T>
46  constexpr inline T epsilonValue()
47  {
49  }
50 
51  // largest positive value
52  template<typename T>
53  constexpr inline T largestPositive()
54  {
56  }
57 
58  const inline int32 largestNegInt32 = largestNegative<int32>();
59  const inline int32 largestPosInt32 = largestPositive<int32>();
60 
61  const inline int64 largestNegInt64 = largestNegative<int64>();
62  const inline int64 largestPosInt64 = largestPositive<int64>();
63 
64  const inline real largestNegREAL = largestNegative<real>();
65  const inline real largestPosREAL = largestPositive<real>();
66  const inline real epsilonREAL = epsilonValue<real>();
67 
68 
69 
70 } // end of pFlow
71 
72 #endif //__numericConstants_hpp__
pFlow::verySmallValue
const real verySmallValue
Definition: numericConstants.hpp:34
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::largestPosREAL
const real largestPosREAL
Definition: numericConstants.hpp:65
pFlow::smallValue
const real smallValue
Definition: numericConstants.hpp:33
pFlow::algorithms::KOKKOS::min
INLINE_FUNCTION_H Type min(const Type *first, int32 numElems)
Definition: kokkosAlgorithms.hpp:124
pFlow::largestNegInt64
const int64 largestNegInt64
Definition: numericConstants.hpp:61
pFlow::int64
long long int int64
Definition: builtinTypes.hpp:55
pFlow::largestPosInt64
const int64 largestPosInt64
Definition: numericConstants.hpp:62
pFlow
Definition: demComponent.hpp:28
pFlow::largestNegREAL
const real largestNegREAL
Definition: numericConstants.hpp:64
pFlow::int32
int int32
Definition: builtinTypes.hpp:53
pFlow::largestNegInt32
const int32 largestNegInt32
Definition: numericConstants.hpp:58
pFlow::algorithms::KOKKOS::max
INLINE_FUNCTION_H Type max(const Type *first, int32 numElems)
Definition: kokkosAlgorithms.hpp:104
pFlow::veryLargeValue
const real veryLargeValue
Definition: numericConstants.hpp:36
pFlow::largestPositive
constexpr T largestPositive()
Definition: numericConstants.hpp:53
pFlow::largestNegative
constexpr T largestNegative()
Definition: numericConstants.hpp:40
pFlow::epsilonREAL
const real epsilonREAL
Definition: numericConstants.hpp:66
pFlow::epsilonValue
constexpr T epsilonValue()
Definition: numericConstants.hpp:46
pFlow::Pi
const real Pi
Definition: numericConstants.hpp:32
pFlow::largestPosInt32
const int32 largestPosInt32
Definition: numericConstants.hpp:59
builtinTypes.hpp
pFlow::largeValue
const real largeValue
Definition: numericConstants.hpp:35