Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start moving away from "using namespace amrex" #1465

Merged
merged 10 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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