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

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/trig_ops.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
trig_ops.H
Go to the documentation of this file.
1#ifndef TRIG_OPS_H
2#define TRIG_OPS_H
3
9#include <cmath>
10#include "AMReX_REAL.H"
11#include "AMReX_Gpu.H"
12
13namespace amr_wind::utils {
14
16AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr amrex::Real pi()
17{
18 return M_PI;
19}
20
22AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr amrex::Real two_pi()
23{
24 return 2.0 * M_PI;
25}
26
28AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr amrex::Real half_pi()
29{
30 return 0.5 * M_PI;
31}
32
34AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
35radians(const amrex::Real deg_val)
36{
37 return pi() * deg_val / 180.0;
38}
39
41AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
42degrees(const amrex::Real rad_val)
43{
44 return 180.0 * rad_val / pi();
45}
46
47} // namespace amr_wind::utils
48
49#endif /* TRIG_OPS_H */
Definition MultiParser.H:7
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr amrex::Real two_pi()
Return .
Definition trig_ops.H:22
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr amrex::Real half_pi()
Return .
Definition trig_ops.H:28
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real degrees(const amrex::Real rad_val)
Convert from radians to degrees.
Definition trig_ops.H:42
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr amrex::Real pi()
Return as an amrex::Real.
Definition trig_ops.H:16
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real radians(const amrex::Real deg_val)
Convert from degrees to radians.
Definition trig_ops.H:35