/home/runner/work/amr-wind/amr-wind/amr-wind/core/vs/vstraits.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/core/vs/vstraits.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
vstraits.H
Go to the documentation of this file.
1#ifndef VSTRAITS_H
2#define VSTRAITS_H
3
4#include <limits>
5#include "AMReX_REAL.H"
6
7namespace amr_wind::vs {
8
9template <typename T>
10struct DTraits
11{};
12
13template <>
14struct DTraits<int>
15{
16 static constexpr int zero() noexcept { return 0; }
17 static constexpr int one() noexcept { return 1; }
18 static constexpr int max() noexcept
19 {
20 return std::numeric_limits<int>::max();
21 }
22 static constexpr int min() noexcept
23 {
24 return std::numeric_limits<int>::min();
25 }
26};
27
28template <>
29struct DTraits<double>
30{
31 static constexpr double zero() noexcept { return 0.0; }
32 static constexpr double one() noexcept { return 1.0; }
33 static constexpr double max() noexcept
34 {
35 return std::numeric_limits<double>::max();
36 }
37 static constexpr double min() noexcept
38 {
39 return std::numeric_limits<double>::min();
40 }
41 static constexpr double eps() noexcept { return 1.0e-15; }
42};
43
44template <>
45struct DTraits<float>
46{
47 static constexpr float zero() noexcept { return 0.0F; }
48 static constexpr float one() noexcept { return 1.0F; }
49 static constexpr float max() noexcept
50 {
51 return std::numeric_limits<float>::max();
52 }
53 static constexpr float min() noexcept
54 {
55 return std::numeric_limits<float>::min();
56 }
57 static constexpr float eps() noexcept { return 1.0e-7F; }
58};
59
60} // namespace amr_wind::vs
61
62#endif /* VSTRAITS_H */
Definition tensor.H:8
static constexpr double eps() noexcept
Definition vstraits.H:41
static constexpr double min() noexcept
Definition vstraits.H:37
static constexpr double zero() noexcept
Definition vstraits.H:31
static constexpr double one() noexcept
Definition vstraits.H:32
static constexpr double max() noexcept
Definition vstraits.H:33
static constexpr float one() noexcept
Definition vstraits.H:48
static constexpr float eps() noexcept
Definition vstraits.H:57
static constexpr float zero() noexcept
Definition vstraits.H:47
static constexpr float min() noexcept
Definition vstraits.H:53
static constexpr float max() noexcept
Definition vstraits.H:49
static constexpr int one() noexcept
Definition vstraits.H:17
static constexpr int zero() noexcept
Definition vstraits.H:16
static constexpr int max() noexcept
Definition vstraits.H:18
static constexpr int min() noexcept
Definition vstraits.H:22
Definition vstraits.H:11