@@ -27,9 +27,9 @@ using namespace amrex::literals;
27
27
28
28
const std::string eos_name = " ztwd" ;
29
29
30
- const Real A = M_PI * amrex::Math::powi<4 >(C::m_e) * amrex::Math::powi<5 >(C::c_light) / (3 .0_rt * amrex::Math::powi<3 >(C::hplanck));
31
- const Real B2 = 8 .0_rt * M_PI * amrex::Math::powi<3 >(C::m_e) * amrex::Math::powi<3 >(C::c_light) * C::m_p / (3 .0_rt * amrex::Math::powi<3 >(C::hplanck));
32
- const Real iter_tol = 1 .e-10_rt;
30
+ const amrex:: Real A = M_PI * amrex::Math::powi<4 >(C::m_e) * amrex::Math::powi<5 >(C::c_light) / (3 .0_rt * amrex::Math::powi<3 >(C::hplanck));
31
+ const amrex:: Real B2 = 8 .0_rt * M_PI * amrex::Math::powi<3 >(C::m_e) * amrex::Math::powi<3 >(C::c_light) * C::m_p / (3 .0_rt * amrex::Math::powi<3 >(C::hplanck));
32
+ const amrex:: Real iter_tol = 1 .e-10_rt;
33
33
const int max_iter = 1000 ;
34
34
35
35
inline
@@ -52,23 +52,23 @@ bool is_input_valid (I input)
52
52
53
53
54
54
AMREX_GPU_HOST_DEVICE AMREX_INLINE
55
- Real pressure (Real x)
55
+ amrex:: Real pressure (amrex:: Real x)
56
56
{
57
57
return A * (x * (2 .0_rt * x * x - 3 .0_rt) * std::sqrt (x * x + 1 .0_rt) + 3 .0_rt * std::asinh (x));
58
58
}
59
59
60
60
61
61
62
62
AMREX_GPU_HOST_DEVICE AMREX_INLINE
63
- Real enthalpy (Real x, Real B)
63
+ amrex:: Real enthalpy (amrex:: Real x, amrex:: Real B)
64
64
{
65
65
return (8 .0_rt * A / B) * std::sqrt (1 .0_rt + x * x);
66
66
}
67
67
68
68
69
69
70
70
AMREX_GPU_HOST_DEVICE AMREX_INLINE
71
- Real dpdx (Real x)
71
+ amrex:: Real dpdx (amrex:: Real x)
72
72
{
73
73
return A * ((2 .0_rt * x * x - 3 .0_rt) * std::sqrt (x * x + 1 .0_rt) +
74
74
x * (4 .0_rt * x) * std::sqrt (x * x + 1 .0_rt) +
@@ -79,7 +79,7 @@ Real dpdx (Real x)
79
79
80
80
81
81
AMREX_GPU_HOST_DEVICE AMREX_INLINE
82
- Real dhdx (Real x, Real B)
82
+ amrex:: Real dhdx (amrex:: Real x, amrex:: Real B)
83
83
{
84
84
return enthalpy (x, B) * (x / (x * x + 1 .0_rt));
85
85
}
@@ -88,12 +88,12 @@ Real dhdx (Real x, Real B)
88
88
89
89
90
90
AMREX_GPU_HOST_DEVICE AMREX_INLINE
91
- void pres_iter (Real pres, Real& dens, Real B)
91
+ void pres_iter (amrex:: Real pres, amrex:: Real& dens, amrex:: Real B)
92
92
{
93
93
94
94
// Starting guess for the iteration.
95
95
96
- Real x = 1 .0_rt;
96
+ amrex:: Real x = 1 .0_rt;
97
97
98
98
// We are solving the equation:
99
99
// f(x) = p_want - p(x) = 0.
@@ -104,7 +104,7 @@ void pres_iter (Real pres, Real& dens, Real B)
104
104
105
105
for (iter = 1 ; iter <= max_iter; ++iter)
106
106
{
107
- Real dx = (pres - pressure (x)) / dpdx (x);
107
+ amrex:: Real dx = (pres - pressure (x)) / dpdx (x);
108
108
109
109
x = x + dx;
110
110
@@ -131,32 +131,32 @@ void actual_eos (I input, T& state)
131
131
{
132
132
static_assert (std::is_same_v<I, eos_input_t >, " input must be an eos_input_t" );
133
133
134
- Real dens = state.rho ;
135
- Real temp = state.T ;
134
+ amrex:: Real dens = state.rho ;
135
+ amrex:: Real temp = state.T ;
136
136
137
- Real pres = 1 .0_rt;
137
+ amrex:: Real pres = 1 .0_rt;
138
138
if constexpr (has_pressure<T>::value) {
139
139
pres = state.p ;
140
140
}
141
141
142
- Real enth = 1 .0_rt;
142
+ amrex:: Real enth = 1 .0_rt;
143
143
if constexpr (has_enthalpy<T>::value) {
144
144
enth = state.h ;
145
145
}
146
146
147
- Real eint = 1 .0_rt;
147
+ amrex:: Real eint = 1 .0_rt;
148
148
if constexpr (has_energy<T>::value) {
149
149
eint = state.e ;
150
150
}
151
151
152
- Real entr = 1 .0_rt;
152
+ amrex:: Real entr = 1 .0_rt;
153
153
if constexpr (has_entropy<T>::value) {
154
154
entr = state.s ;
155
155
}
156
156
157
- Real B = B2 * state.mu_e ;
157
+ amrex:: Real B = B2 * state.mu_e ;
158
158
159
- Real x, dxdr;
159
+ amrex:: Real x, dxdr;
160
160
161
161
switch (input) {
162
162
@@ -321,8 +321,8 @@ void actual_eos (I input, T& state)
321
321
x = std::cbrt (dens / B);
322
322
dxdr = (1 .0_rt / 3 .0_rt) * x / dens;
323
323
324
- Real dpdr = dxdr * dpdx (x);
325
- Real dhdr = dxdr * dhdx (x, B);
324
+ amrex:: Real dpdr = dxdr * dpdx (x);
325
+ amrex:: Real dhdr = dxdr * dhdx (x, B);
326
326
327
327
if constexpr (has_pressure<T>::value) {
328
328
state.dpdr = dpdr;
0 commit comments