forked from Exawind/amr-wind
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable viz of native boundary files (Exawind#1356)
- Loading branch information
Showing
8 changed files
with
367 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef CONSTANTS_H | ||
#define CONSTANTS_H | ||
|
||
#include "AMReX_REAL.H" | ||
#include "AMReX_Math.H" | ||
#include "AMReX_GpuQualifiers.H" | ||
|
||
namespace amr_wind::constants { | ||
|
||
//! A number close to zero | ||
static constexpr amrex::Real SMALL_NUM = static_cast<amrex::Real>( | ||
std::numeric_limits<amrex::Real>::epsilon() * 1e10); | ||
|
||
//! A number very close to zero | ||
static constexpr amrex::Real EPS = | ||
static_cast<amrex::Real>(std::numeric_limits<amrex::Real>::epsilon()); | ||
|
||
//! A tight tolerance | ||
static constexpr amrex::Real TIGHT_TOL = 1e-12; | ||
|
||
//! A loose tolerance | ||
static constexpr amrex::Real LOOSE_TOL = 1e-8; | ||
|
||
//! A large negative number | ||
static constexpr amrex::Real LOW_NUM = static_cast<amrex::Real>( | ||
std::numeric_limits<amrex::Real>::lowest() * 1e-10); | ||
|
||
//! A large positive number | ||
static constexpr amrex::Real LARGE_NUM = | ||
static_cast<amrex::Real>(std::numeric_limits<amrex::Real>::max() * 1e-10); | ||
|
||
//! Closeness comparison | ||
AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE bool | ||
is_close(const amrex::Real a, const amrex::Real b) | ||
{ | ||
return amrex::Math::abs(a - b) < EPS; | ||
} | ||
|
||
} // namespace amr_wind::constants | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.