From 1f779a922a860a62a11a5511aad6653bd2c3abb8 Mon Sep 17 00:00:00 2001 From: "Eric T. Johnson" Date: Fri, 15 Sep 2023 16:42:49 -0400 Subject: [PATCH] Trim trailing whitespace --- EOS/breakout/actual_eos.H | 2 +- EOS/eos_composition.H | 2 +- EOS/helmholtz/actual_eos.H | 8 +- EOS/polytrope/actual_eos.H | 4 +- EOS/ztwd/actual_eos.H | 8 +- conductivity/stellar/actual_conductivity.H | 2 +- constants/fundamental_constants.H | 4 +- integration/VODE/actual_integrator.H | 2 +- integration/VODE/vode_dvstep.H | 2 +- integration/integrator_type.H | 2 +- interfaces/burn_type.H | 4 +- interfaces/eos_type.H | 2 +- interfaces/tfactors.H | 30 +- networks/aprox13/actual_network.H | 2 +- networks/aprox19/actual_network.H | 2 +- networks/aprox21/actual_network.H | 2 +- networks/rhs.H | 2 +- .../triple_alpha_plus_cago/actual_network.H | 2 +- nse_solver/nse_check.H | 48 +- nse_solver/nse_solver.H | 14 +- rates/aprox_rates.H | 436 +++++++++--------- rates/aprox_rates_data.H | 2 +- screening/screen.H | 54 +-- .../burn_cell_primordial_chem/burn_cell.H | 4 +- unit_test/burn_cell_sdc/burn_cell.H | 12 +- .../test_aprox_rates/aprox_rates_util.cpp | 4 +- unit_test/test_aprox_rates/variables.cpp | 2 +- unit_test/test_ase/burn_cell.H | 10 +- unit_test/test_ase/main.cpp | 2 +- unit_test/test_ase/make_table/burn_cell.H | 2 +- unit_test/test_nse/nse_example.H | 18 +- unit_test/test_screening/screening_util.cpp | 2 +- unit_test/test_sdc/react_zones.H | 2 +- unit_test/test_sdc/variables.cpp | 2 +- unit_test/write_job_info.cpp | 2 +- 35 files changed, 349 insertions(+), 349 deletions(-) diff --git a/EOS/breakout/actual_eos.H b/EOS/breakout/actual_eos.H index 342b36fba7..25067019c8 100644 --- a/EOS/breakout/actual_eos.H +++ b/EOS/breakout/actual_eos.H @@ -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::value) { state.s = 1.0_rt; diff --git a/EOS/eos_composition.H b/EOS/eos_composition.H index cc72c5080d..be39fa0492 100644 --- a/EOS/eos_composition.H +++ b/EOS/eos_composition.H @@ -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 +template AMREX_GPU_HOST_DEVICE AMREX_INLINE void set_aux_comp_from_X(state_t& state) { diff --git a/EOS/helmholtz/actual_eos.H b/EOS/helmholtz/actual_eos.H index 51e7da22d9..38ed157b8e 100644 --- a/EOS/helmholtz/actual_eos.H +++ b/EOS/helmholtz/actual_eos.H @@ -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"; @@ -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; @@ -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; diff --git a/EOS/polytrope/actual_eos.H b/EOS/polytrope/actual_eos.H index 8a2b353568..8de4617635 100644 --- a/EOS/polytrope/actual_eos.H +++ b/EOS/polytrope/actual_eos.H @@ -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; @@ -88,7 +88,7 @@ bool is_input_valid (I input) //--------------------------------------------------------------------------- -// Public interfaces +// Public interfaces //--------------------------------------------------------------------------- inline diff --git a/EOS/ztwd/actual_eos.H b/EOS/ztwd/actual_eos.H index bc9a36e29b..6a02edb802 100644 --- a/EOS/ztwd/actual_eos.H +++ b/EOS/ztwd/actual_eos.H @@ -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 @@ -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 @@ -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; diff --git a/conductivity/stellar/actual_conductivity.H b/conductivity/stellar/actual_conductivity.H index 2d2540e5a0..ee308c940e 100644 --- a/conductivity/stellar/actual_conductivity.H +++ b/conductivity/stellar/actual_conductivity.H @@ -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) diff --git a/constants/fundamental_constants.H b/constants/fundamental_constants.H index c07d0beca4..2a16b6e0e0 100644 --- a/constants/fundamental_constants.H +++ b/constants/fundamental_constants.H @@ -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 // diff --git a/integration/VODE/actual_integrator.H b/integration/VODE/actual_integrator.H index 45cdbe324c..35fa40c950 100644 --- a/integration/VODE/actual_integrator.H +++ b/integration/VODE/actual_integrator.H @@ -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 diff --git a/integration/VODE/vode_dvstep.H b/integration/VODE/vode_dvstep.H index e5602dd80e..6a77bc94e5 100644 --- a/integration/VODE/vode_dvstep.H +++ b/integration/VODE/vode_dvstep.H @@ -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 diff --git a/integration/integrator_type.H b/integration/integrator_type.H index 510f245da6..af653507dd 100644 --- a/integration/integrator_type.H +++ b/integration/integrator_type.H @@ -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 diff --git a/interfaces/burn_type.H b/interfaces/burn_type.H index 9e7edbd4df..c489951626 100644 --- a/interfaces/burn_type.H +++ b/interfaces/burn_type.H @@ -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 @@ -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 diff --git a/interfaces/eos_type.H b/interfaces/eos_type.H index cdfe210a13..db5d6dd695 100644 --- a/interfaces/eos_type.H +++ b/interfaces/eos_type.H @@ -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 diff --git a/interfaces/tfactors.H b/interfaces/tfactors.H index 856795b297..983b2d43c1 100644 --- a/interfaces/tfactors.H +++ b/interfaces/tfactors.H @@ -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; @@ -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; @@ -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; diff --git a/networks/aprox13/actual_network.H b/networks/aprox13/actual_network.H index a3687a71a6..7a1cce53f4 100644 --- a/networks/aprox13/actual_network.H +++ b/networks/aprox13/actual_network.H @@ -174,7 +174,7 @@ namespace Rates { } namespace RHS { - + AMREX_GPU_HOST_DEVICE AMREX_INLINE constexpr rhs_t rhs_data (int rate) { diff --git a/networks/aprox19/actual_network.H b/networks/aprox19/actual_network.H index 55ec7d06c6..75f8bfcf22 100644 --- a/networks/aprox19/actual_network.H +++ b/networks/aprox19/actual_network.H @@ -230,7 +230,7 @@ namespace Rates { } namespace RHS { - + AMREX_GPU_HOST_DEVICE AMREX_INLINE constexpr rhs_t rhs_data (int rate) { diff --git a/networks/aprox21/actual_network.H b/networks/aprox21/actual_network.H index ab2be1cfd6..1367e6fd94 100644 --- a/networks/aprox21/actual_network.H +++ b/networks/aprox21/actual_network.H @@ -226,7 +226,7 @@ namespace Rates { } namespace RHS { - + AMREX_GPU_HOST_DEVICE AMREX_INLINE constexpr rhs_t rhs_data (int rate) { diff --git a/networks/rhs.H b/networks/rhs.H index e507d786aa..628818195b 100644 --- a/networks/rhs.H +++ b/networks/rhs.H @@ -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 diff --git a/networks/triple_alpha_plus_cago/actual_network.H b/networks/triple_alpha_plus_cago/actual_network.H index 55ba0c0491..8d86343d8c 100644 --- a/networks/triple_alpha_plus_cago/actual_network.H +++ b/networks/triple_alpha_plus_cago/actual_network.H @@ -102,7 +102,7 @@ namespace Rates }; namespace RHS { - + AMREX_GPU_HOST_DEVICE AMREX_INLINE constexpr rhs_t rhs_data (int rate) { diff --git a/nse_solver/nse_check.H b/nse_solver/nse_check.H index dba9fb88a3..15972e4ae9 100644 --- a/nse_solver/nse_check.H +++ b/nse_solver/nse_check.H @@ -35,7 +35,7 @@ void check_nse_molar(burn_t& state, const burn_t& nse_state, bool& nse_check) { if (NSE_INDEX::h1_index == -1 || NSE_INDEX::he4_index == -1) { amrex::Error("Need proton and helium-4 in the network for NSE_NET to work"); } - + // If there are proton, or helium in the network // Check if n,p,a are in equilibrium @@ -655,11 +655,11 @@ bool in_single_group(const amrex::Array1D& group_ind) { // This function checks whether all isotopes are either in the LIG group // or in another single group. - + int LIG_root_index = get_root_index(NSE_INDEX::he4_index, group_ind); int nonLIG_index = -1; - + int oddN_group = -1; int evenN_group = -1; @@ -681,7 +681,7 @@ bool in_single_group(const amrex::Array1D& group_ind) { in_single_group = false; break; } - + } // If there no neutrons are in the network and original condition failed @@ -689,7 +689,7 @@ bool in_single_group(const amrex::Array1D& group_ind) { // There seems to be two big groups after Si28 in NSE: // 1) isotopes with even N // 2) isotopes with odd N - + if (NSE_INDEX::n_index == -1 && !in_single_group) { in_single_group = true; @@ -731,7 +731,7 @@ void fill_merge_indices(amrex::Array1D& merge_indices, const amrex::Array1D& screened_rates, const amrex::Array1D& group_ind, const amrex::Real& t_s) { - + // This function fills in the merge index of the current rate. // The timescale of the current rate must be shorter (faster) than fastest_t @@ -756,15 +756,15 @@ void fill_merge_indices(amrex::Array1D& merge_indices, if (NSE_INDEX::rate_indices(current_rate, k) == -1) { continue; } - + if (NSE_INDEX::rate_indices(current_rate, k) != NSE_INDEX::h1_index && NSE_INDEX::rate_indices(current_rate, k) != NSE_INDEX::n_index && NSE_INDEX::rate_indices(current_rate, k) != NSE_INDEX::he4_index ) { ++m; - + // skip if there are more than 2 non neutron, proton, or helium-4 in the rate - + if (m > 2) { return; } @@ -794,7 +794,7 @@ void fill_merge_indices(amrex::Array1D& merge_indices, if (root_index == nonLIG_root) { return; - } + } nonLIG_root = root_index; } } @@ -804,7 +804,7 @@ void fill_merge_indices(amrex::Array1D& merge_indices, if (num_nonLIG == 0 || num_nonLIG > 2) { return; } - + // Find the Y_group of the nuclei involved in the net // Y_group are the group molar fractions corresponding to the reactants and products // first 3 for reactants, last 3 for products @@ -817,9 +817,9 @@ void fill_merge_indices(amrex::Array1D& merge_indices, continue; } root_index = get_root_index(NSE_INDEX::rate_indices(current_rate, k), group_ind); - + // let LIG group use their own Y instead of Y_group. (not sure if this is true) - + if (root_index == get_root_index(NSE_INDEX::he4_index, group_ind)) { Y_group(k) = Y(NSE_INDEX::rate_indices(current_rate, k) + 1); } @@ -856,7 +856,7 @@ void fill_merge_indices(amrex::Array1D& merge_indices, } b_r *= Y(NSE_INDEX::rate_indices(current_rate, 5) + 1) * state.rho; } - + // Find the timescale of the rate, See Eq. 17 and Eq. 11 in Kushnir amrex::Real t_i = Y_group(nonNPA_ind(1)) / amrex::min(b_f, b_r); @@ -865,7 +865,7 @@ void fill_merge_indices(amrex::Array1D& merge_indices, } // return if current rate timescale is larger (slower) than previous time scale. - + if (fastest_t < t_i) { return; } @@ -921,12 +921,12 @@ void nse_grouping(amrex::Array1D& group_ind, const burn_t& stat group_ind(i) = 1; } } - + // Now do the grouping based on the timescale. - + amrex::Array1D merge_indices; amrex::Real fastest_t; - + // Go through each reaction and perform grouping while(true) { @@ -960,7 +960,7 @@ bool in_nse(burn_t& current_state, bool skip_molar_check=false) { // This function returns the boolean that tells whether we're in nse or not // Note that it only works with pynucastro network for now. - + #ifndef NEW_NETWORK_IMPLEMENTATION current_state.nse = false; @@ -987,7 +987,7 @@ bool in_nse(burn_t& current_state, bool skip_molar_check=false) { state.xn[n] = current_state.y[SFS+n] / current_state.rho; } #endif - + // Check whether state is in the ballpark of NSE if (!skip_molar_check) { @@ -1000,7 +1000,7 @@ bool in_nse(burn_t& current_state, bool skip_molar_check=false) { // A simple temperature criteria after molar fraction check for determining NSE state // By default, T_nse_net = -1.0 // So this is only enabled if the user provides value in the input file - + if (T_nse_net > 0.0_rt && T_in > T_nse_net) { current_state.nse = true; return current_state.nse; @@ -1011,7 +1011,7 @@ bool in_nse(burn_t& current_state, bool skip_molar_check=false) { // the thermodynamic condition. // Note we only do this after the first check, which should tell us whether // our current mass fractions are in the ballpark of NSE mass fractions. - + if (nse_molar_independent || skip_molar_check) { state = nse_state; state.dx = current_state.dx; @@ -1050,7 +1050,7 @@ bool in_nse(burn_t& current_state, bool skip_molar_check=false) { if (!nse_dx_independent) { burn_to_eos(state, eos_state); eos(eos_input_rt, eos_state); - + // a parameter to characterize whether a rate is fast enough t_s = state.dx / eos_state.cs; @@ -1079,7 +1079,7 @@ bool in_nse(burn_t& current_state, bool skip_molar_check=false) { // fill in energy generation rate to ydot ydot(NumSpec + 1) = enuc - sneut; - + bool found_fast_reaction_cycle = true; // Additional constraint if there is neutron in the network: diff --git a/nse_solver/nse_solver.H b/nse_solver/nse_solver.H index efe699144f..307e3730a5 100644 --- a/nse_solver/nse_solver.H +++ b/nse_solver/nse_solver.H @@ -34,7 +34,7 @@ T get_nonexponent_nse_state(const T& state) { T nse_state = state; // set partition function and spin - + amrex::Real pf = 1.0_rt; [[maybe_unused]] amrex::Real dpf_dT; amrex::Real spin = 1.0_rt; @@ -102,7 +102,7 @@ void apply_nse_exponent(T& nse_state) { #endif amrex::Real u_c = 0.0_rt; - + for (int n = 0; n < NumSpec; ++n) { #ifdef NEW_NETWORK_IMPLEMENTATION if (n == NSE_INDEX::h1_index) { @@ -162,7 +162,7 @@ void fcn(Array1D& x, Array1D& fvec, const T& state, int& iflag) { // here state is the nse_state from get_nonexponent_nse_state amrex::ignore_unused(iflag); - + T nse_state = state; nse_state.mu_p = x(1); nse_state.mu_n = x(2); @@ -198,7 +198,7 @@ void jcn(Array1D& x, Array2D& fjac, const T& state, int& iflag) { // here state is the nse_state from get_nonexponent_nse_state amrex::ignore_unused(iflag); - + T nse_state = state; nse_state.mu_p = x(1); nse_state.mu_n = x(2); @@ -355,10 +355,10 @@ void nse_nr_solver(T& state, amrex::Real eps=1.0e-10_rt) { // store determinant for finding inverse jac amrex::Real det; - + // store inverse jacobian amrex::Array2D inverse_jac; - + // difference in chemical potential of proton and neutron amrex::Real d_mu_p = std::numeric_limits::max(); amrex::Real d_mu_n = std::numeric_limits::max(); @@ -511,7 +511,7 @@ T get_actual_nse_state(T& state, amrex::Real eps=1.0e-10_rt, state.mu_p = nse_state.mu_p; state.mu_n = nse_state.mu_n; - + return nse_state; } #endif diff --git a/rates/aprox_rates.H b/rates/aprox_rates.H index 0cdc9264a7..880efdd8b4 100644 --- a/rates/aprox_rates.H +++ b/rates/aprox_rates.H @@ -8,7 +8,7 @@ using namespace amrex; using namespace network_rp; -inline +inline void rates_init() { // store rates @@ -65,10 +65,10 @@ void rates_init() } } -AMREX_GPU_HOST_DEVICE inline -void rate_c12ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_c12ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { if (use_c12ag_deboer17) { // This version computes the nuclear reaction rate for 12C(a,g)16O and its inverse @@ -209,9 +209,9 @@ void rate_c12ag(const tf_t& tf, const Real den, Real& fr, } -AMREX_GPU_HOST_DEVICE inline -void rate_triplealf(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_triplealf(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, Real& drrdt) { const Real rc28 = 0.1_rt; const Real q1 = 1.0_rt / 0.009604e0_rt; @@ -294,10 +294,10 @@ void rate_triplealf(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_c12c12(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_c12c12(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // c12 + c12 reaction // this is the C12(C12,g)Mg24 rate from Caughlin & Fowler (1988) @@ -328,10 +328,10 @@ void rate_c12c12(const tf_t& tf, const Real den, Real& fr, drrdt = 0.0e0_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_c12o16(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_c12o16(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // c12 + o16 reaction; see cf88 references 47-4 Real term, dtermdt; @@ -363,7 +363,7 @@ void rate_c12o16(const tf_t& tf, const Real den, Real& fr, zz = 1.0e0_rt/cc; term = 1.72e31_rt * t9a56 * tf.t9i32 * std::exp(-106.594_rt/t9a13) * zz; - dtermdt = term*(dt9a56/t9a56 - 1.5e0_rt*tf.t9i + dtermdt = term*(dt9a56/t9a56 - 1.5e0_rt*tf.t9i + 106.594_rt/t9a23*dt9a13 - zz*dcc); } else { @@ -380,20 +380,20 @@ void rate_c12o16(const tf_t& tf, const Real den, Real& fr, drrdt = 0.0e0_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_o16o16(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_o16o16(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // o16 + o16 // this is the O16(O16,g)S32 rate from Caughlin & Fowler (1988) const Real term = 7.10e36_rt * tf.t9i23 * - std::exp(-135.93_rt * tf.t9i13 - 0.629_rt*tf.t923 + std::exp(-135.93_rt * tf.t9i13 - 0.629_rt*tf.t923 - 0.445_rt*tf.t943 + 0.0103_rt*tf.t9*tf.t9); const Real dtermdt = -2.0_rt/3.0_rt*term*tf.t9i - + term * (1.0_rt/3.0_rt*135.93_rt*tf.t9i43 - 2.0_rt/3.0_rt*0.629_rt*tf.t9i13 + + term * (1.0_rt/3.0_rt*135.93_rt*tf.t9i43 - 2.0_rt/3.0_rt*0.629_rt*tf.t9i13 - 4.0_rt/3.0_rt*0.445_rt*tf.t913 + 0.0206_rt*tf.t9); // rates @@ -404,10 +404,10 @@ void rate_o16o16(const tf_t& tf, const Real den, Real& fr, drrdt = 0.0e0_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_o16ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_o16ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { const Real q1 = 1.0e0_rt/2.515396e0_rt; @@ -441,10 +441,10 @@ void rate_o16ag(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_ne20ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_ne20ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { const Real rc102 = 0.1_rt; const Real q1 = 1.0e0_rt/4.923961e0_rt; @@ -500,10 +500,10 @@ void rate_ne20ag(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_mg24ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_mg24ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { const Real rc121 = 0.1e0_rt; @@ -546,10 +546,10 @@ void rate_mg24ag(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_mg24ap(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_mg24ap(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { const Real rc148 = 0.1_rt; const Real q1 = 1.0_rt / 0.024649e0_rt; @@ -604,10 +604,10 @@ void rate_mg24ap(const tf_t& tf, const Real den, Real& fr, drrdt = den * dtermdt * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_al27pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_al27pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // al27(p,g)si28 // champagne 1996 @@ -647,10 +647,10 @@ void rate_al27pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_al27pg_old(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_al27pg_old(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { const Real rc147 = 0.1_rt; const Real q1 = 1.0e0_rt/0.024025e0_rt; @@ -706,10 +706,10 @@ void rate_al27pg_old(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_si28ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_si28ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // si28(a,g)s32 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -725,7 +725,7 @@ void rate_si28ag(const tf_t& tf, const Real den, Real& fr, const Real term = 4.82e22_rt * tf.t9i23 * std::exp(-61.015_rt * tf.t9i13 * aa); const Real dtermdt = term*(-2.0_rt/3.0_rt*tf.t9i + 61.015_rt*tf.t9i13*(1.0_rt/3.0_rt*tf.t9i*aa - daa)); - + // the rates fr = den * term; dfrdt = den * dtermdt * 1.0e-9_rt; @@ -737,10 +737,10 @@ void rate_si28ag(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_si28ap(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_si28ap(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // si28(a,p)p31 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -769,10 +769,10 @@ void rate_si28ap(const tf_t& tf, const Real den, Real& fr, drrdt = den * dtermdt * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_p31pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_p31pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // p31(p,g)s32 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -800,10 +800,10 @@ void rate_p31pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_s32ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_s32ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // s32(a,g)ar36 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -831,10 +831,10 @@ void rate_s32ag(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_s32ap(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_s32ap(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // s32(a,p)cl35 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -862,15 +862,15 @@ void rate_s32ap(const tf_t& tf, const Real den, Real& fr, drrdt = den * dtermdt * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_cl35pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_cl35pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // cl35(p,g)ar36 const Real aa = 1.0e0_rt + 1.761e-1_rt*tf.t9 - 1.322e-2_rt*tf.t92 + 5.245e-4_rt*tf.t93; const Real daa = 1.761e-1_rt - 2.0e0_rt*1.322e-2_rt*tf.t9 + 3.0e0_rt*5.245e-4_rt*tf.t92; - + const Real term = 4.48e16_rt * tf.t9i23 * std::exp(-29.483_rt * tf.t9i13 * aa); const Real dtermdt = term*(-2.0_rt/3.0_rt*tf.t9i + 29.483_rt*tf.t9i13*(1.0_rt/3.0_rt*tf.t9i*aa - daa)); @@ -885,10 +885,10 @@ void rate_cl35pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_ar36ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_ar36ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // ar36(a,g)ca40 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -916,10 +916,10 @@ void rate_ar36ag(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_ar36ap(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_ar36ap(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // ar36(a,p)k39 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -947,10 +947,10 @@ void rate_ar36ap(const tf_t& tf, const Real den, Real& fr, drrdt = den * dtermdt * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_k39pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_k39pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // k39(p,g)ca40 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -978,10 +978,10 @@ void rate_k39pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_ca40ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_ca40ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // ca40(a,g)ti44 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1009,10 +1009,10 @@ void rate_ca40ag(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_ca40ap(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_ca40ap(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // ca40(a,p)sc43 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1040,10 +1040,10 @@ void rate_ca40ap(const tf_t& tf, const Real den, Real& fr, drrdt = den * dtermdt * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_sc43pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_sc43pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // sc43(p,g)ca40 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1071,10 +1071,10 @@ void rate_sc43pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_ti44ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_ti44ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // ti44(a,g)cr48 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1102,10 +1102,10 @@ void rate_ti44ag(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_ti44ap(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_ti44ap(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // ti44(a,p)v47 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1133,10 +1133,10 @@ void rate_ti44ap(const tf_t& tf, const Real den, Real& fr, drrdt = den * dtermdt * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_v47pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_v47pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // v47(p,g)cr48 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1164,10 +1164,10 @@ void rate_v47pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_cr48ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_cr48ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // cr48(a,g)fe52 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1195,10 +1195,10 @@ void rate_cr48ag(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_cr48ap(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_cr48ap(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // cr48(a,p)mn51 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1226,10 +1226,10 @@ void rate_cr48ap(const tf_t& tf, const Real den, Real& fr, drrdt = den * (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_mn51pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_mn51pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // mn51(p,g)fe52 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1257,10 +1257,10 @@ void rate_mn51pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_fe52ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_fe52ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // fe52(a,g)ni56 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1288,10 +1288,10 @@ void rate_fe52ag(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_fe52ap(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_fe52ap(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // fe52(a,p)co55 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1319,10 +1319,10 @@ void rate_fe52ap(const tf_t& tf, const Real den, Real& fr, drrdt = den * (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_co55pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_co55pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // co55(p,g)ni56 const Real z = amrex::min(tf.t9, 10.0e0_rt); @@ -1350,10 +1350,10 @@ void rate_co55pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_pp(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_pp(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // p(p,e+nu)d Real term, dtermdt; @@ -1380,10 +1380,10 @@ void rate_pp(const tf_t& tf, const Real den, Real& fr, drrdt = 0.0e0_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_png(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_png(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // p(n,g)d // smith,kawano,malany 1992 @@ -1417,10 +1417,10 @@ void rate_png(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_dpg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_dpg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // d(p,g)he3 const Real aa = 2.24e3_rt * tf.t9i23 * std::exp(-3.720_rt*tf.t9i13); @@ -1443,10 +1443,10 @@ void rate_dpg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_he3ng(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_he3ng(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // he3(n,g)he4 const Real term = 6.62_rt * (1.0e0_rt + 905.0_rt*tf.t9); @@ -1463,10 +1463,10 @@ void rate_he3ng(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_he3he3(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_he3he3(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // he3(he3,2p)he4 const Real aa = 6.04e10_rt * tf.t9i23 * std::exp(-12.276_rt*tf.t9i13); @@ -1491,10 +1491,10 @@ void rate_he3he3(const tf_t& tf, const Real den, Real& fr, drrdt = den * den * (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_he3he4(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_he3he4(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // he3(he4,g)be7 const Real aa = 1.0e0_rt + 0.0495_rt*tf.t9; @@ -1526,10 +1526,10 @@ void rate_he3he4(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_c12pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_c12pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { const Real q1 = 1.0e0_rt/2.25e0_rt; @@ -1565,11 +1565,11 @@ void rate_c12pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_n14pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) -{ +AMREX_GPU_HOST_DEVICE inline +void rate_n14pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) +{ const Real q1 = 1.0e0_rt/10.850436e0_rt; // n14(p,g)o15 @@ -1604,10 +1604,10 @@ void rate_n14pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_n15pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_n15pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { const Real q1 = 1.0_rt / 0.2025_rt; @@ -1646,10 +1646,10 @@ void rate_n15pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_n15pa(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_n15pa(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { const Real theta = 0.1_rt; const Real q1 = 1.0_rt / 0.272484_rt; @@ -1692,10 +1692,10 @@ void rate_n15pa(const tf_t& tf, const Real den, Real& fr, drrdt = den * (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_o16pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_o16pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // o16(p,g)f17 const Real aa = std::exp(-0.728_rt*tf.t923); @@ -1728,10 +1728,10 @@ void rate_o16pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_n14ag(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_n14ag(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { const Real q1 = 1.0e0_rt/0.776161e0_rt; @@ -1770,10 +1770,10 @@ void rate_n14ag(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt*term + rev*dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_fe52ng(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_fe52ng(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // fe52(n,g)fe53 const Real tq2 = tf.t9 - 0.348e0_rt; @@ -1791,10 +1791,10 @@ void rate_fe52ng(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_fe53ng(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_fe53ng(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // fe53(n,g)fe54 const Real tq1 = tf.t9/0.348_rt; @@ -1816,10 +1816,10 @@ void rate_fe53ng(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_fe54ng(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_fe54ng(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // fe54(n,g)fe55 const Real aa = 2.307390e1_rt - 7.931795e-02_rt * tf.t9i + 7.535681e0_rt * tf.t9i13 @@ -1851,10 +1851,10 @@ void rate_fe54ng(const tf_t& tf, const Real den, Real& fr, dfrdt = dtermdt*den; } -AMREX_GPU_HOST_DEVICE inline -void rate_fe54pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_fe54pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // fe54(p,g)co55 const Real z = amrex::min(tf.t9,10.0e0_rt); @@ -1882,10 +1882,10 @@ void rate_fe54pg(const tf_t& tf, const Real den, Real& fr, drrdt = (drevdt * term + rev * dtermdt) * 1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_fe54ap(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_fe54ap(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // fe54(a,p)co57 const Real aa = 3.97474900e1_rt - 6.06543100e0_rt * tf.t9i + 1.63239600e2_rt * tf.t9i13 @@ -1917,10 +1917,10 @@ void rate_fe54ap(const tf_t& tf, const Real den, Real& fr, dfrdt = drrdt*bb + rr*dbb*1.0e-9_rt; } -AMREX_GPU_HOST_DEVICE inline -void rate_fe55ng(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_fe55ng(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // fe55(n,g)fe56 const Real aa = 1.954115e1_rt - 6.834029e-02_rt * tf.t9i + 5.379859e0_rt * tf.t9i13 @@ -1952,10 +1952,10 @@ void rate_fe55ng(const tf_t& tf, const Real den, Real& fr, dfrdt = dtermdt*den; } -AMREX_GPU_HOST_DEVICE inline -void rate_fe56pg(const tf_t& tf, const Real den, Real& fr, - Real& dfrdt, Real& rr, - Real& drrdt) +AMREX_GPU_HOST_DEVICE inline +void rate_fe56pg(const tf_t& tf, const Real den, Real& fr, + Real& dfrdt, Real& rr, + Real& drrdt) { // fe56(p,g)co57 @@ -1999,10 +1999,10 @@ void rate_fe56pg(const tf_t& tf, const Real den, Real& fr, // output: // rn56ec = ni56 electron capture rate // sn56ec = ni56 neutrino loss rate -AMREX_GPU_HOST_DEVICE inline -void langanke(const Real btemp, const Real bden, - const Real y56, const Real ye, - Real& rn56ec, Real& sn56ec) +AMREX_GPU_HOST_DEVICE inline +void langanke(const Real btemp, const Real bden, + const Real y56, const Real ye, + Real& rn56ec, Real& sn56ec) { // calculate ni56 electron capture and neutrino loss rates rn56ec = 0.0_rt; @@ -2056,10 +2056,10 @@ void langanke(const Real btemp, const Real bden, // positron capture on neutrons rnep (captures/sec/neutron), // and their associated neutrino energy loss rates // spenc (erg/sec/proton) and snepc (erg/sec/neutron) -AMREX_GPU_HOST_DEVICE inline -void ecapnuc(const Real etakep, const Real temp, - Real& rpen, Real& rnep, - Real& spenc, Real& snepc) +AMREX_GPU_HOST_DEVICE inline +void ecapnuc(const Real etakep, const Real temp, + Real& rpen, Real& rnep, + Real& spenc, Real& snepc) { const Real qn1 = -2.0716446e-06_rt; const Real ftinv = 1.0e0_rt/1083.9269e0_rt; diff --git a/rates/aprox_rates_data.H b/rates/aprox_rates_data.H index f58ddca2ae..e9a3162621 100644 --- a/rates/aprox_rates_data.H +++ b/rates/aprox_rates_data.H @@ -16,6 +16,6 @@ extern AMREX_GPU_MANAGED amrex::Array1D rfd2; extern AMREX_GPU_MANAGED amrex::Array1D tfdm; extern AMREX_GPU_MANAGED amrex::Array1D tfd0; extern AMREX_GPU_MANAGED amrex::Array1D tfd1; -extern AMREX_GPU_MANAGED amrex::Array1D tfd2; +extern AMREX_GPU_MANAGED amrex::Array1D tfd2; #endif diff --git a/screening/screen.H b/screening/screen.H index 6ebe21717b..f07fd9f4dd 100644 --- a/screening/screen.H +++ b/screening/screen.H @@ -133,7 +133,7 @@ fill_plasma_state(plasma_state_t& state, const Real temp, const Real dens, Array if constexpr (do_T_derivatives) { state.taufacdt = -(1.0_rt/3.0_rt) * state.taufac * tempi; } - + Real xni = std::cbrt(rr * zbar); // Part of Eq.4 in Itoh:1979 @@ -211,11 +211,11 @@ void actual_screen5 (const plasma_state_t& state, // In Eq.4 in Itoh:1979, this term is 2*Z_1*Z_2/(Z_1^(1/3) + Z_2^(1/3)) // However here we follow Wallace:1982 Eq. A13, which is Z_1*Z_2*(2/(Z_1+Z_2))^(1/3) - + Real qq = fact * bb * scn_fac.zs13inv; // Full Equation of Wallace:1982 Eq. A13 - + Real gamef = qq * gamp; [[maybe_unused]] Real gamefdt; if constexpr (do_T_derivatives) { @@ -225,7 +225,7 @@ void actual_screen5 (const plasma_state_t& state, // Full version of Eq.6 in Itoh:1979 with extra 1/3 factor // the extra 1/3 factor is there for convenience. // tau12 = Eq.6 / 3 - + Real tau12 = state.taufac * scn_fac.aznut; [[maybe_unused]] Real tau12dt; if constexpr (do_T_derivatives) { @@ -235,7 +235,7 @@ void actual_screen5 (const plasma_state_t& state, qq = 1.0_rt/tau12; // alph12 = 3*gamma_ij/tau_ij - + Real alph12 = gamef * qq; [[maybe_unused]] Real alph12dt; if constexpr (do_T_derivatives) { @@ -270,7 +270,7 @@ void actual_screen5 (const plasma_state_t& state, // weak screening regime // Full version of Eq. 19 in Graboske:1973 by considering weak regime // and Wallace:1982 Eq. A14. Here the degeneracy factor is assumed to be 1. - + Real h12w = bb * state.qlam0z; [[maybe_unused]] Real dh12wdt; if constexpr (do_T_derivatives) { @@ -284,11 +284,11 @@ void actual_screen5 (const plasma_state_t& state, } // intermediate and strong sceening regime - + if (gamef > gamefx) { // gamma_ij^(1/4) - + Real gamp14 = std::pow(gamp, 0.25_rt); Real rr = 1.0_rt/gamp; @@ -818,7 +818,7 @@ void chabrier1998 (const plasma_state_t& state, { // Calculates screening factors based on Chabrier & Potekhin 1998, // Calder2007 and partly screen5 routine mentioned in Alastuey 1978. - + // This screening is valid for weak screening: Gamma < 0.1 // and strong screening: 1 <= Gamma <= 160 // Reference: @@ -828,18 +828,18 @@ void chabrier1998 (const plasma_state_t& state, // Alastuey 1978 // Eq. 2 in Chabrier & Potekhin 1998 - + Real Gamma_e = state.gamma_e_fac / state.temp; Real zcomp = scn_fac.z1 + scn_fac.z2; // See Calder2007 appendix Eq. A9 - + Real Gamma1 = Gamma_e * std::pow(scn_fac.z1, 5.0_rt/3.0_rt); Real Gamma2 = Gamma_e * std::pow(scn_fac.z2, 5.0_rt/3.0_rt); Real Gamma12 = Gamma_e * std::pow(zcomp, 5.0_rt/3.0_rt); Real Gamma1dT{}, Gamma2dT{}, Gamma12dT{}; - + if constexpr (do_T_derivatives) { Gamma1dT = -Gamma1 / state.temp; Gamma2dT = -Gamma2 / state.temp; @@ -854,33 +854,33 @@ void chabrier1998 (const plasma_state_t& state, chabrier1998_helmholtz_F(Gamma1, Gamma1dT, f1, f1dT); chabrier1998_helmholtz_F(Gamma2, Gamma2dT, f2, f2dT); chabrier1998_helmholtz_F(Gamma12, Gamma12dT, f12, f12dT); - + // Now we add quantum correction terms discussed in Alastuey 1978. // Notice in Alastuey 1978, they have a different classical term, // which is implemented in the strong screening limit of our screen5 routine. // See Wallace1982, Eq. A13 - + Real Gamma_eff = std::cbrt(2.0_rt) * scn_fac.z1 * scn_fac.z2 * scn_fac.zs13inv * Gamma_e; [[maybe_unused]] Real Gamma_eff_dT; if constexpr (do_T_derivatives) { Gamma_eff_dT = -Gamma_eff / state.temp; } - + // TAU/3, see Wallace1982, Eq. A2 - + Real tau12 = state.taufac * scn_fac.aznut; - + [[maybe_unused]] Real tau12dT; if constexpr (do_T_derivatives) { tau12dT = state.taufacdt * scn_fac.aznut; } // see Calder 2007 Eq. A8 - + Real b_fac = Gamma_eff / tau12; - + [[maybe_unused]] Real b_fac_dT; if constexpr (do_T_derivatives) { b_fac_dT = (Gamma_eff_dT - b_fac * tau12dT) / tau12; @@ -888,10 +888,10 @@ void chabrier1998 (const plasma_state_t& state, // Quantum correction terms (same as screen5) //see Calder 2007 Eq.A8 and Alastuey1978, Eq. 24 and 31 - + Real quantum_corr_1 = -tau12 * (5.0_rt/32.0_rt * std::pow(b_fac, 3) - 0.014_rt * std::pow(b_fac, 4) - 0.128_rt * std::pow(b_fac, 5)); - + Real quantum_corr_2 = -Gamma_eff * (0.0055_rt * std::pow(b_fac, 4) - 0.0098_rt * std::pow(b_fac, 5) + 0.0048_rt * std::pow(b_fac, 6)); @@ -906,23 +906,23 @@ void chabrier1998 (const plasma_state_t& state, * (0.0055_rt * 4.0_rt * std::pow(b_fac, 3) - 0.0098_rt * 5.0_rt * std::pow(b_fac, 4) + 0.0048_rt * 6.0_rt * std::pow(b_fac, 5)); } - + // See Calder2007 Appendix Eq. A8. // f1 + f2 - f12 gives the classical terms // The difference between this and strong screening of screen5 // is that we replaced the classical term which is f1 + f2 - f12 // using results from Chabrier&Potekhin1998. - + Real h12 = f1 + f2 - f12 + quantum_corr_1 + quantum_corr_2; - + [[maybe_unused]] Real dh12dT; if constexpr (do_T_derivatives) { dh12dT = f1dT + f2dT - f12dT + quantum_corr_1_dT + quantum_corr_2_dT; } - + Real h12_max = 300.0_rt; h12 = amrex::min(h12_max, h12); - + scor = std::exp(h12); if constexpr (do_T_derivatives) { @@ -932,7 +932,7 @@ void chabrier1998 (const plasma_state_t& state, scordt = scor * dh12dT; } } - + } template diff --git a/unit_test/burn_cell_primordial_chem/burn_cell.H b/unit_test/burn_cell_primordial_chem/burn_cell.H index ec7a439620..ba9e8388e7 100644 --- a/unit_test/burn_cell_primordial_chem/burn_cell.H +++ b/unit_test/burn_cell_primordial_chem/burn_cell.H @@ -224,9 +224,9 @@ void burn_cell_c() state_over_time << std::setw(10) << t; state_over_time << std::setw(15) << state.rho; - state_over_time << std::setw(12) << state.T; + state_over_time << std::setw(12) << state.T; for (int x = 0; x < NumSpec; ++x){ - state_over_time << std::setw(15) << state.xn[x]; + state_over_time << std::setw(15) << state.xn[x]; } state_over_time << std::endl; diff --git a/unit_test/burn_cell_sdc/burn_cell.H b/unit_test/burn_cell_sdc/burn_cell.H index 6567ad8df3..1a70dd43c7 100644 --- a/unit_test/burn_cell_sdc/burn_cell.H +++ b/unit_test/burn_cell_sdc/burn_cell.H @@ -269,7 +269,7 @@ void burn_cell_c() } #endif - // these need to be initialized + // these need to be initialized burn_state.sdc_iter = 1; burn_state.num_sdc_iters = 1; @@ -325,17 +325,17 @@ void burn_cell_c() state_over_time << std::setw(12) << "Temperature"; for(int x = 0; x < NumSpec; ++x){ const std::string& element = short_spec_names_cxx[x]; - state_over_time << std::setw(12) << element; + state_over_time << std::setw(12) << element; } state_over_time << std::endl; Real t = 0.0; state_over_time << std::setw(10) << t; - state_over_time << std::setw(12) << burn_state.rho; - state_over_time << std::setw(12) << burn_state.T; + state_over_time << std::setw(12) << burn_state.rho; + state_over_time << std::setw(12) << burn_state.T; for (int x = 0; x < NumSpec; ++x){ - state_over_time << std::setw(12) << burn_state.xn[x]; + state_over_time << std::setw(12) << burn_state.xn[x]; } state_over_time << std::endl; @@ -365,7 +365,7 @@ void burn_cell_c() state_over_time << std::setw(12) << burn_state.rho; state_over_time << std::setw(12) << burn_state.T; for (int x = 0; x < NumSpec; ++x){ - state_over_time << std::setw(12) << burn_state.y[SFS+x] / burn_state.rho; + state_over_time << std::setw(12) << burn_state.y[SFS+x] / burn_state.rho; } state_over_time << std::endl; } diff --git a/unit_test/test_aprox_rates/aprox_rates_util.cpp b/unit_test/test_aprox_rates/aprox_rates_util.cpp index 85dd357b78..5df55a7a94 100644 --- a/unit_test/test_aprox_rates/aprox_rates_util.cpp +++ b/unit_test/test_aprox_rates/aprox_rates_util.cpp @@ -139,7 +139,7 @@ void aprox_rates_test(const Box& bx, sp(i, j, k, vars.isi28ag+1) = dfrdt; sp(i, j, k, vars.isi28ag+2) = rr; sp(i, j, k, vars.isi28ag+3) = drrdt; - + rate_si28ap(tf, dens_zone, fr, dfrdt, rr, drrdt); sp(i, j, k, vars.isi28ap) = fr; @@ -415,7 +415,7 @@ void aprox_rates_test(const Box& bx, Real rn56ec; Real sn56ec; - langanke(temp_zone, dens_zone, eos_state.xn[ini56], + langanke(temp_zone, dens_zone, eos_state.xn[ini56], eos_state.y_e, rn56ec, sn56ec); sp(i, j, k, vars.ilanganke) = rn56ec; diff --git a/unit_test/test_aprox_rates/variables.cpp b/unit_test/test_aprox_rates/variables.cpp index 3910b318da..0f506c6fd8 100644 --- a/unit_test/test_aprox_rates/variables.cpp +++ b/unit_test/test_aprox_rates/variables.cpp @@ -64,7 +64,7 @@ plot_t init_variables() { p.ife55ng = p.next_index(4); p.ife56pg = p.next_index(4); - // langanke and ecapnuc are different so not included in n_tests + // langanke and ecapnuc are different so not included in n_tests p.ilanganke = p.next_index(2); p.iecapnuc = p.next_index(4); diff --git a/unit_test/test_ase/burn_cell.H b/unit_test/test_ase/burn_cell.H index 311bea92c0..b4db1497a2 100644 --- a/unit_test/test_ase/burn_cell.H +++ b/unit_test/test_ase/burn_cell.H @@ -27,9 +27,9 @@ void burn_cell_c() state.mu_n = mu_n; // set a reference cell size. - + state.dx = 1.0e6_rt; - + std::cout << "chemical potential of proton is " << mu_p << std::endl; std::cout << "chemical potential of neutron is " << mu_n << std::endl; @@ -41,7 +41,7 @@ void burn_cell_c() std::cout << "State Density (g/cm^3): " << state.rho << std::endl; std::cout << "State Temperature (K): " << state.T << std::endl; std::cout << "electron fraction is " << state.y_e << std::endl; - + std::cout << "NSE state: " << std::endl; for (int n = 0; n < NumSpec; ++n) { std::cout << short_spec_names_cxx[n] << " : " << NSE_STATE.xn[n] << std::endl; @@ -55,12 +55,12 @@ void burn_cell_c() // get eos //eos(eos_input_rt, state); - + if (in_nse(state)){ std::cout << "We're in NSE. " << std::endl; } else{ std::cout << "We're not in NSE. " << std::endl; } - + } diff --git a/unit_test/test_ase/main.cpp b/unit_test/test_ase/main.cpp index a79f2a6e2f..f172e2fe10 100644 --- a/unit_test/test_ase/main.cpp +++ b/unit_test/test_ase/main.cpp @@ -21,7 +21,7 @@ int main(int argc, char *argv[]) { ParmParse ppa("amr"); init_unit_test(); - + // C++ EOS initialization (must be done after Fortran eos_init and init_extern_parameters) eos_init(small_temp, small_dens); diff --git a/unit_test/test_ase/make_table/burn_cell.H b/unit_test/test_ase/make_table/burn_cell.H index b9eb41590c..5ef38f8ac2 100644 --- a/unit_test/test_ase/make_table/burn_cell.H +++ b/unit_test/test_ase/make_table/burn_cell.H @@ -18,7 +18,7 @@ void burn_cell_c() // set a reference cell size state.dx = 1.0e6_rt; - + Real dlogrho = (std::log10(rho_max) - std::log10(rho_min))/static_cast(nrho-1); Real dlogT = (std::log10(T_max) - std::log10(T_min))/static_cast(nT-1); Real dYe = (Ye_max - Ye_min)/(nye-1); diff --git a/unit_test/test_nse/nse_example.H b/unit_test/test_nse/nse_example.H index be91da3284..7b8246c990 100644 --- a/unit_test/test_nse/nse_example.H +++ b/unit_test/test_nse/nse_example.H @@ -42,36 +42,36 @@ void nse_example_c() state.xn[n] = massfractions[n]; } - + // normalize -- just in case - + normalize_abundances_burn(state); // compute the initial Ye - + state.y_e = y_e; - + // composition(state); - + std::cout << "electron fraction is " << state.y_e << std::endl; // set initial chemical potential of proton and neutron state.mu_p = mu_p; state.mu_n = mu_n; - + const bool assume_ye_valid = true; amrex::Real eps = 1.0e-10_rt; - + // find the nse state use_hybrid_solver = 1; - + auto NSE_STATE = get_actual_nse_state(state, eps, assume_ye_valid); std::cout << "After solving: " << std::endl; std::cout << "chemical potential of proton is " << state.mu_p << std::endl; std::cout << "chemical potential of neutron is " << state.mu_n << std::endl; - + std::cout << "NSE state: " << std::endl; for (int n = 0; n < NumSpec; ++n) { std::cout << short_spec_names_cxx[n] << " : " << NSE_STATE.xn[n] << std::endl; diff --git a/unit_test/test_screening/screening_util.cpp b/unit_test/test_screening/screening_util.cpp index 743ed83800..1c2e223904 100644 --- a/unit_test/test_screening/screening_util.cpp +++ b/unit_test/test_screening/screening_util.cpp @@ -53,7 +53,7 @@ void screen_test_C(const Box& bx, const int is32 = network_spec_index("sulfur-32"); if (is32 < 0) amrex::Error("Error: is32 not found"); - const int iar36 = network_spec_index("argon-36"); + const int iar36 = network_spec_index("argon-36"); if (iar36 < 0) amrex::Error("Error: iar36 not found"); const int ica40 = network_spec_index("calcium-40"); diff --git a/unit_test/test_sdc/react_zones.H b/unit_test/test_sdc/react_zones.H index babd078536..bea7dcfc37 100644 --- a/unit_test/test_sdc/react_zones.H +++ b/unit_test/test_sdc/react_zones.H @@ -92,7 +92,7 @@ bool do_react (const plot_t& p, const int i, const int j, const int k, burn_state.reference_time = 0.0; #endif - // these need to be initialized + // these need to be initialized burn_state.sdc_iter = 1; burn_state.num_sdc_iters = 1; diff --git a/unit_test/test_sdc/variables.cpp b/unit_test/test_sdc/variables.cpp index d5f3e1489a..8c0211454d 100644 --- a/unit_test/test_sdc/variables.cpp +++ b/unit_test/test_sdc/variables.cpp @@ -35,7 +35,7 @@ void get_varnames(const plot_t& p, amrex::Vector& names) { } names[p.irho_Hnuc] = "rho_Hnuc"; -#if NAUX_NET > 0 +#if NAUX_NET > 0 for (int n = 0; n < NumAux; n++) { names[p.iaux + n] = aux_names_cxx[n]; names[p.iaux_old + n] = "old_" + aux_names_cxx[n]; diff --git a/unit_test/write_job_info.cpp b/unit_test/write_job_info.cpp index 434fc4f900..2da75b6ee7 100644 --- a/unit_test/write_job_info.cpp +++ b/unit_test/write_job_info.cpp @@ -89,7 +89,7 @@ void write_job_info(const std::string& dir) { jobInfoFile << "COMP version: " << buildInfoGetCompVersion() << "\n"; jobInfoFile << "\n"; - + jobInfoFile << "C++ compiler: " << buildInfoGetCXXName() << "\n"; jobInfoFile << "C++ flags: " << buildInfoGetCXXFlags() << "\n";