/home/runner/work/amr-wind/amr-wind/amr-wind/utilities/constants.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/constants.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
constants.H
Go to the documentation of this file.
1#ifndef CONSTANTS_H
2#define CONSTANTS_H
3
4#include "AMReX_REAL.H"
5#include "AMReX_Math.H"
6#include "AMReX_GpuQualifiers.H"
7
9
11static constexpr amrex::Real SMALL_NUM = static_cast<amrex::Real>(
12 std::numeric_limits<amrex::Real>::epsilon() * 1e10);
13
15static constexpr amrex::Real EPS =
16 static_cast<amrex::Real>(std::numeric_limits<amrex::Real>::epsilon());
17
19static constexpr amrex::Real TIGHT_TOL = 1e-12;
20
22static constexpr amrex::Real LOOSE_TOL = 1e-8;
23
25static constexpr amrex::Real LOW_NUM = static_cast<amrex::Real>(
26 std::numeric_limits<amrex::Real>::lowest() * 1e-10);
27
29static constexpr amrex::Real LARGE_NUM =
30 static_cast<amrex::Real>(std::numeric_limits<amrex::Real>::max() * 1e-10);
31
33AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE bool
34is_close(const amrex::Real a, const amrex::Real b)
35{
36 return amrex::Math::abs(a - b) < EPS;
37}
38
39} // namespace amr_wind::constants
40#endif
Definition constants.H:8
static constexpr amrex::Real TIGHT_TOL
A tight tolerance.
Definition constants.H:19
static constexpr amrex::Real LOOSE_TOL
A loose tolerance.
Definition constants.H:22
static constexpr amrex::Real LOW_NUM
A large negative number.
Definition constants.H:25
static constexpr amrex::Real EPS
A number very close to zero.
Definition constants.H:15
static constexpr amrex::Real SMALL_NUM
A number close to zero.
Definition constants.H:11
AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE bool is_close(const amrex::Real a, const amrex::Real b)
Closeness comparison.
Definition constants.H:34
static constexpr amrex::Real LARGE_NUM
A large positive number.
Definition constants.H:29