Skip to content

Commit

Permalink
start moving away from "using namespace amrex" (#1465)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Feb 8, 2024
1 parent f222253 commit b5d1a91
Show file tree
Hide file tree
Showing 17 changed files with 759 additions and 762 deletions.
10 changes: 5 additions & 5 deletions EOS/breakout/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void actual_eos (I input, T& state)
{
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");

const Real R = C::k_B * C::n_A;
const amrex::Real R = C::k_B * C::n_A;

// Calculate mu. This is the only difference between
// this EOS and gamma_law.
Expand All @@ -62,8 +62,8 @@ void actual_eos (I input, T& state)
{

// dens, temp and xmass are inputs
Real cv = R / (state.mu * (gamma_const - 1.0_rt));
Real e = cv * state.T;
amrex::Real cv = R / (state.mu * (gamma_const - 1.0_rt));
amrex::Real e = cv * state.T;
if constexpr (has_energy<T>::value) {
state.cv = cv;
state.e = e;
Expand Down Expand Up @@ -100,7 +100,7 @@ void actual_eos (I input, T& state)
// dens, pres, and xmass are inputs

if constexpr (has_pressure<T>::value) {
Real poverrho = state.p / state.rho;
amrex::Real poverrho = state.p / state.rho;
state.T = poverrho * state.mu * (1.0_rt / R);
if constexpr (has_energy<T>::value) {
state.e = poverrho * (1.0_rt / (gamma_const - 1.0_rt));
Expand All @@ -115,7 +115,7 @@ void actual_eos (I input, T& state)
// dens, energy, and xmass are inputs

if constexpr (has_energy<T>::value) {
Real poverrho = (gamma_const - 1.0_rt) * state.e;
amrex::Real poverrho = (gamma_const - 1.0_rt) * state.e;
state.T = poverrho * state.mu * (1.0_rt / R);

if constexpr (has_pressure<T>::value) {
Expand Down
10 changes: 5 additions & 5 deletions EOS/eos_composition.H
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
#include <actual_network.H>
#endif

using namespace amrex;
using namespace amrex::literals;

#ifdef AUX_THERMO
using namespace AuxZero;
#endif

struct eos_xderivs_t {
Real dedX[NumSpec];
Real dpdX[NumSpec];
Real dhdX[NumSpec];
amrex::Real dedX[NumSpec];
amrex::Real dpdX[NumSpec];
amrex::Real dhdX[NumSpec];
};

#ifdef AUX_THERMO
Expand Down Expand Up @@ -65,7 +65,7 @@ void composition (T& state)

#else

Real sum = 0;
amrex::Real sum = 0;
for (int n = 0; n < NumSpec; n++) {
sum += state.xn[n] * zion[n] * aion_inv[n];
}
Expand Down
14 changes: 7 additions & 7 deletions EOS/gamma_law/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ void actual_eos (I input, T& state)
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");

// Get the mass of a nucleon from m_u.
const Real m_nucleon = C::m_u;
const amrex::Real m_nucleon = C::m_u;

if constexpr (has_xn<T>::value) {
if (eos_assume_neutral) {
state.mu = state.abar;
} else {
Real sum = 0.0;
amrex::Real sum = 0.0;
for (int n = 0; n < NumSpec; n++) {
sum += (zion[n] + 1.0) * state.xn[n] * aion_inv[n];
}
Expand Down Expand Up @@ -193,13 +193,13 @@ void actual_eos (I input, T& state)
// Now we have the density and temperature (and mass fractions /
// mu), regardless of the inputs.

Real Tinv = 1.0 / state.T;
Real rhoinv = 1.0 / state.rho;
amrex::Real Tinv = 1.0 / state.T;
amrex::Real rhoinv = 1.0 / state.rho;

// Compute the pressure simply from the ideal gas law, and the
// specific internal energy using the gamma-law EOS relation.
Real pressure = state.rho * state.T * C::k_B / (state.mu * m_nucleon);
Real energy = pressure / (eos_gamma - 1.0) * rhoinv;
amrex::Real pressure = state.rho * state.T * C::k_B / (state.mu * m_nucleon);
amrex::Real energy = pressure / (eos_gamma - 1.0) * rhoinv;
if constexpr (has_pressure<T>::value) {
state.p = pressure;
}
Expand All @@ -215,7 +215,7 @@ void actual_eos (I input, T& state)
// entropy (per gram) of an ideal monoatomic gas (the Sackur-Tetrode equation)
// NOTE: this expression is only valid for gamma = 5/3.
if constexpr (has_entropy<T>::value) {
const Real fac = 1.0 / std::pow(2.0 * M_PI * C::hbar * C::hbar, 1.5);
const amrex::Real fac = 1.0 / std::pow(2.0 * M_PI * C::hbar * C::hbar, 1.5);

state.s = (C::k_B / (state.mu * m_nucleon)) *
(2.5 + std::log((std::pow(state.mu * m_nucleon, 2.5) * rhoinv) *
Expand Down
Loading

0 comments on commit b5d1a91

Please sign in to comment.