Skip to content

Commit 89291bd

Browse files
committed
more amrex namespace removal
1 parent b5d1a91 commit 89291bd

27 files changed

+1664
-1671
lines changed

EOS/multigamma/eos_composition.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <network.H>
66
#include <eos_type.H>
77

8-
using namespace amrex;
8+
using namespace amrex::literals;
99

1010
struct eos_xderivs_t {
1111
Real dedX[NumSpec];

EOS/ztwd/actual_eos.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <fundamental_constants.H>
2424
#include <eos_type.H>
2525

26-
using namespace amrex;
26+
using namespace amrex::literals;
2727

2828
const std::string eos_name = "ztwd";
2929

conductivity/stellar/actual_conductivity.H

+106-106
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
const std::string cond_name = "stellar";
1010

11-
using namespace amrex;
11+
using namespace amrex::literals;
1212

1313
AMREX_FORCE_INLINE
1414
void
@@ -50,86 +50,86 @@ actual_conductivity (T& state)
5050
// iec = 4*e**4*me/(3*pi*hbar**3)
5151
// xec = hbar/kerg*e*sqrt(4*pi/me)
5252

53-
const Real third = 1.0_rt/3.0_rt;
54-
const Real twoth = 2.0_rt * third;
53+
const amrex::Real third = 1.0_rt/3.0_rt;
54+
const amrex::Real twoth = 2.0_rt * third;
5555

56-
const Real zbound = 0.1e0_rt;
57-
const Real t7peek = 1.0e20_rt;
58-
const Real k2c = 4.0_rt/3.0_rt*C::a_rad*C::c_light;
59-
const Real meff = 1.194648642401440e-10_rt;
60-
const Real weid = 6.884326138694269e-5_rt;
61-
const Real iec = 1.754582332329132e16_rt;
62-
const Real xec = 4.309054377592449e-7_rt;
63-
const Real rt3 = 1.7320508075688772e0_rt;
64-
const Real con2 = 1.07726359439811217e-7_rt;
56+
const amrex::Real zbound = 0.1e0_rt;
57+
const amrex::Real t7peek = 1.0e20_rt;
58+
const amrex::Real k2c = 4.0_rt/3.0_rt*C::a_rad*C::c_light;
59+
const amrex::Real meff = 1.194648642401440e-10_rt;
60+
const amrex::Real weid = 6.884326138694269e-5_rt;
61+
const amrex::Real iec = 1.754582332329132e16_rt;
62+
const amrex::Real xec = 4.309054377592449e-7_rt;
63+
const amrex::Real rt3 = 1.7320508075688772e0_rt;
64+
const amrex::Real con2 = 1.07726359439811217e-7_rt;
6565

6666
// switches for the iben & christy regimes
67-
const Real t6_switch1 = 0.5_rt;
68-
const Real t6_switch2 = 0.9_rt;
67+
const amrex::Real t6_switch1 = 0.5_rt;
68+
const amrex::Real t6_switch2 = 0.9_rt;
6969

7070
// initialize
71-
Real opac = 0.0e0_rt;
72-
Real orad = 0.0e0_rt;
73-
Real ocond = 0.0e0_rt;
74-
Real oiben1 = 0.0e0_rt;
75-
Real oiben2 = 0.0e0_rt;
76-
Real ochrs = 0.0e0_rt;
77-
Real oh = 0.0e0_rt;
78-
Real ov = 0.0e0_rt;
79-
Real zbar = 0.0e0_rt;
80-
Real ytot1 = 0.0e0_rt;
71+
amrex::Real opac = 0.0e0_rt;
72+
amrex::Real orad = 0.0e0_rt;
73+
amrex::Real ocond = 0.0e0_rt;
74+
amrex::Real oiben1 = 0.0e0_rt;
75+
amrex::Real oiben2 = 0.0e0_rt;
76+
amrex::Real ochrs = 0.0e0_rt;
77+
amrex::Real oh = 0.0e0_rt;
78+
amrex::Real ov = 0.0e0_rt;
79+
amrex::Real zbar = 0.0e0_rt;
80+
amrex::Real ytot1 = 0.0e0_rt;
8181

8282
// set the composition variables
83-
Real w[6];
83+
amrex::Real w[6];
8484
for (int i = 0; i < 6; i++) {
8585
w[i] = 0.0e0_rt;
8686
}
8787

8888
// the idea here is that w[0] is H, w[1] is He, and w[2] is metals
8989
for (int i = 0; i < NumSpec; i++) {
9090
int iz = amrex::min(3, amrex::max(1, static_cast<int>(zion[i]))) - 1;
91-
Real ymass = state.xn[i]*aion_inv[i];
91+
amrex::Real ymass = state.xn[i]*aion_inv[i];
9292
w[iz] += state.xn[i];
9393
w[iz+3] += zion[i] * zion[i] * ymass;
9494
zbar += zion[i] * ymass;
9595
ytot1 += ymass;
9696
}
97-
Real abar = 1.0e0_rt/ytot1;
97+
amrex::Real abar = 1.0e0_rt/ytot1;
9898
zbar = zbar * abar;
99-
Real t6 = state.T * 1.0e-6_rt;
99+
amrex::Real t6 = state.T * 1.0e-6_rt;
100100

101-
Real xh = w[0];
102-
Real xhe = w[1];
103-
Real xz = w[2];
101+
amrex::Real xh = w[0];
102+
amrex::Real xhe = w[1];
103+
amrex::Real xz = w[2];
104104

105105
// radiative section:
106106
// from iben apj 196 525 1975
107107
if (xh < 1.0e-5_rt) {
108-
Real xmu = amrex::max(1.0e-99_rt, w[3] + w[4] + w[5] - 1.0e0_rt);
109-
Real xkc = std::pow((2.019e-4_rt * state.rho / std::pow(t6, 1.7_rt)), 2.425_rt);
110-
Real xkap = 1.0_rt + xkc * (1.0_rt + xkc/24.55_rt);
111-
Real xkb = 3.86_rt + 0.252_rt*std::sqrt(xmu) + 0.018_rt*xmu;
112-
Real xka = 3.437_rt * (1.25_rt + 0.488_rt*std::sqrt(xmu) + 0.092_rt*xmu);
113-
Real dbar = std::exp(-xka + xkb*std::log(t6));
108+
amrex::Real xmu = amrex::max(1.0e-99_rt, w[3] + w[4] + w[5] - 1.0e0_rt);
109+
amrex::Real xkc = std::pow((2.019e-4_rt * state.rho / std::pow(t6, 1.7_rt)), 2.425_rt);
110+
amrex::Real xkap = 1.0_rt + xkc * (1.0_rt + xkc/24.55_rt);
111+
amrex::Real xkb = 3.86_rt + 0.252_rt*std::sqrt(xmu) + 0.018_rt*xmu;
112+
amrex::Real xka = 3.437_rt * (1.25_rt + 0.488_rt*std::sqrt(xmu) + 0.092_rt*xmu);
113+
amrex::Real dbar = std::exp(-xka + xkb*std::log(t6));
114114
oiben1 = xkap * std::pow(state.rho/dbar, 0.67_rt);
115115
}
116116

117117
if ( !((xh >= 1.0e-5_rt) && (t6 < t6_switch1)) &&
118118
!((xh < 1.0e-5_rt) && (xz > zbound)) ) {
119-
Real d0log;
119+
amrex::Real d0log;
120120
if (t6 > t6_switch1) {
121121
d0log = -(3.868_rt + 0.806_rt*xh) + 1.8_rt*std::log(t6);
122122
} else {
123123
d0log = -(3.868_rt + 0.806_rt*xh) + (3.42_rt - 0.52_rt*xh)*std::log(t6);
124124
}
125-
Real xka1 = 2.809_rt * std::exp(-(1.74_rt - 0.755_rt*xh)
125+
amrex::Real xka1 = 2.809_rt * std::exp(-(1.74_rt - 0.755_rt*xh)
126126
* amrex::Math::powi<2>(std::log10(t6) - 0.22_rt + 0.1375_rt*xh));
127127

128-
Real xkw = 4.05_rt * std::exp(-(0.306_rt - 0.04125_rt*xh)
128+
amrex::Real xkw = 4.05_rt * std::exp(-(0.306_rt - 0.04125_rt*xh)
129129
* amrex::Math::powi<2>(std::log10(t6) - 0.18_rt + 0.1625_rt*xh));
130-
Real xkaz = 50.0_rt*xz*xka1 * std::exp(-0.5206_rt*amrex::Math::powi<2>((std::log(state.rho)-d0log)/xkw));
131-
Real dbar2log = -(4.283_rt + 0.7196_rt*xh) + 3.86_rt*std::log(t6);
132-
Real dbar1log = -5.296_rt + 4.833_rt*std::log(t6);
130+
amrex::Real xkaz = 50.0_rt*xz*xka1 * std::exp(-0.5206_rt*amrex::Math::powi<2>((std::log(state.rho)-d0log)/xkw));
131+
amrex::Real dbar2log = -(4.283_rt + 0.7196_rt*xh) + 3.86_rt*std::log(t6);
132+
amrex::Real dbar1log = -5.296_rt + 4.833_rt*std::log(t6);
133133
if (dbar2log < dbar1log) {
134134
dbar1log = dbar2log;
135135
}
@@ -138,20 +138,20 @@ actual_conductivity (T& state)
138138

139139
// from christy apj 144 108 1966
140140
if ((t6 < t6_switch2) && (xh >= 1.0e-5_rt)) {
141-
Real t4 = state.T * 1.0e-4_rt;
142-
Real t4r = std::sqrt(t4);
143-
Real t44 = t4*t4*t4*t4;
144-
Real t45 = t44 * t4;
145-
Real t46 = t45 * t4;
146-
Real ck1 = 2.0e6_rt/t44 + 2.1_rt*t46;
147-
Real ck3 = 4.0e-3_rt/t44 + 2.0e-4_rt/std::pow(state.rho, 0.25_rt);
148-
Real ck2 = 4.5_rt*t46 + 1.0_rt/(t4*ck3);
149-
Real ck4 = 1.4e3_rt*t4 + t46;
150-
Real ck5 = 1.0e6_rt + 0.1_rt*t46;
151-
Real ck6 = 20.0_rt*t4 + 5.0_rt*t44 + t45;
152-
Real xkcx = xh*(t4r/ck1 + 1.0_rt/ck2);
153-
Real xkcy = xhe*(1.0_rt/ck4 + 1.5_rt/ck5);
154-
Real xkcz = xz*(t4r/ck6);
141+
amrex::Real t4 = state.T * 1.0e-4_rt;
142+
amrex::Real t4r = std::sqrt(t4);
143+
amrex::Real t44 = t4*t4*t4*t4;
144+
amrex::Real t45 = t44 * t4;
145+
amrex::Real t46 = t45 * t4;
146+
amrex::Real ck1 = 2.0e6_rt/t44 + 2.1_rt*t46;
147+
amrex::Real ck3 = 4.0e-3_rt/t44 + 2.0e-4_rt/std::pow(state.rho, 0.25_rt);
148+
amrex::Real ck2 = 4.5_rt*t46 + 1.0_rt/(t4*ck3);
149+
amrex::Real ck4 = 1.4e3_rt*t4 + t46;
150+
amrex::Real ck5 = 1.0e6_rt + 0.1_rt*t46;
151+
amrex::Real ck6 = 20.0_rt*t4 + 5.0_rt*t44 + t45;
152+
amrex::Real xkcx = xh*(t4r/ck1 + 1.0_rt/ck2);
153+
amrex::Real xkcy = xhe*(1.0_rt/ck4 + 1.5_rt/ck5);
154+
amrex::Real xkcz = xz*(t4r/ck6);
155155
ochrs = state.pele * (xkcx + xkcy + xkcz);
156156
}
157157

@@ -175,30 +175,30 @@ actual_conductivity (T& state)
175175
}
176176

177177
// add in the compton scattering opacity, weaver et al. apj 1978 225 1021
178-
Real th = amrex::min(511.0_rt, state.T * 8.617e-8_rt);
179-
Real fact = 1.0_rt + 2.75e-2_rt*th - 4.88e-5_rt*th*th;
180-
Real facetax = 1.0e100_rt;
178+
amrex::Real th = amrex::min(511.0_rt, state.T * 8.617e-8_rt);
179+
amrex::Real fact = 1.0_rt + 2.75e-2_rt*th - 4.88e-5_rt*th*th;
180+
amrex::Real facetax = 1.0e100_rt;
181181
if (state.eta <= 500.0_rt) {
182182
facetax = std::exp(0.522e0_rt*state.eta - 1.563_rt);
183183
}
184-
Real faceta = 1.0_rt + facetax;
185-
Real ocompt = 6.65205e-25_rt/(fact * faceta) * state.xne/state.rho;
184+
amrex::Real faceta = 1.0_rt + facetax;
185+
amrex::Real ocompt = 6.65205e-25_rt/(fact * faceta) * state.xne/state.rho;
186186
orad += ocompt;
187187

188188
// cutoff radiative opacity when 4kt/hbar is less than the plasma
189189
// frequency
190-
Real tcut = con2 * std::sqrt(state.xne);
190+
amrex::Real tcut = con2 * std::sqrt(state.xne);
191191
if (state.T < tcut) {
192192
if (tcut > 200.0_rt*state.T) {
193193
orad = orad * 2.658e86_rt;
194194
} else {
195-
Real cutfac = std::exp(tcut/state.T - 1.0_rt);
195+
amrex::Real cutfac = std::exp(tcut/state.T - 1.0_rt);
196196
orad = orad * cutfac;
197197
}
198198
}
199199

200200
// fudge molecular opacity for low temps
201-
Real xkf = t7peek * state.rho * amrex::Math::powi<4>(state.T * 1.0e-7_rt);
201+
amrex::Real xkf = t7peek * state.rho * amrex::Math::powi<4>(state.T * 1.0e-7_rt);
202202
orad = xkf * orad/(xkf + orad);
203203

204204

@@ -209,31 +209,31 @@ actual_conductivity (T& state)
209209
// drelim, use the non-degenerate formulas. in between drel and drelim,
210210
// apply a smooth blending of the two.
211211

212-
Real dlog10 = std::log10(state.rho);
212+
amrex::Real dlog10 = std::log10(state.rho);
213213

214-
Real drel = 2.4e-7_rt * zbar/abar * state.T * std::sqrt(state.T);
214+
amrex::Real drel = 2.4e-7_rt * zbar/abar * state.T * std::sqrt(state.T);
215215
if (state.T <= 1.0e5_rt) {
216216
drel = drel * 15.0_rt;
217217
}
218-
Real drel10 = std::log10(drel);
219-
Real drelim = drel10 + 1.0_rt;
218+
amrex::Real drel10 = std::log10(drel);
219+
amrex::Real drelim = drel10 + 1.0_rt;
220220

221221
// from iben apj 196 525 1975 for non-degenerate regimes
222222
if (dlog10 < drelim) {
223-
Real zdel = state.xne/(C::n_A*t6*std::sqrt(t6));
224-
Real zdell10 = std::log10(zdel);
225-
Real eta0 = std::exp(-1.20322_rt + twoth * std::log(zdel));
226-
Real eta02 = eta0*eta0;
223+
amrex::Real zdel = state.xne/(C::n_A*t6*std::sqrt(t6));
224+
amrex::Real zdell10 = std::log10(zdel);
225+
amrex::Real eta0 = std::exp(-1.20322_rt + twoth * std::log(zdel));
226+
amrex::Real eta02 = eta0*eta0;
227227

228228
// thpl factor
229-
Real thpl;
229+
amrex::Real thpl;
230230
if (zdell10 < 0.645_rt) {
231231
thpl = -7.5668_rt + std::log(zdel * (1.0_rt + 0.024417_rt*zdel));
232232
} else {
233233
if (zdell10 < 2.5_rt) {
234234
thpl = -7.58110_rt + std::log(zdel*(1.0_rt + 0.02804_rt*zdel));
235235
if (zdell10 >= 2.0_rt) {
236-
Real thpla = thpl;
236+
amrex::Real thpla = thpl;
237237
thpl = -11.0742_rt + std::log(zdel*zdel * (1.0_rt + 9.376_rt/eta02));
238238
thpl = 2.0_rt*((2.5_rt-zdell10)*thpla + (zdell10-2.0_rt)*thpl);
239239
}
@@ -243,33 +243,33 @@ actual_conductivity (T& state)
243243
}
244244

245245
// pefac and walf factors
246-
Real pefac;
246+
amrex::Real pefac;
247247
if (zdell10 < 2.0_rt) {
248248
pefac = 1.0_rt + 0.021876_rt*zdel;
249249
if (zdell10 > 1.5_rt) {
250-
Real pefacal = std::log(pefac);
251-
Real pefacl = std::log(0.4_rt * eta0 + 1.64496_rt/eta0);
252-
Real cfac1 = 2.0_rt - zdell10;
253-
Real cfac2 = zdell10 - 1.5_rt;
250+
amrex::Real pefacal = std::log(pefac);
251+
amrex::Real pefacl = std::log(0.4_rt * eta0 + 1.64496_rt/eta0);
252+
amrex::Real cfac1 = 2.0_rt - zdell10;
253+
amrex::Real cfac2 = zdell10 - 1.5_rt;
254254
pefac = std::exp(2.0_rt * (cfac1*pefacal + cfac2*pefacl));
255255
}
256256
} else {
257257
pefac = 0.4_rt * eta0 + 1.64496_rt/eta0;
258258
}
259259

260-
Real dnefac;
260+
amrex::Real dnefac;
261261
if (zdel < 40.0_rt) {
262262
dnefac = 1.0_rt + zdel * (3.4838e-4_rt * zdel - 2.8966e-2_rt);
263263
} else {
264264
dnefac = 1.5_rt/eta0 * (1.0_rt - 0.8225_rt/eta02);
265265
}
266-
Real wpar2 = 9.24735e-3_rt * zdel *
266+
amrex::Real wpar2 = 9.24735e-3_rt * zdel *
267267
(state.rho*C::n_A*(w[3]+w[4]+w[5])/state.xne + dnefac)/(std::sqrt(t6)*pefac);
268-
Real walf = 0.5_rt * std::log(wpar2);
269-
Real walf10 = 0.5_rt * std::log10(wpar2);
268+
amrex::Real walf = 0.5_rt * std::log(wpar2);
269+
amrex::Real walf10 = 0.5_rt * std::log10(wpar2);
270270

271271
// thx, thy and thc factors
272-
Real thx;
272+
amrex::Real thx;
273273
if (walf10 <= -3.0_rt) {
274274
thx = std::exp(2.413_rt - 0.124_rt*walf);
275275
} else if (walf10 <= -1.0_rt) {
@@ -278,7 +278,7 @@ actual_conductivity (T& state)
278278
thx = std::exp(0.426_rt - 0.558_rt*walf);
279279
}
280280

281-
Real thy;
281+
amrex::Real thy;
282282
if (walf10 <= -3.0_rt) {
283283
thy = std::exp(2.158_rt - 0.111_rt*walf);
284284
} else if (walf10 <= 0.0_rt) {
@@ -287,7 +287,7 @@ actual_conductivity (T& state)
287287
thy = std::exp(0.553_rt - 0.6_rt*walf);
288288
}
289289

290-
Real thc;
290+
amrex::Real thc;
291291
if (walf10 <= -2.5_rt) {
292292
thc = std::exp(2.924_rt - 0.1_rt*walf);
293293
} else if (walf10 <= 0.5_rt) {
@@ -302,41 +302,41 @@ actual_conductivity (T& state)
302302
// from yakovlev & urpin soviet astro 1980 24 303 and
303303
// potekhin et al. 1997 aa 323 415 for degenerate regimes
304304
if (dlog10 > drel10) {
305-
Real xmas = meff * std::pow(state.xne, third);
306-
Real ymas = std::sqrt(1.0_rt + xmas*xmas);
307-
Real wfac = weid * state.T/ymas * state.xne;
308-
Real cint = 1.0_rt;
305+
amrex::Real xmas = meff * std::pow(state.xne, third);
306+
amrex::Real ymas = std::sqrt(1.0_rt + xmas*xmas);
307+
amrex::Real wfac = weid * state.T/ymas * state.xne;
308+
amrex::Real cint = 1.0_rt;
309309

310310
// ion-electron collision frequency and the thermal conductivity
311-
Real vie = iec * zbar * ymas * cint;
312-
Real cie = wfac/vie;
311+
amrex::Real vie = iec * zbar * ymas * cint;
312+
amrex::Real cie = wfac/vie;
313313

314314
// electron-electron collision frequency and thermal conductivity
315-
Real tpe = xec * std::sqrt(state.xne/ymas);
316-
Real yg = rt3 * tpe/state.T;
317-
Real xrel = 1.009_rt * std::pow(zbar/abar * state.rho * 1.0e-6_rt, third);
318-
Real beta2 = xrel*xrel/(1.0_rt + xrel*xrel);
319-
Real jy = (1.0_rt + 6.0_rt/(5.0_rt*xrel*xrel) + 2.0_rt/(5.0_rt*xrel*xrel*xrel*xrel))
315+
amrex::Real tpe = xec * std::sqrt(state.xne/ymas);
316+
amrex::Real yg = rt3 * tpe/state.T;
317+
amrex::Real xrel = 1.009_rt * std::pow(zbar/abar * state.rho * 1.0e-6_rt, third);
318+
amrex::Real beta2 = xrel*xrel/(1.0_rt + xrel*xrel);
319+
amrex::Real jy = (1.0_rt + 6.0_rt/(5.0_rt*xrel*xrel) + 2.0_rt/(5.0_rt*xrel*xrel*xrel*xrel))
320320
* ( yg*yg*yg / (3.0_rt * amrex::Math::powi<3>(1.0_rt + 0.07414_rt * yg))
321321
* std::log((2.81_rt - 0.810_rt*beta2 + yg)/yg)
322322
+ std::pow(M_PI, 5/6.0_rt) * amrex::Math::powi<4>(yg/(13.91_rt + yg)));
323-
Real vee = 0.511_rt * state.T*state.T * xmas/(ymas*ymas) * std::sqrt(xmas/ymas) * jy;
324-
Real cee = wfac/vee;
323+
amrex::Real vee = 0.511_rt * state.T*state.T * xmas/(ymas*ymas) * std::sqrt(xmas/ymas) * jy;
324+
amrex::Real cee = wfac/vee;
325325

326326
// total electron thermal conductivity and conversion to an opacity
327-
Real ov1 = cie * cee/(cee + cie);
327+
amrex::Real ov1 = cie * cee/(cee + cie);
328328
ov = k2c/(ov1*state.rho) * state.T*state.T*state.T;
329329
}
330330

331331
// blend the opacities in the intermediate region
332332
if (dlog10 <= drel10) {
333333
ocond = oh;
334334
} else if (dlog10 > drel10 && dlog10 < drelim) {
335-
Real x = state.rho;
336-
Real x1 = std::pow(10.0_rt, drel10);
337-
Real x2 = std::pow(10.0_rt, drelim);
338-
Real alfa = (x-x2)/(x1-x2);
339-
Real beta = (x-x1)/(x2-x1);
335+
amrex::Real x = state.rho;
336+
amrex::Real x1 = std::pow(10.0_rt, drel10);
337+
amrex::Real x2 = std::pow(10.0_rt, drelim);
338+
amrex::Real alfa = (x-x2)/(x1-x2);
339+
amrex::Real beta = (x-x1)/(x2-x1);
340340
ocond = alfa*oh + beta*ov;
341341
} else if (dlog10 >= drelim) {
342342
ocond = ov;

0 commit comments

Comments
 (0)