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

Clean up whitespace #1348

Merged
merged 4 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion EOS/breakout/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void actual_eos (I input, T& state)
}
}

// Try to avoid the expensive log function. Since we don't need entropy
// Try to avoid the expensive log function. Since we don't need entropy
// in hydro solver, set it to an invalid but "nice" value for the plotfile.
if constexpr (has_entropy<T>::value) {
state.s = 1.0_rt;
Expand Down
2 changes: 1 addition & 1 deletion EOS/eos_composition.H
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct eos_xderivs_t {
/// The auxiliary state provides an alternate description to the composition,
/// in terms of Ye, abar, and binding energy / nucleon
///
template <class state_t>
template <class state_t>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void set_aux_comp_from_X(state_t& state) {

Expand Down
8 changes: 4 additions & 4 deletions EOS/helmholtz/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ using namespace eos_rp;
// derivatives), number density of electrons and positron pair (along
// with their derivatives), adiabatic indices, specific heats, and
// relativistically correct sound speed are also returned.
//
//
// this routine assumes planckian photons, an ideal gas of ions,
// and an electron-positron gas with an arbitrary degree of relativity
// and degeneracy. interpolation in a table of the helmholtz free energy
// is used to return the electron-positron thermodynamic quantities.
// all other derivatives are analytic.
//
//
// references: cox & giuli chapter 24 ; timmes & swesty apj 1999

const std::string eos_name = "helmholtz";
Expand Down Expand Up @@ -510,7 +510,7 @@ void apply_ions (T& state)
Real sion = (pion * deni + eion) * tempi + kergavo * ytot1 * y;
Real dsiondd = (dpiondd * deni - pion * deni * deni + deiondd) * tempi -
kergavo * deni * ytot1;
Real dsiondt = (dpiondt * deni + deiondt) * tempi -
Real dsiondt = (dpiondt * deni + deiondt) * tempi -
(pion * deni + eion) * tempi * tempi +
1.5e0_rt * kergavo * tempi * ytot1;

Expand Down Expand Up @@ -759,7 +759,7 @@ void apply_coulomb_corrections (T& state)
decoulda = s * dpcoulda;
decouldz = s * dpcouldz;

s = -avo_eos * kerg / (state.abar * plasg) *
s = -avo_eos * kerg / (state.abar * plasg) *
(1.5e0_rt * c2 * x - a2 * (b2 - 1.0e0_rt) * y);
dscouldd = s * plasgdd;
dscouldt = s * plasgdt;
Expand Down
4 changes: 2 additions & 2 deletions EOS/polytrope/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void actual_eos_init ()
// Available pre-defined polytrope options:

// 1: Non-relativistic, fully degenerate electron gas
// 2: Relativistic, fully degenerate electron gas
// 2: Relativistic, fully degenerate electron gas

if (polytrope_type > 0) {
mu_e = polytrope_mu_e;
Expand Down Expand Up @@ -88,7 +88,7 @@ bool is_input_valid (I input)


//---------------------------------------------------------------------------
// Public interfaces
// Public interfaces
//---------------------------------------------------------------------------

inline
Expand Down
8 changes: 4 additions & 4 deletions EOS/ztwd/actual_eos.H
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef ACTUAL_EOS_H
#define ACTUAL_EOS_H

// This is the equation of state for zero-temperature white dwarf
// This is the equation of state for zero-temperature white dwarf
// matter composed of degenerate electrons:
// P = A * (x * (2x**2 - 3)(x**2 + 1)**1/2 + 3 sinh**-1(x))
//
//
// where rho = B x**3 and the constants are given by:
//
// A = pi m_e**4 c**5 / (3 h**3) = 6.0 x 10^22 dyne cm**-2
Expand All @@ -16,7 +16,7 @@
// h = (8A / B) (1 + x**2)**(1/2)
//
// The internal energy is calculated using the standard relation:
//
//
// h = e + P / rho

#include <AMReX.H>
Expand All @@ -26,7 +26,7 @@
using namespace amrex;

const std::string eos_name = "ztwd";

const Real A = M_PI * std::pow(C::m_e, 4) * std::pow(C::c_light, 5) / (3.0_rt * std::pow(C::hplanck, 3));
const Real B2 = 8.0_rt * M_PI * std::pow(C::m_e, 3) * std::pow(C::c_light, 3) * C::m_p / (3.0_rt * std::pow(C::hplanck, 3));
const Real iter_tol = 1.e-10_rt;
Expand Down
2 changes: 1 addition & 1 deletion conductivity/stellar/actual_conductivity.H
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ actual_conductivity (T& state)
// ocond = conductive contribution to the opacity (in cm**2/g)
// opac = the total opacity (in cm**2/g)
// conductivity = thermal conductivity (in erg/cm/K/sec)
//
//

// various physical and derived constants
// con2 = con1*sqrt(4*pi*e*e/me)
Expand Down
4 changes: 2 additions & 2 deletions constants/fundamental_constants.H
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ namespace C

// mass of electron
constexpr amrex::Real m_e = 9.10938291e-28; // g

// atomic mass unit
constexpr amrex::Real m_u = 1.6605390666e-24; // g

// electron charge
// NIST: q_e = 1.602176565e-19 C
//
Expand Down
2 changes: 1 addition & 1 deletion integration/VODE/actual_integrator.H
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void actual_integrator (BurnT& state, Real dt)
integrator_to_burn(vode_state, state);

#ifdef NSE
// compute the temperature based on the energy release -- we need
// compute the temperature based on the energy release -- we need
// this in case we failed in our burn here because we entered NSE

#ifdef AUX_THERMO
Expand Down
8 changes: 4 additions & 4 deletions integration/VODE/vode_dvstep.H
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ int dvstep (BurnT& state, DvodeT& vstate)
bool valid_update = true;

#ifdef SDC
if (vstate.y(SEINT+1) < 0.0_rt) {
valid_update = false;
}
if (vstate.y(SEINT+1) < 0.0_rt) {
valid_update = false;
}

Real rho_current = state.rho_orig + vstate.tn * state.ydot_a[SRHO];

Expand All @@ -247,7 +247,7 @@ int dvstep (BurnT& state, DvodeT& vstate)
(std::abs(vstate.y(i)) > vode_increase_change_factor * std::abs(y_save(i)) ||
std::abs(vstate.y(i)) < vode_decrease_change_factor * std::abs(y_save(i)))) {
#ifdef MICROPHYSICS_DEBUG
#ifndef AMREX_USE_GPU
#ifndef AMREX_USE_GPU
std::cout << "rejecting step based on species " << i << " from " << y_save(i) << " to " << vstate.y(i) << std::endl;
#endif
#endif
Expand Down
2 changes: 1 addition & 1 deletion integration/integrator_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void update_density_in_time(const Real time, BurnT& state)
//
// we are always integrating from t = 0, so there is no offset
// time needed here. The indexing of ydot_a is based on
// the indices in burn_t and is 0-based
// the indices in burn_t and is 0-based
state.y[SRHO] = amrex::max(state.rho_orig + state.ydot_a[SRHO] * time, EOSData::mindens);

// for consistency
Expand Down
4 changes: 2 additions & 2 deletions interfaces/burn_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void eos_to_burn (const T& eos_state, BurnT& burn_state)



// Given a burn type, copy the data relevant to the eos type.
// Given a burn type, copy the data relevant to the eos type.
// Note that when doing simplified SDC integration, we should
// avoid using this interface because the energy includes a
// contribution from the advection term. However this is useful
Expand Down Expand Up @@ -315,7 +315,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void normalize_abundances_sdc_burn (BurnT& state)
{

// Constrain the partial densities in burn_t state to sum to the
// Constrain the partial densities in burn_t state to sum to the
// density.
//
// This is meant to be used upon exit, and we assume that
Expand Down
2 changes: 1 addition & 1 deletion interfaces/burner.H
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void burner (BurnT& state, Real dt)
#ifdef NSE_TABLE
if (in_nse(state, true) && state.success == false && dt_remaining > 0.0) {
#else
if (in_nse(state, nse_skip_molar) && state.success == false && dt_remaining > 0.0) {
if (in_nse(state, nse_skip_molar) && state.success == false && dt_remaining > 0.0) {
#endif

#ifndef AMREX_USE_GPU
Expand Down
2 changes: 1 addition & 1 deletion interfaces/eos_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ struct eos_rep_t:eos_base_t {

amrex::Real abar{};
amrex::Real zbar{};

#ifdef NSE_NET
amrex::Real mu_p{}; //chemical potential of proton
amrex::Real mu_n{}; //chemical potential of neutron
Expand Down
30 changes: 15 additions & 15 deletions interfaces/tfactors.H
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ struct tf_t {
amrex::Real lnt9;
};

AMREX_GPU_HOST_DEVICE inline
AMREX_GPU_HOST_DEVICE inline
tf_t get_tfactors(amrex::Real temp)
{
tf_t tf;
tf_t tf;

tf.temp = temp;

Expand All @@ -82,13 +82,13 @@ tf_t get_tfactors(amrex::Real temp)
// tf.t95 = tf.t9*tf.t94;
tf.t95 = tf.t92*tf.t93;
// tf.t96 = tf.t9*tf.t95;

tf.t912 = std::sqrt(tf.t9);
tf.t932 = tf.t9*tf.t912;
tf.t952 = tf.t9*tf.t932;
// tf.t972 = tf.t9*tf.t952;
tf.t972 = tf.t92*tf.t932;

tf.t913 = std::cbrt(tf.t9);
tf.t923 = tf.t913*tf.t913;
tf.t943 = tf.t9*tf.t913;
Expand All @@ -100,51 +100,51 @@ tf_t get_tfactors(amrex::Real temp)
// tf.t934 = tf.t914*tf.t914*tf.t914;
// tf.t954 = tf.t9*tf.t914;
// tf.t974 = tf.t9*tf.t934;

// tf.t915 = std::pow(tf.t9, 0.2_rt);
// tf.t935 = tf.t915*tf.t915*tf.t915;
// tf.t945 = tf.t915 * tf.t935;
// tf.t965 = tf.t9 * tf.t915;

// tf.t916 = std::pow(tf.t9, 1.0_rt/6.0_rt);
// tf.t976 = tf.t9 * tf.t916;
// tf.t9i76 = 1.0e0_rt/tf.t976;

// tf.t917 = std::pow(tf.t9, 1.0_rt/7.0_rt);
// tf.t927 = tf.t917*tf.t917;
// tf.t947 = tf.t927*tf.t927;

// tf.t918 = std::sqrt(tf.t914);
// tf.t938 = tf.t918*tf.t918*tf.t918;
// tf.t958 = tf.t938*tf.t918*tf.t918;

tf.t9i = 1.0e0_rt/tf.t9;
tf.t9i2 = tf.t9i*tf.t9i;
// tf.t9i3 = tf.t9i2*tf.t9i;

tf.t9i12 = 1.0e0_rt/tf.t912;
tf.t9i32 = tf.t9i*tf.t9i12;
// tf.t9i52 = tf.t9i*tf.t9i32;
// tf.t9i72 = tf.t9i*tf.t9i52;

tf.t9i13 = 1.0e0_rt/tf.t913;
tf.t9i23 = tf.t9i13*tf.t9i13;
tf.t9i43 = tf.t9i*tf.t9i13;
tf.t9i53 = tf.t9i*tf.t9i23;

// tf.t9i14 = 1.0e0_rt/tf.t914;
// tf.t9i34 = tf.t9i14*tf.t9i14*tf.t9i14;
// tf.t9i54 = tf.t9i*tf.t9i14;

// tf.t9i15 = 1.0e0_rt/tf.t915;
// tf.t9i35 = tf.t9i15*tf.t9i15*tf.t9i15;
// tf.t9i45 = tf.t9i15 * tf.t9i35;
// tf.t9i65 = tf.t9i*tf.t9i15;

// tf.t9i17 = 1.0e0_rt/tf.t917;
// tf.t9i27 = tf.t9i17*tf.t9i17;
// tf.t9i47 = tf.t9i27*tf.t9i27;

// tf.t9i18 = 1.0e0_rt/tf.t918;
// tf.t9i38 = tf.t9i18*tf.t9i18*tf.t9i18;
// tf.t9i58 = tf.t9i38*tf.t9i18*tf.t9i18;
Expand Down
2 changes: 1 addition & 1 deletion networks/aprox13/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ namespace Rates {
}

namespace RHS {

AMREX_GPU_HOST_DEVICE AMREX_INLINE
constexpr rhs_t rhs_data (int rate)
{
Expand Down
2 changes: 1 addition & 1 deletion networks/aprox19/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ namespace Rates {
}

namespace RHS {

AMREX_GPU_HOST_DEVICE AMREX_INLINE
constexpr rhs_t rhs_data (int rate)
{
Expand Down
2 changes: 1 addition & 1 deletion networks/aprox21/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ namespace Rates {
}

namespace RHS {

AMREX_GPU_HOST_DEVICE AMREX_INLINE
constexpr rhs_t rhs_data (int rate)
{
Expand Down
2 changes: 1 addition & 1 deletion networks/rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ constexpr int is_rate_used ()

// Determine the index of a given intermediate reaction. We use the
// order of the original rate definitions

// Counts up the number of intermediate reactions. An intermediate
// reaction is defined as any reaction which contributes to the
// construction of some other reaction. Note that an intermediate
Expand Down
2 changes: 1 addition & 1 deletion networks/triple_alpha_plus_cago/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace Rates
};

namespace RHS {

AMREX_GPU_HOST_DEVICE AMREX_INLINE
constexpr rhs_t rhs_data (int rate)
{
Expand Down
38 changes: 19 additions & 19 deletions nse_solver/make_table/burn_cell.H
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@ void burn_cell_c()
state.rho = rho;
state.y_e = Ye;

if (state.y_e > 0.52_rt){
state.mu_p = -1.0_rt;
state.mu_n = -16.0_rt;
}
else if (state.y_e > 0.48_rt){
state.mu_p = -6.0_rt;
state.mu_n = -11.0_rt;
}
else if (state.y_e > 0.4_rt){
state.mu_p = -10.0_rt;
state.mu_n = -7.0_rt;
}
else{
state.mu_p = -18.0;
state.mu_n = -1.0;
}
if (state.y_e > 0.52_rt){
state.mu_p = -1.0_rt;
state.mu_n = -16.0_rt;
}
else if (state.y_e > 0.48_rt){
state.mu_p = -6.0_rt;
state.mu_n = -11.0_rt;
}
else if (state.y_e > 0.4_rt){
state.mu_p = -10.0_rt;
state.mu_n = -7.0_rt;
}
else{
state.mu_p = -18.0;
state.mu_n = -1.0;
}

// find the nse state

const bool assume_ye_is_valid = true;
Real eps = 1.e-10;
use_hybrid_solver = 1;
use_hybrid_solver = 1;

auto nse_state = get_actual_nse_state(state, eps, assume_ye_is_valid);

std::cout << std::scientific;
std::cout << std::scientific;
std::cout << std::setw(20) << state.rho << " "
<< std::setw(20) << state.T << " " << std::fixed
<< std::setw(20) << state.y_e << " "
Expand Down
Loading
Loading