diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..62b1973e01 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,62 @@ +# http://EditorConfig.org +# +# precedence of rules is bottom to top + +# this is the top-most EditorConfig file +root = true + + +[*.{c,h,cpp,hpp,H,py}] +# 4 space indentation +indent_style = space +indent_size = 4 + +# Clean up trailing whitespace +trim_trailing_whitespace = true + +# unix-style newlines +end_of_line = lf + +# newline ending in files +insert_final_newline = true + +[networks/**/reaclib_rates.H] +# some reaclib rate labels have trailing spaces +trim_trailing_whitespace = false + + +[*.md] +# two end of line whitespaces are newlines without a paragraph +trim_trailing_whitespace = false + + +[*.rst] +# Enforce UTF-8 encoding +charset = utf-8 + +# Unix-style newlines +end_of_line = lf + +# Newline ending in files +insert_final_newline = true + +# 3 space indentation +indent_style = space +indent_size = 3 + +# Clean up trailing whitespace +trim_trailing_whitespace = true + +[{Makefile,GNUmakefile,Make.*}] +# TABs are part of its syntax +indent_style = tab +indent_size = unset + + +[util/gcem/**] +# don't mess with the gcem subtree +indent_style = unset +indent_size = unset +trim_trailing_whitespace = unset +end_of_line = unset +insert_final_newline = unset diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000000..51ea378386 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Replaced tabs with spaces and trimmed trailing whitespace +5a2247f598f88f80ad8b186188fccfd5537b18d3 diff --git a/.github/workflows/burn_cell_primordial_chem.yml b/.github/workflows/burn_cell_primordial_chem.yml index b1c506ba90..bdc52cc939 100644 --- a/.github/workflows/burn_cell_primordial_chem.yml +++ b/.github/workflows/burn_cell_primordial_chem.yml @@ -47,7 +47,7 @@ jobs: value2=$(awk 'NR=='"$line_number"' {match($0, /[+-]?[0-9]+([.][0-9]+)?[eE]?[+-]?[0-9]+/); if (RSTART) print substr($0, RSTART, RLENGTH)}' reference_solution.out) difference=$(awk -v val1="$value1" -v val2="$value2" 'BEGIN { printf "%.2f", (val1 - val2) / val2 }') - + if (( $(echo "$difference > $threshold" | bc -l) )); then echo "Line number: $line_number" echo "Value in test.out: $value1" diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 2e7d0fba2e..3d021ab174 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -2,8 +2,8 @@ on: push: # Sequence of patterns matched against refs/tags tags: - - '[0-9][0-9].[0-9][0-9]' - + - '[0-9][0-9].[0-9][0-9]' + name: Create Release jobs: diff --git a/.github/workflows/find_changed_files.py b/.github/workflows/find_changed_files.py index 0e7f4e3e06..8a81d06995 100644 --- a/.github/workflows/find_changed_files.py +++ b/.github/workflows/find_changed_files.py @@ -28,7 +28,7 @@ def find_files(SHAs=None): if stderr is not None: raise Exception('git diff encountered an error') - files = [f for f in stdout.decode('utf-8').strip().split('\n') + files = [f for f in stdout.decode('utf-8').strip().split('\n') if f.startswith('networks/')] print(files) diff --git a/.github/workflows/get_release_txt.py b/.github/workflows/get_release_txt.py index 50530c14ec..e14f92dc28 100644 --- a/.github/workflows/get_release_txt.py +++ b/.github/workflows/get_release_txt.py @@ -26,9 +26,9 @@ txt = txt[m.end():].strip() else: txt = "" - - # we now need to substitute characters in the string so that - # the action can deal with line breaks + + # we now need to substitute characters in the string so that + # the action can deal with line breaks txt = txt.replace('%', '%25') txt = txt.replace('\n', '%0A') txt = txt.replace('\r', '%0D') diff --git a/.github/workflows/macos_build_cell_primordial_chem.yml b/.github/workflows/macos_build_cell_primordial_chem.yml index 8d6e64769e..43eee22bbc 100644 --- a/.github/workflows/macos_build_cell_primordial_chem.yml +++ b/.github/workflows/macos_build_cell_primordial_chem.yml @@ -11,7 +11,8 @@ jobs: - name: Install dependencies run: | - brew install cmake openmpi python3 + brew install cmake openmpi python3 || true + brew link --overwrite python@3.11 - name: Compile and run run: | diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 0000000000..9c32554218 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,22 @@ +name: Style + +on: [push, pull_request] + +concurrency: + group: ${{ github.ref }}-${{ github.head_ref }}-style + cancel-in-progress: true + +jobs: + tabs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Tabs + run: .github/workflows/style/check_tabs.sh + + trailing_whitespaces: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Trailing Whitespaces + run: .github/workflows/style/check_trailing_whitespaces.sh diff --git a/.github/workflows/style/check_tabs.sh b/.github/workflows/style/check_tabs.sh new file mode 100755 index 0000000000..f4418644e3 --- /dev/null +++ b/.github/workflows/style/check_tabs.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -eu -o pipefail + +find . -type d \( -name .git \ + -o -path ./paper \ + -o -name build -o -name install \ + -o -name tmp_build_dir -o -name tmp_install_dir \ + \) -prune -o \ + -type f \( \( -name "*.H" -o -name "*.h" -o -name "*.hh" -o -name "*.hpp" \ + -o -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.cxx" \ + -o -name "*.f" -o -name "*.F" -o -name "*.f90" -o -name "*.F90" \ + -o -name "*.py" \ + -o -name "*.md" -o -name "*.rst" \ + -o -name "*.sh" \ + -o -name "*.tex" \ + -o -name "*.txt" \ + -o -name "*.yml" \) \ + -a \( ! -name "*.tab.h" -a ! -name "*.tab.nolint.H" \ + -a ! -name "*.lex.h" -a ! -name "*.lex.nolint.H" \) \ + \) \ + -exec grep -Iq . {} \; \ + -exec sed -i 's/\t/\ \ \ \ /g' {} + + +gitdiff=`git diff` + +if [ -z "$gitdiff" ] +then + exit 0 +else + echo -e "\nTabs are not allowed. Changes suggested by" + echo -e " ${0}\n" + git --no-pager diff + echo "" + exit 1 +fi diff --git a/.github/workflows/style/check_trailing_whitespaces.sh b/.github/workflows/style/check_trailing_whitespaces.sh new file mode 100755 index 0000000000..b33b62cf5c --- /dev/null +++ b/.github/workflows/style/check_trailing_whitespaces.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +set -eu -o pipefail + +find . -type d \( -name .git \ + -o -path ./paper \ + -o -name build -o -name install \ + -o -name tmp_build_dir -o -name tmp_install_dir \ + -o -path ./util/gcem \ + \) -prune -o \ + -type f \( \( -name "*.H" -o -name "*.h" -o -name "*.hh" -o -name "*.hpp" \ + -o -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.cxx" \ + -o -name "*.f" -o -name "*.F" -o -name "*.f90" -o -name "*.F90" \ + -o -name "*.py" \ + -o -name "*.rst" \ + -o -name "*.sh" \ + -o -name "*.tex" \ + -o -name "*.txt" \ + -o -name "*.yml" \) \ + -a \( ! -name "*.tab.h" -a ! -name "*.tab.nolint.H" \ + -a ! -name "*.lex.h" -a ! -name "*.lex.nolint.H" \ + -a ! -path "./networks/*/reaclib_rates.H" \) \ + \) \ + -exec grep -Iq . {} \; \ + -exec sed -i 's/[[:blank:]]\+$//g' {} + + +gitdiff=`git diff` + +if [ -z "$gitdiff" ] +then + exit 0 +else + echo -e "\nTrailing whitespaces at the end of a line are not allowed. Changes suggested by" + echo -e " ${0}\n" + git --no-pager diff + echo "" + exit 1 +fi diff --git a/CMakeLists.txt b/CMakeLists.txt index c3e2702b96..d1aceaff72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,13 +32,13 @@ function(setup_target_for_microphysics_compilation network_name output_dir) set(networkdir "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/") set(networkheadertemplatefile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/network_header.template") - set (gamma_law_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include + set (gamma_law_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/interfaces ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS/gamma_law - ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null + ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/constants PARENT_SCOPE) - execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkparamfile} + execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkparamfile} ${VODEparamfile} ${integrationparamfile}" --use_namespace WORKING_DIRECTORY ${output_dir}/) set(gamma_law_sources ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/interfaces/eos_data.cpp @@ -57,12 +57,12 @@ function(setup_target_for_microphysics_compilation network_name output_dir) set(networkheadertemplatefile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/network_header.template") #DO NOT change the order of the directories below! - set (primordial_chem_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include - ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/VODE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/utils + set (primordial_chem_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include + ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/VODE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/utils ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/interfaces ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS/primordial_chem - ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/primordial_chem ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks - ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/constants + ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/primordial_chem ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks + ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/constants PARENT_SCOPE) #we need to have extern_parameters.cpp be available at configure time @@ -72,11 +72,11 @@ function(setup_target_for_microphysics_compilation network_name output_dir) #to generate updated header files if(BUILD_UNIT_TEST) - execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${paramfile} ${EOSparamfile} + execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${paramfile} ${EOSparamfile} ${networkpcparamfile} ${networkparamfile} ${VODEparamfile} ${integrationparamfile} ${unittestparamfile}" --use_namespace WORKING_DIRECTORY ${output_dir}/) else() #do not need paramfile and unittestparamfile - execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkpcparamfile} + execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkpcparamfile} ${networkparamfile} ${VODEparamfile} ${integrationparamfile} " --use_namespace WORKING_DIRECTORY ${output_dir}/) endif() 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..a5796fca0b 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; @@ -1364,6 +1364,9 @@ void actual_eos_init () for (int j = 0; j < jmax; ++j) { for (int i = 0; i < imax; ++i) { std::getline(table, line); + if (line.empty()) { + amrex::Error("Error reading free energy from helm_table.dat"); + } std::istringstream data(line); data >> f_local[idx] >> f_local[idx+3] >> f_local[idx+1] >> f_local[idx+4] >> f_local[idx+2] >> f_local[idx+5] @@ -1377,6 +1380,9 @@ void actual_eos_init () for (int j = 0; j < jmax; ++j) { for (int i = 0; i < imax; ++i) { std::getline(table, line); + if (line.empty()) { + amrex::Error("Error reading pressure derivative from helm_table.dat"); + } std::istringstream data(line); data >> dpdf_local[idx] >> dpdf_local[idx+2] >> dpdf_local[idx+1] >> dpdf_local[idx+3]; @@ -1389,6 +1395,9 @@ void actual_eos_init () for (int j = 0; j < jmax; ++j) { for (int i = 0; i < imax; ++i) { std::getline(table, line); + if (line.empty()) { + amrex::Error("Error reading electron chemical potential from helm_table.dat"); + } std::istringstream data(line); data >> ef_local[idx] >> ef_local[idx+2] >> ef_local[idx+1] >> ef_local[idx+3]; @@ -1401,6 +1410,9 @@ void actual_eos_init () for (int j = 0; j < jmax; ++j) { for (int i = 0; i < imax; ++i) { std::getline(table, line); + if (line.empty()) { + amrex::Error("Error reading number density from helm_table.dat"); + } std::istringstream data(line); data >> xf_local[idx] >> xf_local[idx+2] >> xf_local[idx+1] >> xf_local[idx+3]; 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/Make.Microphysics_extern b/Make.Microphysics_extern index 2954ebbffc..4f8fc317d2 100644 --- a/Make.Microphysics_extern +++ b/Make.Microphysics_extern @@ -148,5 +148,5 @@ endif clean:: @if [ -L helm_table.dat ]; then rm -f helm_table.dat; fi @if [ -L reaclib_rate_metadata.dat ]; then rm -f reaclib_rate_metadata.dat; fi - @if [ ! -f nse19.tbl ]; then rm -f nse19.tbl; fi - $(foreach t, $(NET_TABLES), $(shell if [ ! -L `basename $t` ]; then rm -f `basename $t` ; fi)) + @if [ -L nse.tbl ]; then rm -f nse.tbl; fi + $(foreach t, $(wildcard *_betadecay.dat *_electroncapture.dat), $(shell if [ -L $t ]; then rm -f $t; fi)) \ No newline at end of file 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/deploy_docs_action.sh b/deploy_docs_action.sh index 8e03fff881..734cbf30ce 100755 --- a/deploy_docs_action.sh +++ b/deploy_docs_action.sh @@ -9,10 +9,10 @@ TARGET_BRANCH="gh-pages" mkdir out -# if on the dev branch, use the dev_layout.html template to get the +# if on the dev branch, use the dev_layout.html template to get the # links correct if [ "$GITHUB_BRANCH" = "$DEV_BRANCH" ]; then - mv sphinx_docs/source/_templates/dev_layout.html sphinx_docs/source/_templates/layout.html + mv sphinx_docs/source/_templates/dev_layout.html sphinx_docs/source/_templates/layout.html fi # Build the Sphinx documentation @@ -24,7 +24,7 @@ mkdir -p out/docs/ if [ "$GITHUB_BRANCH" = "$MAIN_BRANCH" ]; then mkdir -p out/docs mv sphinx_docs/build/html/* out/docs -else +else mkdir -p out/docs/dev/ mv sphinx_docs/build/html/* out/docs/dev fi 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 0586e3e667..6a77bc94e5 100644 --- a/integration/VODE/vode_dvstep.H +++ b/integration/VODE/vode_dvstep.H @@ -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]; @@ -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..338d542653 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 @@ -285,37 +285,12 @@ void burn_to_eos (const BurnT& burn_state, T& eos_state) } -template -AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void sdc_burn_to_eos (const BurnT& state, T& eos_state) -{ - eos_state.rho = state.y[SRHO]; - eos_state.T = state.T; - - // species - - for (int n = 0; n < NumSpec; n++) { - eos_state.xn[n] = state.y[SFS+n] / eos_state.rho; - } - -#if NAUX_NET > 0 - // aux - for (int n = 0; n < NumAux; n++) { - eos_state.aux[n] = state.y[SFX+n] / eos_state.rho; - } - //set_nse_aux_from_X(eos_state); -#endif - - // we don't bother filling the other fields, since the EOS call - // will do that for us -} - template 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/burner.H b/interfaces/burner.H index 832edede73..94a725fb8d 100644 --- a/interfaces/burner.H +++ b/interfaces/burner.H @@ -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 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/He-C-Fe-group/55co-55fe_electroncapture.dat b/networks/He-C-Fe-group/55co-55fe_electroncapture.dat new file mode 100644 index 0000000000..3d05c44ab4 --- /dev/null +++ b/networks/He-C-Fe-group/55co-55fe_electroncapture.dat @@ -0,0 +1,148 @@ +!55co -> 55fe, e- capture +!Q=-2.9403 MeV +! +!Log(rhoY) Log(temp) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -8.471000 -1.103229e+01 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -8.964000 -1.103229e+01 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -9.106000 -1.103229e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -9.235000 -1.103229e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -8.679000 -1.103229e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -7.399000 -1.102629e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -6.240000 -1.094929e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -5.556000 -1.070929e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -4.648000 -9.893290e+00 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -3.243000 -8.401290e+00 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -1.052000 -6.117290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 4.619000 4.487104e-01 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -7.492000 -1.102829e+01 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -7.965000 -1.103129e+01 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -8.106000 -1.103129e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -8.235000 -1.103229e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -8.266000 -1.103229e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -7.377000 -1.102629e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -6.239000 -1.094929e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -5.556000 -1.070929e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -4.648000 -9.893290e+00 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -3.243000 -8.401290e+00 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -1.052000 -6.117290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 4.619000 4.487104e-01 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -6.622000 -1.099829e+01 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -6.971000 -1.101729e+01 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -7.108000 -1.102129e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -7.235000 -1.102429e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -7.319000 -1.102529e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -7.172000 -1.102229e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -6.224000 -1.094629e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -5.553000 -1.070729e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -4.647000 -9.893290e+00 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -3.243000 -8.401290e+00 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -1.052000 -6.117290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 4.619000 4.487104e-01 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -5.913000 -1.087929e+01 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -6.024000 -1.090929e+01 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -6.128000 -1.093229e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -6.241000 -1.095329e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -6.321000 -1.096429e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -6.354000 -1.096829e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -6.084000 -1.091729e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -5.521000 -1.069129e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -4.642000 -9.889290e+00 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -3.242000 -8.400290e+00 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -1.052000 -6.117290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 4.619000 4.487104e-01 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -5.211000 -1.053529e+01 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -5.218000 -1.053929e+01 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -5.239000 -1.055329e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -5.287000 -1.058229e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -5.337000 -1.061129e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -5.364000 -1.062329e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -5.366000 -1.061729e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -5.239000 -1.052129e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -4.590000 -9.855290e+00 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -3.234000 -8.395290e+00 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -1.051000 -6.116290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 4.619000 4.487104e-01 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -4.399000 -9.845290e+00 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -4.399000 -9.845290e+00 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -4.398000 -9.844290e+00 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -4.398000 -9.843290e+00 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -4.397000 -9.839290e+00 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -4.394000 -9.831290e+00 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -4.380000 -9.810290e+00 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -4.348000 -9.770290e+00 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -4.166000 -9.530290e+00 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -3.152000 -8.343290e+00 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -1.042000 -6.109290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 4.620000 4.487104e-01 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -3.354000 -8.788290e+00 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -3.354000 -8.788290e+00 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -3.353000 -8.787290e+00 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -3.351000 -8.785290e+00 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -3.345000 -8.778290e+00 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -3.335000 -8.766290e+00 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -3.309000 -8.739290e+00 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -3.268000 -8.699290e+00 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -3.126000 -8.557290e+00 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -2.564000 -7.886290e+00 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -0.955000 -6.031290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 1.854000 -2.840290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 4.620000 4.487104e-01 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -1.817000 -7.283290e+00 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -1.816000 -7.283290e+00 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -1.816000 -7.282290e+00 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -1.814000 -7.280290e+00 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -1.807000 -7.274290e+00 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -1.797000 -7.264290e+00 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -1.770000 -7.240290e+00 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -1.729000 -7.204290e+00 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -1.603000 -7.086290e+00 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -1.223000 -6.632290e+00 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -0.324000 -5.441290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 1.885000 -2.809290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 4.620000 4.497104e-01 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 0.654000 -4.759290e+00 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 0.654000 -4.759290e+00 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 0.654000 -4.759290e+00 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 0.655000 -4.758290e+00 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 0.657000 -4.755290e+00 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 0.660000 -4.750290e+00 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 0.667000 -4.738290e+00 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 0.677000 -4.722290e+00 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 0.705000 -4.677290e+00 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 0.789000 -4.538290e+00 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 1.094000 -4.025290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 2.174000 -2.519290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 4.629000 4.587104e-01 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 2.827000 -2.139290e+00 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 2.827000 -2.139290e+00 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 2.827000 -2.139290e+00 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 2.827000 -2.139290e+00 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 2.828000 -2.138290e+00 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 2.828000 -2.138290e+00 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 2.829000 -2.136290e+00 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 2.830000 -2.134290e+00 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 2.833000 -2.128290e+00 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 2.844000 -2.107290e+00 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 2.898000 -2.007290e+00 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 3.270000 -1.386290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 4.711000 5.417104e-01 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 4.688000 1.267104e-01 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 4.688000 1.267104e-01 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 4.688000 1.267104e-01 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 4.688000 1.267104e-01 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 4.689000 1.267104e-01 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 4.689000 1.267104e-01 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 4.689000 1.277104e-01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 4.689000 1.277104e-01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 4.689000 1.287104e-01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 4.691000 1.317104e-01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 4.702000 1.507104e-01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 4.800000 3.217104e-01 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 5.317000 1.161710e+00 -100.00 diff --git a/networks/He-C-Fe-group/55fe-55co_betadecay.dat b/networks/He-C-Fe-group/55fe-55co_betadecay.dat new file mode 100644 index 0000000000..6b66518a29 --- /dev/null +++ b/networks/He-C-Fe-group/55fe-55co_betadecay.dat @@ -0,0 +1,148 @@ +!55fe -> 55co, beta-decay +!Q=2.9403 MeV +! +!Log(rhoY) Log(temp) mu dQ VS Log(beta-decay-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -96.772000 -9.948629e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -52.485000 -5.427829e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -33.018000 -3.484629e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -24.674000 -2.776129e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -17.690000 -2.201029e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -13.998000 -1.891129e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -9.940000 -1.531829e+01 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -6.406000 -1.173529e+01 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -3.762000 -8.319290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -96.772000 -1.004873e+02 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -52.485000 -5.527829e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -33.018000 -3.525929e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -24.674000 -2.778329e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -17.690000 -2.201129e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -13.998000 -1.891129e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -9.940000 -1.531829e+01 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -6.406000 -1.173529e+01 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -3.762000 -8.319290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -96.780000 -1.014913e+02 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -52.488000 -5.627929e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -33.019000 -3.620729e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -24.674000 -2.798929e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -17.690000 -2.202629e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -13.998000 -1.891429e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -9.940000 -1.531929e+01 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -6.406000 -1.173529e+01 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -3.762000 -8.319290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -96.858000 -1.025333e+02 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -52.522000 -5.729529e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -33.028000 -3.721129e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -24.677000 -2.880729e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -17.691000 -2.216429e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -13.998000 -1.894329e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -9.940000 -1.532229e+01 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -6.406000 -1.173529e+01 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -3.762000 -8.319290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -97.567000 -1.039783e+02 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -52.825000 -5.844929e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -33.114000 -3.825929e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -24.710000 -2.980829e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -17.703000 -2.285229e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -14.003000 -1.919329e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -9.942000 -1.535329e+01 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -6.407000 -1.174029e+01 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -3.762000 -8.320290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -54.401000 -6.060929e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -33.677000 -3.964929e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -24.962000 -3.086129e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -17.818000 -2.366429e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -14.070000 -1.982029e+01 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -9.961000 -1.556229e+01 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -6.412000 -1.178529e+01 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -3.763000 -8.328290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -59.235000 -6.588029e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -35.768000 -4.219829e+01 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -26.201000 -3.251429e+01 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -18.580000 -2.470329e+01 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -14.533000 -2.047229e+01 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -10.152000 -1.592629e+01 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -6.481000 -1.205729e+01 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -3.776000 -8.406290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 -1.819000 -4.530290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -72.880000 -7.956929e+01 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -42.934000 -4.942729e+01 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -30.798000 -3.715029e+01 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -21.182000 -2.736129e+01 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -16.256000 -2.232029e+01 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -11.204000 -1.712129e+01 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -7.057000 -1.279529e+01 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -3.940000 -8.962290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 -1.827000 -4.561290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 -0.709000 -1.238290e+00 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 -61.932000 -6.847329e+01 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 -43.926000 -5.031829e+01 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 -29.767000 -3.599629e+01 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 -22.594000 -2.871229e+01 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 -15.315000 -2.128129e+01 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 -9.401000 -1.518829e+01 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 -4.950000 -1.031929e+01 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 -1.920000 -4.853290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 -0.711000 -1.246290e+00 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 -73.707000 -8.010929e+01 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 -49.589000 -5.582629e+01 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 -37.437000 -4.356029e+01 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 -25.181000 -3.114929e+01 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 -15.290000 -2.107529e+01 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 -7.846000 -1.328029e+01 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 -2.660000 -6.053290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 -0.736000 -1.330290e+00 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 -92.618000 -9.885329e+01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 -69.704000 -7.582429e+01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 -46.686000 -5.265029e+01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 -28.188000 -3.396729e+01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 -14.288000 -1.972329e+01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 -4.720000 -8.372290e+00 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 -1.018000 -1.964290e+00 -100.00 diff --git a/networks/He-C-Fe-group/56co-56fe_electroncapture.dat b/networks/He-C-Fe-group/56co-56fe_electroncapture.dat new file mode 100644 index 0000000000..4407bda39e --- /dev/null +++ b/networks/He-C-Fe-group/56co-56fe_electroncapture.dat @@ -0,0 +1,148 @@ +!56co -> 56fe, e- capture +!Q=-4.055 MeV +! +!Log(rhoY) Log(temp) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -9.845000 -1.359829e+01 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -10.330000 -1.360129e+01 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -10.463000 -1.357029e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -10.543000 -1.269229e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -9.823000 -1.190729e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -8.389000 -1.158929e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -7.035000 -1.124329e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -6.195000 -1.068229e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -5.039000 -9.477290e+00 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -3.446000 -8.079290e+00 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -1.241000 -6.190290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 1.752000 -2.941290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -8.866000 -1.357129e+01 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -9.331000 -1.359129e+01 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -9.463000 -1.356429e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -9.543000 -1.269129e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -9.410000 -1.190729e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -8.367000 -1.158929e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -7.034000 -1.124329e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -6.195000 -1.068229e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -5.039000 -9.477290e+00 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -3.446000 -8.079290e+00 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -1.241000 -6.190290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 1.752000 -2.941290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -7.995000 -1.341529e+01 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -8.337000 -1.350629e+01 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -8.465000 -1.350229e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -8.544000 -1.268329e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -8.463000 -1.190529e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -8.161000 -1.158829e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -7.020000 -1.124229e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -6.192000 -1.068229e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -5.039000 -9.477290e+00 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -3.446000 -8.079290e+00 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -1.241000 -6.190290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 1.752000 -2.941290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -7.282000 -1.302429e+01 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -7.388000 -1.309829e+01 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -7.483000 -1.314829e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -7.549000 -1.261229e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -7.465000 -1.188529e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -7.343000 -1.157529e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -6.879000 -1.123529e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -6.161000 -1.067929e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -5.033000 -9.476290e+00 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -3.445000 -8.079290e+00 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -1.241000 -6.190290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 1.752000 -2.941290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -6.561000 -1.240329e+01 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -6.566000 -1.240729e+01 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -6.580000 -1.241729e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -6.584000 -1.223429e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -6.475000 -1.173129e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -6.349000 -1.145429e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -6.159000 -1.114429e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -5.877000 -1.064329e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -4.981000 -9.469290e+00 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -3.437000 -8.077290e+00 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -1.240000 -6.190290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 1.752000 -2.941290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -5.669000 -1.151229e+01 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -5.669000 -1.151029e+01 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -5.666000 -1.150729e+01 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -5.632000 -1.142629e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -5.490000 -1.113829e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -5.347000 -1.091629e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -5.152000 -1.064429e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -4.975000 -1.031029e+01 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -4.556000 -9.385290e+00 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -3.357000 -8.050290e+00 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -1.231000 -6.183290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 1.752000 -2.940290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -4.359000 -1.014129e+01 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -4.358000 -1.014029e+01 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -4.356000 -1.013829e+01 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -4.334000 -1.010029e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -4.236000 -9.941290e+00 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -4.129000 -9.784290e+00 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -3.974000 -9.572290e+00 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -3.829000 -9.359290e+00 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -3.513000 -8.813290e+00 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -2.785000 -7.770290e+00 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -1.145000 -6.111290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 1.755000 -2.937290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -2.447000 -8.087290e+00 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -2.446000 -8.086290e+00 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -2.445000 -8.085290e+00 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -2.438000 -8.073290e+00 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -2.403000 -8.018290e+00 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -2.361000 -7.952290e+00 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -2.289000 -7.849290e+00 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -2.214000 -7.743290e+00 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -2.029000 -7.469290e+00 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -1.539000 -6.764290e+00 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -0.523000 -5.552290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 1.786000 -2.906290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 4.568000 3.957104e-01 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 0.248000 -5.230290e+00 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 0.248000 -5.230290e+00 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 0.249000 -5.229290e+00 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 0.250000 -5.228290e+00 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 0.252000 -5.222290e+00 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 0.256000 -5.213290e+00 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 0.266000 -5.195290e+00 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 0.281000 -5.170290e+00 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 0.324000 -5.099290e+00 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 0.456000 -4.874290e+00 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 0.880000 -4.206290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 2.075000 -2.616290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 4.576000 4.037104e-01 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 2.669000 -2.340290e+00 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 2.669000 -2.340290e+00 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 2.669000 -2.340290e+00 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 2.669000 -2.340290e+00 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 2.669000 -2.340290e+00 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 2.668000 -2.340290e+00 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 2.668000 -2.339290e+00 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 2.669000 -2.337290e+00 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 2.673000 -2.330290e+00 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 2.688000 -2.302290e+00 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 2.759000 -2.169290e+00 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 3.178000 -1.483290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 4.659000 4.867104e-01 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 4.604000 2.371039e-02 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 4.604000 2.371039e-02 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 4.604000 2.371039e-02 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 4.604000 2.371039e-02 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 4.603000 2.371039e-02 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 4.603000 2.271039e-02 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 4.603000 2.271039e-02 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 4.603000 2.271039e-02 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 4.603000 2.371039e-02 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 4.605000 2.771039e-02 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 4.619000 5.271039e-02 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 4.727000 2.397104e-01 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 5.265000 1.107710e+00 -100.00 diff --git a/networks/He-C-Fe-group/56co-56ni_betadecay.dat b/networks/He-C-Fe-group/56co-56ni_betadecay.dat new file mode 100644 index 0000000000..bc7ca8dc68 --- /dev/null +++ b/networks/He-C-Fe-group/56co-56ni_betadecay.dat @@ -0,0 +1,148 @@ +!56co -> 56ni, beta-decay +!Q=1.624 MeV +! +!Log(rhoY) Log(temp) mu dQ VS Log(beta-decay-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -69.759000 -7.612229e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -37.930000 -4.395729e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -24.300000 -2.897729e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -18.824000 -2.366129e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -14.132000 -1.931729e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -11.418000 -1.689029e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -8.606000 -1.416229e+01 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -6.346000 -1.151229e+01 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -4.350000 -8.551290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 -2.008000 -4.678290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -69.759000 -7.612329e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -37.930000 -4.424529e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -24.300000 -2.937629e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -18.824000 -2.368129e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -14.132000 -1.931829e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -11.418000 -1.689129e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -8.606000 -1.416229e+01 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -6.346000 -1.151229e+01 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -4.350000 -8.551290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 -2.008000 -4.678290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -69.760000 -7.612429e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -37.931000 -4.428929e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -24.300000 -3.017529e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -18.824000 -2.387829e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -14.133000 -1.933129e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -11.418000 -1.689329e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -8.606000 -1.416329e+01 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -6.346000 -1.151229e+01 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -4.350000 -8.551290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 -2.008000 -4.678290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -69.773000 -7.614229e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -37.939000 -4.430529e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -24.306000 -3.058529e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -18.827000 -2.458029e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -14.133000 -1.944629e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -11.418000 -1.691229e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -8.607000 -1.416629e+01 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -6.346000 -1.151329e+01 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -4.350000 -8.551290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 -2.008000 -4.678290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -69.870000 -7.627929e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -38.017000 -4.441029e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -24.360000 -3.072629e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -18.864000 -2.506929e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -14.144000 -1.990129e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -11.422000 -1.706829e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -8.608000 -1.419329e+01 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -6.347000 -1.151929e+01 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -4.350000 -8.552290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 -2.008000 -4.678290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -70.529000 -7.717829e+01 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -38.608000 -4.518429e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -24.816000 -3.129129e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -19.180000 -2.548729e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -14.247000 -2.020929e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -11.475000 -1.735229e+01 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -8.633000 -1.437729e+01 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -6.355000 -1.158329e+01 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -4.351000 -8.560290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 -2.008000 -4.679290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -80.670000 -8.774329e+01 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -43.872000 -5.066029e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -27.609000 -3.396729e+01 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -20.521000 -2.667329e+01 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -14.783000 -2.084629e+01 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -11.864000 -1.787129e+01 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -8.894000 -1.480829e+01 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -6.463000 -1.200229e+01 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -4.365000 -8.644290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 -2.009000 -4.682290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -57.166000 -6.396229e+01 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -34.496000 -4.105829e+01 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -25.280000 -3.169429e+01 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -17.978000 -2.423329e+01 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -14.249000 -2.039929e+01 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -10.429000 -1.643629e+01 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -7.254000 -1.301329e+01 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -4.537000 -9.249290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 -2.016000 -4.713290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 -0.359000 -1.274290e+00 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 -91.260000 -9.805129e+01 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 -53.829000 -6.038529e+01 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 -38.714000 -4.512229e+01 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 -26.826000 -3.306929e+01 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 -20.801000 -2.693229e+01 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 -14.680000 -2.066129e+01 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 -9.657000 -1.543829e+01 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 -5.530000 -1.070929e+01 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 -2.101000 -5.005290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 -0.361000 -1.283290e+00 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 -96.457000 -1.030123e+02 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 -68.516000 -7.492229e+01 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 -46.653000 -5.289529e+01 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 -35.642000 -4.177129e+01 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 -24.535000 -3.051129e+01 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 -15.521000 -2.129929e+01 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 -8.385000 -1.369229e+01 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 -2.775000 -6.204290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 -0.381000 -1.366290e+00 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 -89.674000 -9.591429e+01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 -67.900000 -7.402629e+01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 -46.031000 -5.200129e+01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 -28.406000 -3.417629e+01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 -14.767000 -2.010129e+01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 -4.615000 -8.507290e+00 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 -0.624000 -2.000290e+00 -100.00 diff --git a/networks/He-C-Fe-group/56fe-56co_betadecay.dat b/networks/He-C-Fe-group/56fe-56co_betadecay.dat new file mode 100644 index 0000000000..630b61dc92 --- /dev/null +++ b/networks/He-C-Fe-group/56fe-56co_betadecay.dat @@ -0,0 +1,148 @@ +!56fe -> 56co, beta-decay +!Q=4.055 MeV +! +!Log(rhoY) Log(temp) mu dQ VS Log(beta-decay-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -66.195000 -6.958329e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -40.317000 -4.373429e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -29.773000 -3.392829e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -21.201000 -2.592829e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -16.597000 -2.162029e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -11.487000 -1.678829e+01 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -6.920000 -1.221529e+01 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -3.437000 -8.200290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -66.195000 -7.058129e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -40.317000 -4.414629e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -29.773000 -3.394929e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -21.201000 -2.592929e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -16.597000 -2.162029e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -11.487000 -1.678829e+01 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -6.920000 -1.221529e+01 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -3.437000 -8.200290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -66.197000 -7.156029e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -40.318000 -4.508829e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -29.773000 -3.415429e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -21.201000 -2.594329e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -16.597000 -2.162329e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -11.487000 -1.678929e+01 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -6.920000 -1.221629e+01 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -3.437000 -8.200290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -66.213000 -7.239829e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -40.327000 -4.603329e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -29.778000 -3.495229e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -21.202000 -2.607829e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -16.597000 -2.165129e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -11.487000 -1.679229e+01 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -6.920000 -1.221629e+01 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -3.437000 -8.200290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -66.363000 -7.293929e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -40.413000 -4.675229e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -29.823000 -3.579129e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -21.219000 -2.672229e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -16.602000 -2.189129e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -11.488000 -1.682529e+01 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -6.920000 -1.222029e+01 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -3.438000 -8.201290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -67.649000 -7.445329e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -41.092000 -4.760029e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -30.179000 -3.646829e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -21.373000 -2.738129e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -16.673000 -2.245629e+01 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -11.505000 -1.704429e+01 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -6.924000 -1.226129e+01 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -3.438000 -8.208290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -73.046000 -7.985329e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -43.828000 -5.039029e+01 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -31.880000 -3.821729e+01 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -22.204000 -2.828029e+01 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -17.107000 -2.302529e+01 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -11.672000 -1.739629e+01 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -6.975000 -1.248929e+01 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -3.449000 -8.280290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 -1.450000 -4.331290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -87.074000 -9.383229e+01 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -51.037000 -5.748829e+01 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -36.358000 -4.265529e+01 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -24.715000 -3.083529e+01 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -18.730000 -2.472029e+01 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -12.543000 -1.837029e+01 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -7.409000 -1.306929e+01 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -3.585000 -8.764290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 -1.458000 -4.362290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 -0.583000 -1.108290e+00 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 -69.155000 -7.570329e+01 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 -48.720000 -5.511629e+01 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 -32.645000 -3.887129e+01 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 -24.497000 -3.060529e+01 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 -16.232000 -2.218229e+01 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 -9.514000 -1.528229e+01 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 -4.522000 -9.984290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 -1.554000 -4.653290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 -0.586000 -1.116290e+00 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 -78.495000 -8.489429e+01 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 -52.454000 -5.868529e+01 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 -39.327000 -4.544229e+01 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 -26.090000 -3.204829e+01 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 -15.401000 -2.117629e+01 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 -7.428000 -1.292829e+01 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 -2.317000 -5.852290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 -0.611000 -1.199290e+00 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 -95.485000 -1.017163e+02 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 -71.597000 -7.771229e+01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 -47.600000 -5.355729e+01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 -28.307000 -3.407929e+01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 -13.887000 -1.938129e+01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 -4.434000 -8.171290e+00 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 -0.899000 -1.833290e+00 -100.00 diff --git a/networks/He-C-Fe-group/56ni-56co_electroncapture.dat b/networks/He-C-Fe-group/56ni-56co_electroncapture.dat new file mode 100644 index 0000000000..71e499bc25 --- /dev/null +++ b/networks/He-C-Fe-group/56ni-56co_electroncapture.dat @@ -0,0 +1,148 @@ +!56ni -> 56co, e- capture +!Q=-1.624 MeV +! +!Log(rhoY) Log(temp) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -8.684000 -1.486129e+01 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -9.164000 -1.533229e+01 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -9.291000 -1.544729e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -9.387000 -1.551729e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -8.777000 -1.485829e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -7.439000 -1.346429e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -6.184000 -1.211329e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -5.406000 -1.124729e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -4.325000 -1.001729e+01 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -2.782000 -8.181290e+00 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -0.691000 -5.723290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 2.011000 -2.678290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -7.705000 -1.388129e+01 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -8.165000 -1.433229e+01 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -8.291000 -1.444829e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -8.387000 -1.451729e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -8.364000 -1.444529e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -7.418000 -1.344329e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -6.182000 -1.211229e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -5.406000 -1.124729e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -4.325000 -1.001729e+01 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -2.782000 -8.181290e+00 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -0.691000 -5.723290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 2.011000 -2.678290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -6.834000 -1.300929e+01 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -7.171000 -1.333829e+01 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -7.293000 -1.344929e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -7.388000 -1.351729e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -7.417000 -1.349729e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -7.212000 -1.323729e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -6.168000 -1.209729e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -5.403000 -1.124429e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -4.324000 -1.001729e+01 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -2.782000 -8.181290e+00 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -0.691000 -5.723290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 2.011000 -2.678290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -6.118000 -1.228929e+01 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -6.220000 -1.238529e+01 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -6.310000 -1.246529e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -6.392000 -1.252029e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -6.418000 -1.249829e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -6.393000 -1.241829e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -6.027000 -1.195629e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -5.372000 -1.121229e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -4.319000 -1.001129e+01 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -2.781000 -8.180290e+00 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -0.691000 -5.723290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 2.011000 -2.678290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -5.384000 -1.153229e+01 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -5.388000 -1.153329e+01 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -5.399000 -1.153829e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -5.421000 -1.153729e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -5.423000 -1.149429e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -5.395000 -1.141429e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -5.305000 -1.123129e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -5.087000 -1.092729e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -4.266000 -9.960290e+00 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -2.773000 -8.174290e+00 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -0.690000 -5.722290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 2.011000 -2.678290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -4.448000 -1.050329e+01 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -4.447000 -1.050129e+01 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -4.444000 -1.049429e+01 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -4.432000 -1.047129e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -4.403000 -1.041229e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -4.363000 -1.033429e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -4.278000 -1.017529e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -4.170000 -9.994290e+00 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -3.834000 -9.531290e+00 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -2.691000 -8.105290e+00 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -0.682000 -5.714290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 2.012000 -2.677290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -3.134000 -8.963290e+00 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -3.134000 -8.962290e+00 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -3.132000 -8.960290e+00 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -3.127000 -8.951290e+00 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -3.113000 -8.927290e+00 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -3.091000 -8.892290e+00 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -3.039000 -8.809290e+00 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -2.964000 -8.700290e+00 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -2.727000 -8.397290e+00 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -2.093000 -7.561290e+00 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -0.595000 -5.637290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 2.015000 -2.674290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -1.311000 -6.966290e+00 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -1.311000 -6.966290e+00 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -1.310000 -6.965290e+00 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -1.305000 -6.960290e+00 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -1.293000 -6.948290e+00 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -1.275000 -6.929290e+00 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -1.232000 -6.883290e+00 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -1.177000 -6.819290e+00 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -1.039000 -6.646290e+00 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -0.719000 -6.191290e+00 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 0.028000 -5.049290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 2.046000 -2.643290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 4.729000 5.607104e-01 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 1.069000 -4.277290e+00 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 1.069000 -4.277290e+00 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 1.069000 -4.277290e+00 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 1.070000 -4.276290e+00 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 1.071000 -4.274290e+00 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 1.073000 -4.270290e+00 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 1.078000 -4.262290e+00 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 1.085000 -4.250290e+00 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 1.104000 -4.217290e+00 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 1.159000 -4.117290e+00 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 1.386000 -3.681290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 2.333000 -2.353290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 4.737000 5.697104e-01 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 3.035000 -1.889290e+00 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 3.034000 -1.889290e+00 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 3.034000 -1.889290e+00 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 3.034000 -1.889290e+00 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 3.035000 -1.888290e+00 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 3.035000 -1.888290e+00 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 3.036000 -1.887290e+00 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 3.037000 -1.885290e+00 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 3.040000 -1.879290e+00 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 3.048000 -1.864290e+00 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 3.084000 -1.782290e+00 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 3.420000 -1.226290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 4.819000 6.527104e-01 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 4.826000 2.827104e-01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 4.826000 2.837104e-01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 4.826000 2.847104e-01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 4.827000 2.867104e-01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 4.831000 2.977104e-01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 4.926000 4.587104e-01 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 5.424000 1.272710e+00 -100.00 diff --git a/networks/He-C-Fe-group/57co-57ni_betadecay.dat b/networks/He-C-Fe-group/57co-57ni_betadecay.dat new file mode 100644 index 0000000000..a61cf7db64 --- /dev/null +++ b/networks/He-C-Fe-group/57co-57ni_betadecay.dat @@ -0,0 +1,148 @@ +!57co -> 57ni, beta-decay +!Q=2.7532 MeV +! +!Log(rhoY) Log(temp) mu dQ VS Log(beta-decay-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -96.775000 -9.530129e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -51.579000 -5.243729e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -32.097000 -3.400129e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -24.151000 -2.730929e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -17.517000 -2.184729e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -13.874000 -1.884529e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -9.905000 -1.529829e+01 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -6.454000 -1.174429e+01 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -3.681000 -8.172290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -96.775000 -9.630129e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -51.579000 -5.343729e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -32.097000 -3.441429e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -24.151000 -2.733029e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -17.517000 -2.184829e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -13.874000 -1.884529e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -9.905000 -1.529829e+01 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -6.454000 -1.174429e+01 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -3.681000 -8.172290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -96.776000 -9.730729e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -51.580000 -5.443929e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -32.098000 -3.536229e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -24.151000 -2.753629e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -17.517000 -2.186229e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -13.875000 -1.884829e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -9.905000 -1.529829e+01 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -6.454000 -1.174429e+01 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -3.681000 -8.172290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -96.793000 -9.836229e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -51.591000 -5.545629e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -32.104000 -3.636529e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -24.155000 -2.835529e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -17.518000 -2.200129e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -13.875000 -1.887629e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -9.905000 -1.530129e+01 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -6.454000 -1.174429e+01 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -3.681000 -8.172290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -96.924000 -9.986529e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -51.686000 -5.661529e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -32.165000 -3.740429e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -24.190000 -2.935429e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -17.530000 -2.268529e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -13.879000 -1.911829e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -9.907000 -1.533329e+01 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -6.454000 -1.174929e+01 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -3.681000 -8.173290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -97.900000 -1.039633e+02 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -52.439000 -5.868429e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -32.666000 -3.875629e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -24.480000 -3.041629e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -17.642000 -2.346829e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -13.936000 -1.968729e+01 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -9.926000 -1.554629e+01 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -6.460000 -1.180029e+01 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -3.682000 -8.181290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -57.478000 -6.412529e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -35.000000 -4.140829e+01 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -25.767000 -3.203029e+01 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -18.296000 -2.435729e+01 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -14.331000 -2.026929e+01 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -10.130000 -1.594029e+01 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -6.538000 -1.211229e+01 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -3.696000 -8.261290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 -1.739000 -4.308290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -70.894000 -7.767829e+01 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -42.039000 -4.854829e+01 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -30.284000 -3.663729e+01 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -20.973000 -2.717229e+01 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -16.218000 -2.231329e+01 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -11.318000 -1.726729e+01 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -7.168000 -1.292229e+01 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -3.867000 -8.831290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 -1.746000 -4.339290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 -0.687000 -1.026290e+00 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 -61.151000 -6.770529e+01 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 -43.563000 -4.996729e+01 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 -29.722000 -3.595829e+01 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 -22.694000 -2.881629e+01 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 -15.514000 -2.148329e+01 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 -9.548000 -1.533329e+01 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 -4.885000 -1.021429e+01 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 -1.837000 -4.631290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 -0.689000 -1.035290e+00 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 -73.334000 -7.973829e+01 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 -49.526000 -5.576429e+01 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 -37.518000 -4.364129e+01 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 -25.359000 -3.132729e+01 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 -15.409000 -2.119129e+01 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 -7.753000 -1.316329e+01 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 -2.554000 -5.832290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 -0.714000 -1.118290e+00 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 -92.524000 -9.875729e+01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 -69.750000 -7.586829e+01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 -46.826000 -5.278529e+01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 -28.262000 -3.402729e+01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 -14.133000 -1.954729e+01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 -4.558000 -8.151290e+00 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 -1.004000 -1.753290e+00 -100.00 diff --git a/networks/He-C-Fe-group/57ni-57co_electroncapture.dat b/networks/He-C-Fe-group/57ni-57co_electroncapture.dat new file mode 100644 index 0000000000..6afc604de0 --- /dev/null +++ b/networks/He-C-Fe-group/57ni-57co_electroncapture.dat @@ -0,0 +1,148 @@ +!57ni -> 57co, e- capture +!Q=-2.7532 MeV +! +!Log(rhoY) Log(temp) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -8.322000 -1.175729e+01 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -8.814000 -1.175929e+01 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -8.955000 -1.176029e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -9.083000 -1.176029e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -8.525000 -1.175729e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -7.242000 -1.167529e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -6.073000 -1.107329e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -5.366000 -1.047129e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -4.399000 -9.642290e+00 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -3.016000 -8.268290e+00 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -0.921000 -5.964290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 1.959000 -2.733290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -7.342000 -1.173129e+01 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -7.814000 -1.175029e+01 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -7.955000 -1.175329e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -8.083000 -1.175529e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -8.112000 -1.175429e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -7.221000 -1.167329e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -6.071000 -1.107329e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -5.365000 -1.047129e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -4.399000 -9.642290e+00 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -3.016000 -8.268290e+00 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -0.921000 -5.964290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 1.959000 -2.733290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -6.472000 -1.157729e+01 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -6.821000 -1.166829e+01 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -6.957000 -1.169129e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -7.084000 -1.170729e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -7.165000 -1.171429e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -7.015000 -1.165229e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -6.057000 -1.106929e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -5.362000 -1.047029e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -4.399000 -9.642290e+00 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -3.016000 -8.268290e+00 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -0.921000 -5.964290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 1.959000 -2.733290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -5.763000 -1.119229e+01 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -5.874000 -1.126929e+01 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -5.977000 -1.133529e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -6.090000 -1.140029e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -6.167000 -1.143829e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -6.197000 -1.142429e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -5.916000 -1.102029e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -5.331000 -1.045729e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -4.393000 -9.639290e+00 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -3.015000 -8.267290e+00 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -0.921000 -5.964290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 1.959000 -2.733290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -5.060000 -1.059129e+01 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -5.067000 -1.059829e+01 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -5.087000 -1.061529e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -5.134000 -1.065629e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -5.183000 -1.069429e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -5.207000 -1.070329e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -5.198000 -1.060329e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -5.048000 -1.031329e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -4.341000 -9.605290e+00 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -3.007000 -8.261290e+00 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -0.920000 -5.963290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 1.959000 -2.733290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -4.243000 -9.783290e+00 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -4.243000 -9.783290e+00 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -4.242000 -9.782290e+00 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -4.241000 -9.779290e+00 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -4.239000 -9.772290e+00 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -4.234000 -9.760290e+00 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -4.210000 -9.711290e+00 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -4.156000 -9.610290e+00 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -3.917000 -9.286290e+00 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -2.926000 -8.201290e+00 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -0.911000 -5.956290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 1.959000 -2.732290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -3.181000 -8.674290e+00 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -3.181000 -8.673290e+00 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -3.180000 -8.672290e+00 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -3.178000 -8.669290e+00 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -3.171000 -8.661290e+00 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -3.160000 -8.647290e+00 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -3.128000 -8.607290e+00 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -3.071000 -8.535290e+00 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -2.880000 -8.316290e+00 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -2.338000 -7.703290e+00 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -0.824000 -5.881290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 1.962000 -2.729290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -1.641000 -7.126290e+00 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -1.641000 -7.125290e+00 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -1.640000 -7.125290e+00 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -1.637000 -7.122290e+00 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -1.627000 -7.115290e+00 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -1.613000 -7.104290e+00 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -1.575000 -7.072290e+00 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -1.518000 -7.016290e+00 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -1.362000 -6.847290e+00 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -1.005000 -6.419290e+00 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -0.193000 -5.302290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 1.993000 -2.698290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 4.711000 5.417104e-01 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 0.856000 -4.539290e+00 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 0.856000 -4.539290e+00 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 0.856000 -4.539290e+00 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 0.857000 -4.538290e+00 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 0.858000 -4.535290e+00 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 0.861000 -4.530290e+00 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 0.867000 -4.520290e+00 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 0.874000 -4.506290e+00 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 0.893000 -4.468290e+00 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 0.952000 -4.355290e+00 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 1.217000 -3.895290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 2.281000 -2.408290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 4.720000 5.497104e-01 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 2.953000 -1.999290e+00 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 2.953000 -1.999290e+00 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 2.953000 -1.999290e+00 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 2.953000 -1.999290e+00 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 2.953000 -1.998290e+00 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 2.953000 -1.998290e+00 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 2.954000 -1.997290e+00 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 2.954000 -1.996290e+00 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 2.953000 -1.995290e+00 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 2.952000 -1.987290e+00 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 2.995000 -1.901290e+00 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 3.374000 -1.278290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 4.802000 6.327104e-01 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 4.789000 2.337104e-01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 4.786000 2.307104e-01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 4.779000 2.247104e-01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 4.782000 2.357104e-01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 4.894000 4.207104e-01 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 5.407000 1.252710e+00 -100.00 diff --git a/networks/He-C-Fe-group/He-C-Fe-group.png b/networks/He-C-Fe-group/He-C-Fe-group.png new file mode 100644 index 0000000000..6daf1fc36a Binary files /dev/null and b/networks/He-C-Fe-group/He-C-Fe-group.png differ diff --git a/networks/He-C-Fe-group/He-C-Fe-group.py b/networks/He-C-Fe-group/He-C-Fe-group.py new file mode 100644 index 0000000000..e4429b1d1a --- /dev/null +++ b/networks/He-C-Fe-group/He-C-Fe-group.py @@ -0,0 +1,140 @@ +import pynucastro as pyna +from pynucastro.rates import ReacLibRate, TabularRate + +DO_DERIVED_RATES = True + +reaclib_lib = pyna.ReacLibLibrary() +weak_lib = pyna.TabularLibrary() + +# these are the nuclei we have in subch_simple + +all_reactants = ["p", + "he4", "c12", "o16", "ne20", "mg24", "si28", "s32", + "ar36", "ca40", "ti44", "cr48", "fe52", "ni56", + "cu59", "zn60", + "al27", "p31", "cl35", "k39", "sc43", "v47", "mn51", "co55", + "n13", "n14", "f18", "ne21", "na22", "na23"] + +# create a library of ReacLib rates + +core_lib = reaclib_lib.linking_nuclei(all_reactants) + +# in this list, we have the reactants, the actual reactants, +# and modified products that we will use instead + +other_rates = [("c12(c12,n)mg23", "mg24"), + ("o16(o16,n)s31", "s32"), + ("o16(c12,n)si27", "si28")] + +for r, mp in other_rates: + _r = reaclib_lib.get_rate_by_name(r) + _r.modify_products(mp) + core_lib.add_rate(_r) + +# finally, the aprox nets don't include the reverse rates for +# C12+C12, C12+O16, and O16+O16, so remove those + +for r in core_lib.get_rates(): + if sorted(r.products) in [[pyna.Nucleus("c12"), pyna.Nucleus("c12")], + [pyna.Nucleus("c12"), pyna.Nucleus("o16")], + [pyna.Nucleus("o16"), pyna.Nucleus("o16")]]: + core_lib.remove_rate(r) + +# C12+Ne20 and reverse +# (a,g) links between Na23 and Al27 +# (a,g) links between Al27 and P31 + +rates_to_remove = ["p31(p,c12)ne20", + "si28(a,c12)ne20", + "ne20(c12,p)p31", + "ne20(c12,a)si28", + "na23(a,g)al27", + "al27(g,a)na23", + "al27(a,g)p31", + "p31(g,a)al27"] + +for r in rates_to_remove: + print("removing: ", r) + _r = core_lib.get_rate_by_name(r) + core_lib.remove_rate(_r) + +# now create a list of iron group nuclei and find both the +# ReacLib and weak / tabular rates linking these. + +iron_peak = ["n", "p", "he4", + "mn51", "mn55", + "fe52", "fe53", "fe54", "fe55", "fe56", + "co55", "co56", "co57", + "ni56", "ni57", "ni58", + "cu59", "zn60"] + +iron_reaclib = reaclib_lib.linking_nuclei(iron_peak) + +iron_weak_lib = weak_lib.linking_nuclei(iron_peak) + +# add the libraries + +all_lib = core_lib + iron_reaclib + iron_weak_lib + +if DO_DERIVED_RATES: + rates_to_derive = [] + for r in all_lib.get_rates(): + if r.reverse: + # this rate was computed using detailed balance, regardless + # of whether Q < 0 or not. We want to remove it and then + # recompute it + rates_to_derive.append(r) + + # now for each of those derived rates, look to see if the pair exists + + for r in rates_to_derive: + fr = all_lib.get_rate_by_nuclei(r.products, r.reactants) + if fr: + print(f"modifying {r} from {fr}") + all_lib.remove_rate(r) + d = pyna.DerivedRate(rate=fr, compute_Q=False, use_pf=True) + all_lib.add_rate(d) + +# combine all three libraries into a single network + +net = pyna.AmrexAstroCxxNetwork(libraries=[all_lib], + symmetric_screening=False) + +# we will have duplicate rates -- we want to remove any ReacLib rates +# that we have tabular rates for + +dupes = net.find_duplicate_links() + +rates_to_remove = [] +for d in dupes: + for r in d: + if isinstance(r, ReacLibRate): + rates_to_remove.append(r) + +net.remove_rates(rates_to_remove) + +# now we approximate some (alpha, p)(p, gamma) links + +net.make_ap_pg_approx(intermediate_nuclei=["cl35", "k39", "sc43", "v47"]) +net.remove_nuclei(["cl35", "k39", "sc43", "v47"]) + +# let's make a figure + +T = 6.e9 +rho = 9.e7 +comp = pyna.Composition(net.unique_nuclei) +comp.set_all(1.0) +comp.normalize() + +fig = net.plot(rho=rho, T=T, comp=comp, + rotated=True, curved_edges=True, hide_xalpha=True, + size=(1800, 900), + node_size=500, node_shape="s", node_font_size=10) + +fig.savefig("He-C-Fe-group.png") + +print(f"number of nuclei = {len(net.unique_nuclei)}") +print(f"number of ReacLib rates = {len(net.reaclib_rates)}") +print(f"number of tabular rates = {len(net.tabular_rates)}") + +net.write_network() diff --git a/networks/He-C-Fe-group/Make.package b/networks/He-C-Fe-group/Make.package new file mode 100644 index 0000000000..39c65eca7b --- /dev/null +++ b/networks/He-C-Fe-group/Make.package @@ -0,0 +1,14 @@ +CEXE_headers += network_properties.H + +ifeq ($(USE_REACT),TRUE) + CEXE_sources += actual_network_data.cpp + CEXE_headers += actual_network.H + CEXE_headers += tfactors.H + CEXE_headers += partition_functions.H + CEXE_headers += actual_rhs.H + CEXE_headers += reaclib_rates.H + CEXE_headers += table_rates.H + CEXE_sources += table_rates_data.cpp + USE_SCREENING = TRUE + USE_NEUTRINOS = TRUE +endif diff --git a/networks/He-C-Fe-group/README.md b/networks/He-C-Fe-group/README.md new file mode 100644 index 0000000000..66e834cabf --- /dev/null +++ b/networks/He-C-Fe-group/README.md @@ -0,0 +1,7 @@ +# He-C-Fe-group + +This is a network for He and C burning with a heavy emphasis on iron +group. It has the same basic structure as ``subch_approx`` for the +main alpha-chain. At high mass number, a lot of nuclei in the iron +group are added and weak rates from the Langanke tables are used to +link them. Neutrons are only present in the links in the iron group. diff --git a/networks/He-C-Fe-group/_parameters b/networks/He-C-Fe-group/_parameters new file mode 100644 index 0000000000..e7a017d5aa --- /dev/null +++ b/networks/He-C-Fe-group/_parameters @@ -0,0 +1,2 @@ +@namespace: network + diff --git a/networks/He-C-Fe-group/actual_network.H b/networks/He-C-Fe-group/actual_network.H new file mode 100644 index 0000000000..d45a9042df --- /dev/null +++ b/networks/He-C-Fe-group/actual_network.H @@ -0,0 +1,407 @@ +#ifndef actual_network_H +#define actual_network_H + +#include +#include + +#include +#include + +using namespace amrex; + +void actual_network_init(); + +const std::string network_name = "pynucastro-cxx"; + +namespace network +{ + extern AMREX_GPU_MANAGED amrex::Array1D bion; + extern AMREX_GPU_MANAGED amrex::Array1D mion; +} + +namespace Rates +{ + + enum NetworkRates + { + k_p_c12_to_n13 = 1, + k_he4_c12_to_o16 = 2, + k_he4_n14_to_f18 = 3, + k_he4_o16_to_ne20 = 4, + k_he4_f18_to_na22 = 5, + k_he4_ne20_to_mg24 = 6, + k_p_ne21_to_na22 = 7, + k_p_na23_to_mg24 = 8, + k_he4_mg24_to_si28 = 9, + k_p_al27_to_si28 = 10, + k_he4_si28_to_s32 = 11, + k_p_p31_to_s32 = 12, + k_he4_cr48_to_fe52 = 13, + k_p_mn51_to_fe52 = 14, + k_he4_mn51_to_co55 = 15, + k_he4_fe52_to_ni56 = 16, + k_p_co55_to_ni56 = 17, + k_he4_co55_to_cu59 = 18, + k_he4_ni56_to_zn60 = 19, + k_p_cu59_to_zn60 = 20, + k_c12_c12_to_p_na23 = 21, + k_c12_c12_to_he4_ne20 = 22, + k_he4_n13_to_p_o16 = 23, + k_c12_o16_to_p_al27 = 24, + k_c12_o16_to_he4_mg24 = 25, + k_o16_o16_to_p_p31 = 26, + k_o16_o16_to_he4_si28 = 27, + k_he4_f18_to_p_ne21 = 28, + k_p_na23_to_he4_ne20 = 29, + k_p_al27_to_he4_mg24 = 30, + k_p_p31_to_he4_si28 = 31, + k_he4_cr48_to_p_mn51 = 32, + k_he4_fe52_to_p_co55 = 33, + k_p_cu59_to_he4_ni56 = 34, + k_he4_he4_he4_to_c12 = 35, + k_c12_c12_to_mg24_modified = 36, + k_o16_o16_to_s32_modified = 37, + k_c12_o16_to_si28_modified = 38, + k_n_to_p_weak_wc12 = 39, + k_p_mn55_to_fe56 = 40, + k_n_fe52_to_fe53 = 41, + k_n_fe53_to_fe54 = 42, + k_he4_fe53_to_ni57 = 43, + k_n_fe54_to_fe55 = 44, + k_p_fe54_to_co55 = 45, + k_he4_fe54_to_ni58 = 46, + k_n_fe55_to_fe56 = 47, + k_p_fe55_to_co56 = 48, + k_p_fe56_to_co57 = 49, + k_n_co55_to_co56 = 50, + k_n_co56_to_co57 = 51, + k_p_co56_to_ni57 = 52, + k_p_co57_to_ni58 = 53, + k_n_ni56_to_ni57 = 54, + k_n_ni57_to_ni58 = 55, + k_p_ni58_to_cu59 = 56, + k_he4_mn51_to_p_fe54 = 57, + k_he4_fe53_to_p_co56 = 58, + k_n_fe55_to_p_mn55 = 59, + k_n_co55_to_p_fe55 = 60, + k_he4_co55_to_p_ni58 = 61, + k_n_co56_to_p_fe56 = 62, + k_p_co57_to_he4_fe54 = 63, + k_n_ni56_to_p_co56 = 64, + k_n_ni56_to_he4_fe53 = 65, + k_n_ni57_to_p_co57 = 66, + k_n_ni57_to_he4_fe54 = 67, + k_n_ni58_to_he4_fe55 = 68, + k_n_cu59_to_he4_co56 = 69, + k_n_zn60_to_he4_ni57 = 70, + k_he4_s32_to_ar36_removed = 71, + k_p_cl35_to_ar36_removed = 72, + k_p_cl35_to_he4_s32_removed = 73, + k_he4_ar36_to_ca40_removed = 74, + k_p_k39_to_ca40_removed = 75, + k_p_k39_to_he4_ar36_removed = 76, + k_he4_ca40_to_ti44_removed = 77, + k_p_sc43_to_ti44_removed = 78, + k_p_sc43_to_he4_ca40_removed = 79, + k_he4_ti44_to_cr48_removed = 80, + k_he4_ti44_to_p_v47_removed = 81, + k_p_v47_to_cr48_removed = 82, + k_co55_to_fe55 = 83, + k_co56_to_fe56 = 84, + k_co56_to_ni56 = 85, + k_co57_to_ni57 = 86, + k_fe55_to_co55 = 87, + k_fe55_to_mn55 = 88, + k_fe56_to_co56 = 89, + k_mn55_to_fe55 = 90, + k_ni56_to_co56 = 91, + k_ni57_to_co57 = 92, + k_s32_he4_to_ar36_approx = 93, + k_ar36_to_s32_he4_approx = 94, + k_ar36_he4_to_ca40_approx = 95, + k_ca40_to_ar36_he4_approx = 96, + k_ca40_he4_to_ti44_approx = 97, + k_ti44_to_ca40_he4_approx = 98, + k_ti44_he4_to_cr48_approx = 99, + k_cr48_to_ti44_he4_approx = 100, + k_n13_to_p_c12_derived = 101, + k_o16_to_he4_c12_derived = 102, + k_f18_to_he4_n14_derived = 103, + k_ne20_to_he4_o16_derived = 104, + k_na22_to_p_ne21_derived = 105, + k_na22_to_he4_f18_derived = 106, + k_mg24_to_p_na23_derived = 107, + k_mg24_to_he4_ne20_derived = 108, + k_si28_to_p_al27_derived = 109, + k_si28_to_he4_mg24_derived = 110, + k_s32_to_p_p31_derived = 111, + k_s32_to_he4_si28_derived = 112, + k_fe52_to_p_mn51_derived = 113, + k_fe52_to_he4_cr48_derived = 114, + k_co55_to_he4_mn51_derived = 115, + k_ni56_to_p_co55_derived = 116, + k_ni56_to_he4_fe52_derived = 117, + k_cu59_to_he4_co55_derived = 118, + k_zn60_to_p_cu59_derived = 119, + k_zn60_to_he4_ni56_derived = 120, + k_c12_to_he4_he4_he4_derived = 121, + k_p_o16_to_he4_n13_derived = 122, + k_he4_ne20_to_p_na23_derived = 123, + k_p_ne21_to_he4_f18_derived = 124, + k_he4_mg24_to_p_al27_derived = 125, + k_he4_si28_to_p_p31_derived = 126, + k_p_mn51_to_he4_cr48_derived = 127, + k_p_co55_to_he4_fe52_derived = 128, + k_he4_ni56_to_p_cu59_derived = 129, + k_fe53_to_n_fe52_derived = 130, + k_fe54_to_n_fe53_derived = 131, + k_fe55_to_n_fe54_derived = 132, + k_fe56_to_n_fe55_derived = 133, + k_fe56_to_p_mn55_derived = 134, + k_co55_to_p_fe54_derived = 135, + k_co56_to_n_co55_derived = 136, + k_co56_to_p_fe55_derived = 137, + k_co57_to_n_co56_derived = 138, + k_co57_to_p_fe56_derived = 139, + k_ni57_to_n_ni56_derived = 140, + k_ni57_to_p_co56_derived = 141, + k_ni57_to_he4_fe53_derived = 142, + k_ni58_to_n_ni57_derived = 143, + k_ni58_to_p_co57_derived = 144, + k_ni58_to_he4_fe54_derived = 145, + k_cu59_to_p_ni58_derived = 146, + k_p_mn55_to_n_fe55_derived = 147, + k_he4_fe53_to_n_ni56_derived = 148, + k_p_fe54_to_he4_mn51_derived = 149, + k_he4_fe54_to_n_ni57_derived = 150, + k_he4_fe54_to_p_co57_derived = 151, + k_p_fe55_to_n_co55_derived = 152, + k_he4_fe55_to_n_ni58_derived = 153, + k_p_fe56_to_n_co56_derived = 154, + k_p_co56_to_n_ni56_derived = 155, + k_p_co56_to_he4_fe53_derived = 156, + k_he4_co56_to_n_cu59_derived = 157, + k_p_co57_to_n_ni57_derived = 158, + k_he4_ni57_to_n_zn60_derived = 159, + k_p_ni58_to_he4_co55_derived = 160, + k_he4_s32_to_p_cl35_derived_removed = 161, + k_ar36_to_he4_s32_derived_removed = 162, + k_ar36_to_p_cl35_derived_removed = 163, + k_he4_ar36_to_p_k39_derived_removed = 164, + k_ca40_to_he4_ar36_derived_removed = 165, + k_ca40_to_p_k39_derived_removed = 166, + k_he4_ca40_to_p_sc43_derived_removed = 167, + k_ti44_to_he4_ca40_derived_removed = 168, + k_ti44_to_p_sc43_derived_removed = 169, + k_cr48_to_he4_ti44_derived_removed = 170, + k_cr48_to_p_v47_derived_removed = 171, + k_p_v47_to_he4_ti44_derived_removed = 172, + NumRates = k_p_v47_to_he4_ti44_derived_removed + }; + + // number of reaclib rates + + const int NrateReaclib = 154; + + // number of tabular rates + + const int NrateTabular = 10; + + // rate names -- note: the rates are 1-based, not zero-based, so we pad + // this vector with rate_names[0] = "" so the indices line up with the + // NetworkRates enum + + static const std::vector rate_names = { + "", // 0 + "p_c12_to_n13", // 1, + "he4_c12_to_o16", // 2, + "he4_n14_to_f18", // 3, + "he4_o16_to_ne20", // 4, + "he4_f18_to_na22", // 5, + "he4_ne20_to_mg24", // 6, + "p_ne21_to_na22", // 7, + "p_na23_to_mg24", // 8, + "he4_mg24_to_si28", // 9, + "p_al27_to_si28", // 10, + "he4_si28_to_s32", // 11, + "p_p31_to_s32", // 12, + "he4_cr48_to_fe52", // 13, + "p_mn51_to_fe52", // 14, + "he4_mn51_to_co55", // 15, + "he4_fe52_to_ni56", // 16, + "p_co55_to_ni56", // 17, + "he4_co55_to_cu59", // 18, + "he4_ni56_to_zn60", // 19, + "p_cu59_to_zn60", // 20, + "c12_c12_to_p_na23", // 21, + "c12_c12_to_he4_ne20", // 22, + "he4_n13_to_p_o16", // 23, + "c12_o16_to_p_al27", // 24, + "c12_o16_to_he4_mg24", // 25, + "o16_o16_to_p_p31", // 26, + "o16_o16_to_he4_si28", // 27, + "he4_f18_to_p_ne21", // 28, + "p_na23_to_he4_ne20", // 29, + "p_al27_to_he4_mg24", // 30, + "p_p31_to_he4_si28", // 31, + "he4_cr48_to_p_mn51", // 32, + "he4_fe52_to_p_co55", // 33, + "p_cu59_to_he4_ni56", // 34, + "he4_he4_he4_to_c12", // 35, + "c12_c12_to_mg24_modified", // 36, + "o16_o16_to_s32_modified", // 37, + "c12_o16_to_si28_modified", // 38, + "n_to_p_weak_wc12", // 39, + "p_mn55_to_fe56", // 40, + "n_fe52_to_fe53", // 41, + "n_fe53_to_fe54", // 42, + "he4_fe53_to_ni57", // 43, + "n_fe54_to_fe55", // 44, + "p_fe54_to_co55", // 45, + "he4_fe54_to_ni58", // 46, + "n_fe55_to_fe56", // 47, + "p_fe55_to_co56", // 48, + "p_fe56_to_co57", // 49, + "n_co55_to_co56", // 50, + "n_co56_to_co57", // 51, + "p_co56_to_ni57", // 52, + "p_co57_to_ni58", // 53, + "n_ni56_to_ni57", // 54, + "n_ni57_to_ni58", // 55, + "p_ni58_to_cu59", // 56, + "he4_mn51_to_p_fe54", // 57, + "he4_fe53_to_p_co56", // 58, + "n_fe55_to_p_mn55", // 59, + "n_co55_to_p_fe55", // 60, + "he4_co55_to_p_ni58", // 61, + "n_co56_to_p_fe56", // 62, + "p_co57_to_he4_fe54", // 63, + "n_ni56_to_p_co56", // 64, + "n_ni56_to_he4_fe53", // 65, + "n_ni57_to_p_co57", // 66, + "n_ni57_to_he4_fe54", // 67, + "n_ni58_to_he4_fe55", // 68, + "n_cu59_to_he4_co56", // 69, + "n_zn60_to_he4_ni57", // 70, + "he4_s32_to_ar36_removed", // 71, + "p_cl35_to_ar36_removed", // 72, + "p_cl35_to_he4_s32_removed", // 73, + "he4_ar36_to_ca40_removed", // 74, + "p_k39_to_ca40_removed", // 75, + "p_k39_to_he4_ar36_removed", // 76, + "he4_ca40_to_ti44_removed", // 77, + "p_sc43_to_ti44_removed", // 78, + "p_sc43_to_he4_ca40_removed", // 79, + "he4_ti44_to_cr48_removed", // 80, + "he4_ti44_to_p_v47_removed", // 81, + "p_v47_to_cr48_removed", // 82, + "co55_to_fe55", // 83, + "co56_to_fe56", // 84, + "co56_to_ni56", // 85, + "co57_to_ni57", // 86, + "fe55_to_co55", // 87, + "fe55_to_mn55", // 88, + "fe56_to_co56", // 89, + "mn55_to_fe55", // 90, + "ni56_to_co56", // 91, + "ni57_to_co57", // 92, + "s32_he4_to_ar36_approx", // 93, + "ar36_to_s32_he4_approx", // 94, + "ar36_he4_to_ca40_approx", // 95, + "ca40_to_ar36_he4_approx", // 96, + "ca40_he4_to_ti44_approx", // 97, + "ti44_to_ca40_he4_approx", // 98, + "ti44_he4_to_cr48_approx", // 99, + "cr48_to_ti44_he4_approx", // 100, + "n13_to_p_c12_derived", // 101, + "o16_to_he4_c12_derived", // 102, + "f18_to_he4_n14_derived", // 103, + "ne20_to_he4_o16_derived", // 104, + "na22_to_p_ne21_derived", // 105, + "na22_to_he4_f18_derived", // 106, + "mg24_to_p_na23_derived", // 107, + "mg24_to_he4_ne20_derived", // 108, + "si28_to_p_al27_derived", // 109, + "si28_to_he4_mg24_derived", // 110, + "s32_to_p_p31_derived", // 111, + "s32_to_he4_si28_derived", // 112, + "fe52_to_p_mn51_derived", // 113, + "fe52_to_he4_cr48_derived", // 114, + "co55_to_he4_mn51_derived", // 115, + "ni56_to_p_co55_derived", // 116, + "ni56_to_he4_fe52_derived", // 117, + "cu59_to_he4_co55_derived", // 118, + "zn60_to_p_cu59_derived", // 119, + "zn60_to_he4_ni56_derived", // 120, + "c12_to_he4_he4_he4_derived", // 121, + "p_o16_to_he4_n13_derived", // 122, + "he4_ne20_to_p_na23_derived", // 123, + "p_ne21_to_he4_f18_derived", // 124, + "he4_mg24_to_p_al27_derived", // 125, + "he4_si28_to_p_p31_derived", // 126, + "p_mn51_to_he4_cr48_derived", // 127, + "p_co55_to_he4_fe52_derived", // 128, + "he4_ni56_to_p_cu59_derived", // 129, + "fe53_to_n_fe52_derived", // 130, + "fe54_to_n_fe53_derived", // 131, + "fe55_to_n_fe54_derived", // 132, + "fe56_to_n_fe55_derived", // 133, + "fe56_to_p_mn55_derived", // 134, + "co55_to_p_fe54_derived", // 135, + "co56_to_n_co55_derived", // 136, + "co56_to_p_fe55_derived", // 137, + "co57_to_n_co56_derived", // 138, + "co57_to_p_fe56_derived", // 139, + "ni57_to_n_ni56_derived", // 140, + "ni57_to_p_co56_derived", // 141, + "ni57_to_he4_fe53_derived", // 142, + "ni58_to_n_ni57_derived", // 143, + "ni58_to_p_co57_derived", // 144, + "ni58_to_he4_fe54_derived", // 145, + "cu59_to_p_ni58_derived", // 146, + "p_mn55_to_n_fe55_derived", // 147, + "he4_fe53_to_n_ni56_derived", // 148, + "p_fe54_to_he4_mn51_derived", // 149, + "he4_fe54_to_n_ni57_derived", // 150, + "he4_fe54_to_p_co57_derived", // 151, + "p_fe55_to_n_co55_derived", // 152, + "he4_fe55_to_n_ni58_derived", // 153, + "p_fe56_to_n_co56_derived", // 154, + "p_co56_to_n_ni56_derived", // 155, + "p_co56_to_he4_fe53_derived", // 156, + "he4_co56_to_n_cu59_derived", // 157, + "p_co57_to_n_ni57_derived", // 158, + "he4_ni57_to_n_zn60_derived", // 159, + "p_ni58_to_he4_co55_derived", // 160, + "he4_s32_to_p_cl35_derived_removed", // 161, + "ar36_to_he4_s32_derived_removed", // 162, + "ar36_to_p_cl35_derived_removed", // 163, + "he4_ar36_to_p_k39_derived_removed", // 164, + "ca40_to_he4_ar36_derived_removed", // 165, + "ca40_to_p_k39_derived_removed", // 166, + "he4_ca40_to_p_sc43_derived_removed", // 167, + "ti44_to_he4_ca40_derived_removed", // 168, + "ti44_to_p_sc43_derived_removed", // 169, + "cr48_to_he4_ti44_derived_removed", // 170, + "cr48_to_p_v47_derived_removed", // 171, + "p_v47_to_he4_ti44_derived_removed" // 172, + }; + +} + +#ifdef NSE_NET +namespace NSE_INDEX +{ + constexpr int h1_index = 1; + constexpr int n_index = 0; + constexpr int he4_index = 2; + + // Each row corresponds to the rate in NetworkRates enum + // First 3 row indices for reactants, followed by 3 product indices + // last index is the corresponding reverse rate index. + + extern AMREX_GPU_MANAGED amrex::Array2D rate_indices; +} +#endif + +#endif diff --git a/networks/He-C-Fe-group/actual_network_data.cpp b/networks/He-C-Fe-group/actual_network_data.cpp new file mode 100644 index 0000000000..ee6d37c71b --- /dev/null +++ b/networks/He-C-Fe-group/actual_network_data.cpp @@ -0,0 +1,245 @@ +#include + + +namespace network +{ + AMREX_GPU_MANAGED amrex::Array1D bion; + AMREX_GPU_MANAGED amrex::Array1D mion; +} + +#ifdef NSE_NET +namespace NSE_INDEX +{ + AMREX_GPU_MANAGED amrex::Array2D rate_indices { + -1, 1, 3, -1, -1, 4, 101, + -1, 2, 3, -1, -1, 6, 102, + -1, 2, 5, -1, -1, 7, 103, + -1, 2, 6, -1, -1, 8, 104, + -1, 2, 7, -1, -1, 10, 106, + -1, 2, 8, -1, -1, 12, 108, + -1, 1, 9, -1, -1, 10, 105, + -1, 1, 11, -1, -1, 12, 107, + -1, 2, 12, -1, -1, 14, 110, + -1, 1, 13, -1, -1, 14, 109, + -1, 2, 14, -1, -1, 16, 112, + -1, 1, 15, -1, -1, 16, 111, + -1, 2, 20, -1, -1, 23, 114, + -1, 1, 21, -1, -1, 23, 113, + -1, 2, 21, -1, -1, 28, 115, + -1, 2, 23, -1, -1, 31, 117, + -1, 1, 28, -1, -1, 31, 116, + -1, 2, 28, -1, -1, 34, 118, + -1, 2, 31, -1, -1, 35, 120, + -1, 1, 34, -1, -1, 35, 119, + -1, 3, 3, -1, 1, 11, -1, + -1, 3, 3, -1, 2, 8, -1, + -1, 2, 4, -1, 1, 6, 122, + -1, 3, 6, -1, 1, 13, -1, + -1, 3, 6, -1, 2, 12, -1, + -1, 6, 6, -1, 1, 15, -1, + -1, 6, 6, -1, 2, 14, -1, + -1, 2, 7, -1, 1, 9, 124, + -1, 1, 11, -1, 2, 8, 123, + -1, 1, 13, -1, 2, 12, 125, + -1, 1, 15, -1, 2, 14, 126, + -1, 2, 20, -1, 1, 21, 127, + -1, 2, 23, -1, 1, 28, 128, + -1, 1, 34, -1, 2, 31, 129, + 2, 2, 2, -1, -1, 3, 121, + -1, 3, 3, -1, -1, 12, -1, + -1, 6, 6, -1, -1, 16, -1, + -1, 3, 6, -1, -1, 14, -1, + -1, -1, 0, -1, -1, 1, -1, + -1, 1, 22, -1, -1, 27, 134, + -1, 0, 23, -1, -1, 24, 130, + -1, 0, 24, -1, -1, 25, 131, + -1, 2, 24, -1, -1, 32, 142, + -1, 0, 25, -1, -1, 26, 132, + -1, 1, 25, -1, -1, 28, 135, + -1, 2, 25, -1, -1, 33, 145, + -1, 0, 26, -1, -1, 27, 133, + -1, 1, 26, -1, -1, 29, 137, + -1, 1, 27, -1, -1, 30, 139, + -1, 0, 28, -1, -1, 29, 136, + -1, 0, 29, -1, -1, 30, 138, + -1, 1, 29, -1, -1, 32, 141, + -1, 1, 30, -1, -1, 33, 144, + -1, 0, 31, -1, -1, 32, 140, + -1, 0, 32, -1, -1, 33, 143, + -1, 1, 33, -1, -1, 34, 146, + -1, 2, 21, -1, 1, 25, 149, + -1, 2, 24, -1, 1, 29, 156, + -1, 0, 26, -1, 1, 22, 147, + -1, 0, 28, -1, 1, 26, 152, + -1, 2, 28, -1, 1, 33, 160, + -1, 0, 29, -1, 1, 27, 154, + -1, 1, 30, -1, 2, 25, 151, + -1, 0, 31, -1, 1, 29, 155, + -1, 0, 31, -1, 2, 24, 148, + -1, 0, 32, -1, 1, 30, 158, + -1, 0, 32, -1, 2, 25, 150, + -1, 0, 33, -1, 2, 26, 153, + -1, 0, 34, -1, 2, 29, 157, + -1, 0, 35, -1, 2, 32, 159, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, 28, -1, -1, 26, 87, + -1, -1, 29, -1, -1, 27, 89, + -1, -1, 29, -1, -1, 31, -1, + -1, -1, 30, -1, -1, 32, -1, + -1, -1, 26, -1, -1, 28, -1, + -1, -1, 26, -1, -1, 22, 90, + -1, -1, 27, -1, -1, 29, -1, + -1, -1, 22, -1, -1, 26, -1, + -1, -1, 31, -1, -1, 29, 85, + -1, -1, 32, -1, -1, 30, 86, + -1, 2, 16, -1, -1, 17, 94, + -1, -1, 17, -1, 2, 16, -1, + -1, 2, 17, -1, -1, 18, 96, + -1, -1, 18, -1, 2, 17, -1, + -1, 2, 18, -1, -1, 19, 98, + -1, -1, 19, -1, 2, 18, -1, + -1, 2, 19, -1, -1, 20, 100, + -1, -1, 20, -1, 2, 19, -1, + -1, -1, 4, -1, 1, 3, -1, + -1, -1, 6, -1, 2, 3, -1, + -1, -1, 7, -1, 2, 5, -1, + -1, -1, 8, -1, 2, 6, -1, + -1, -1, 10, -1, 1, 9, -1, + -1, -1, 10, -1, 2, 7, -1, + -1, -1, 12, -1, 1, 11, -1, + -1, -1, 12, -1, 2, 8, -1, + -1, -1, 14, -1, 1, 13, -1, + -1, -1, 14, -1, 2, 12, -1, + -1, -1, 16, -1, 1, 15, -1, + -1, -1, 16, -1, 2, 14, -1, + -1, -1, 23, -1, 1, 21, -1, + -1, -1, 23, -1, 2, 20, -1, + -1, -1, 28, -1, 2, 21, -1, + -1, -1, 31, -1, 1, 28, -1, + -1, -1, 31, -1, 2, 23, -1, + -1, -1, 34, -1, 2, 28, -1, + -1, -1, 35, -1, 1, 34, -1, + -1, -1, 35, -1, 2, 31, -1, + -1, -1, 3, 2, 2, 2, -1, + -1, 1, 6, -1, 2, 4, -1, + -1, 2, 8, -1, 1, 11, -1, + -1, 1, 9, -1, 2, 7, -1, + -1, 2, 12, -1, 1, 13, -1, + -1, 2, 14, -1, 1, 15, -1, + -1, 1, 21, -1, 2, 20, -1, + -1, 1, 28, -1, 2, 23, -1, + -1, 2, 31, -1, 1, 34, -1, + -1, -1, 24, -1, 0, 23, -1, + -1, -1, 25, -1, 0, 24, -1, + -1, -1, 26, -1, 0, 25, -1, + -1, -1, 27, -1, 0, 26, -1, + -1, -1, 27, -1, 1, 22, -1, + -1, -1, 28, -1, 1, 25, -1, + -1, -1, 29, -1, 0, 28, -1, + -1, -1, 29, -1, 1, 26, -1, + -1, -1, 30, -1, 0, 29, -1, + -1, -1, 30, -1, 1, 27, -1, + -1, -1, 32, -1, 0, 31, -1, + -1, -1, 32, -1, 1, 29, -1, + -1, -1, 32, -1, 2, 24, -1, + -1, -1, 33, -1, 0, 32, -1, + -1, -1, 33, -1, 1, 30, -1, + -1, -1, 33, -1, 2, 25, -1, + -1, -1, 34, -1, 1, 33, -1, + -1, 1, 22, -1, 0, 26, -1, + -1, 2, 24, -1, 0, 31, -1, + -1, 1, 25, -1, 2, 21, -1, + -1, 2, 25, -1, 0, 32, -1, + -1, 2, 25, -1, 1, 30, -1, + -1, 1, 26, -1, 0, 28, -1, + -1, 2, 26, -1, 0, 33, -1, + -1, 1, 27, -1, 0, 29, -1, + -1, 1, 29, -1, 0, 31, -1, + -1, 1, 29, -1, 2, 24, -1, + -1, 2, 29, -1, 0, 34, -1, + -1, 1, 30, -1, 0, 32, -1, + -1, 2, 32, -1, 0, 35, -1, + -1, 1, 33, -1, 2, 28, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1 + }; +} +#endif + +void actual_network_init() +{ + using namespace Species; + using namespace network; + + // binding energies per nucleon in MeV + amrex::Array1D ebind_per_nucleon; + + ebind_per_nucleon(N) = 0.0_rt; + ebind_per_nucleon(H1) = 0.0_rt; + ebind_per_nucleon(He4) = 7.073915_rt; + ebind_per_nucleon(C12) = 7.680144_rt; + ebind_per_nucleon(N13) = 7.238863_rt; + ebind_per_nucleon(N14) = 7.475613999999999_rt; + ebind_per_nucleon(O16) = 7.976206_rt; + ebind_per_nucleon(F18) = 7.631638_rt; + ebind_per_nucleon(Ne20) = 8.03224_rt; + ebind_per_nucleon(Ne21) = 7.971712999999999_rt; + ebind_per_nucleon(Na22) = 7.915667_rt; + ebind_per_nucleon(Na23) = 8.111493000000001_rt; + ebind_per_nucleon(Mg24) = 8.260709_rt; + ebind_per_nucleon(Al27) = 8.331553_rt; + ebind_per_nucleon(Si28) = 8.447744_rt; + ebind_per_nucleon(P31) = 8.481167_rt; + ebind_per_nucleon(S32) = 8.493129000000001_rt; + ebind_per_nucleon(Ar36) = 8.519909_rt; + ebind_per_nucleon(Ca40) = 8.551303_rt; + ebind_per_nucleon(Ti44) = 8.533520000000001_rt; + ebind_per_nucleon(Cr48) = 8.572269_rt; + ebind_per_nucleon(Mn51) = 8.633772_rt; + ebind_per_nucleon(Mn55) = 8.765022_rt; + ebind_per_nucleon(Fe52) = 8.609574_rt; + ebind_per_nucleon(Fe53) = 8.648799_rt; + ebind_per_nucleon(Fe54) = 8.736381999999999_rt; + ebind_per_nucleon(Fe55) = 8.746595_rt; + ebind_per_nucleon(Fe56) = 8.790353999999999_rt; + ebind_per_nucleon(Co55) = 8.669618_rt; + ebind_per_nucleon(Co56) = 8.694835999999999_rt; + ebind_per_nucleon(Co57) = 8.741882_rt; + ebind_per_nucleon(Ni56) = 8.642779_rt; + ebind_per_nucleon(Ni57) = 8.670933000000002_rt; + ebind_per_nucleon(Ni58) = 8.732059_rt; + ebind_per_nucleon(Cu59) = 8.642_rt; + ebind_per_nucleon(Zn60) = 8.58305_rt; + + // convert to binding energies per nucleus in MeV + for (int i = 1; i <= NumSpec; ++i) { + bion(i) = ebind_per_nucleon(i) * aion[i-1]; + } + + // Set the mass -- this will be in grams + for (int i = 1; i <= NumSpec; ++i) { + mion(i) = (aion[i-1] - zion[i-1]) * C::Legacy::m_n + zion[i-1] * (C::Legacy::m_p + C::Legacy::m_e) - bion(i) * C::Legacy::MeV2gr; + } + +} diff --git a/networks/He-C-Fe-group/actual_rhs.H b/networks/He-C-Fe-group/actual_rhs.H new file mode 100644 index 0000000000..3e0bbfb218 --- /dev/null +++ b/networks/He-C-Fe-group/actual_rhs.H @@ -0,0 +1,2809 @@ +#ifndef actual_rhs_H +#define actual_rhs_H + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace amrex; +using namespace ArrayUtil; + +using namespace Species; +using namespace Rates; + +using namespace rate_tables; + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void ener_gener_rate(T const& dydt, Real& enuc) +{ + + // Computes the instantaneous energy generation rate (from the nuclei) + + // This is basically e = m c**2 + + enuc = 0.0_rt; + + for (int n = 1; n <= NumSpec; ++n) { + enuc += dydt(n) * network::mion(n); + } + + enuc *= C::Legacy::enuc_conv2; +} + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void evaluate_rates(const burn_t& state, T& rate_eval) { + + + // create molar fractions + + Array1D Y; + for (int n = 1; n <= NumSpec; ++n) { + Y(n) = state.xn[n-1] * aion_inv[n-1]; + } + + [[maybe_unused]] Real rhoy = state.rho * state.y_e; + + // Calculate Reaclib rates + + plasma_state_t pstate{}; + fill_plasma_state(pstate, state.T, state.rho, Y); + + tf_t tfactors = evaluate_tfactors(state.T); + + fill_reaclib_rates(tfactors, rate_eval); + + + + // Evaluate screening factors + + Real ratraw, dratraw_dT; + Real scor, dscor_dt; + [[maybe_unused]] Real scor2, dscor2_dt; + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 6.0_rt, 12.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_c12_to_n13); + rate_eval.screened_rates(k_p_c12_to_n13) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_c12_to_n13); + rate_eval.dscreened_rates_dT(k_p_c12_to_n13) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 6.0_rt, 12.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_c12_to_o16); + rate_eval.screened_rates(k_he4_c12_to_o16) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_c12_to_o16); + rate_eval.dscreened_rates_dT(k_he4_c12_to_o16) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 7.0_rt, 14.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_n14_to_f18); + rate_eval.screened_rates(k_he4_n14_to_f18) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_n14_to_f18); + rate_eval.dscreened_rates_dT(k_he4_n14_to_f18) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 8.0_rt, 16.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_o16_to_ne20); + rate_eval.screened_rates(k_he4_o16_to_ne20) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_o16_to_ne20); + rate_eval.dscreened_rates_dT(k_he4_o16_to_ne20) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 9.0_rt, 18.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_f18_to_na22); + rate_eval.screened_rates(k_he4_f18_to_na22) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_f18_to_na22); + rate_eval.dscreened_rates_dT(k_he4_f18_to_na22) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_f18_to_p_ne21); + rate_eval.screened_rates(k_he4_f18_to_p_ne21) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_f18_to_p_ne21); + rate_eval.dscreened_rates_dT(k_he4_f18_to_p_ne21) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 10.0_rt, 20.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ne20_to_mg24); + rate_eval.screened_rates(k_he4_ne20_to_mg24) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ne20_to_mg24); + rate_eval.dscreened_rates_dT(k_he4_ne20_to_mg24) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_ne20_to_p_na23_derived); + rate_eval.screened_rates(k_he4_ne20_to_p_na23_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ne20_to_p_na23_derived); + rate_eval.dscreened_rates_dT(k_he4_ne20_to_p_na23_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 10.0_rt, 21.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_ne21_to_na22); + rate_eval.screened_rates(k_p_ne21_to_na22) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_ne21_to_na22); + rate_eval.dscreened_rates_dT(k_p_ne21_to_na22) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_ne21_to_he4_f18_derived); + rate_eval.screened_rates(k_p_ne21_to_he4_f18_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_ne21_to_he4_f18_derived); + rate_eval.dscreened_rates_dT(k_p_ne21_to_he4_f18_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 11.0_rt, 23.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_na23_to_mg24); + rate_eval.screened_rates(k_p_na23_to_mg24) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_na23_to_mg24); + rate_eval.dscreened_rates_dT(k_p_na23_to_mg24) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_na23_to_he4_ne20); + rate_eval.screened_rates(k_p_na23_to_he4_ne20) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_na23_to_he4_ne20); + rate_eval.dscreened_rates_dT(k_p_na23_to_he4_ne20) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 12.0_rt, 24.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_mg24_to_si28); + rate_eval.screened_rates(k_he4_mg24_to_si28) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_mg24_to_si28); + rate_eval.dscreened_rates_dT(k_he4_mg24_to_si28) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_mg24_to_p_al27_derived); + rate_eval.screened_rates(k_he4_mg24_to_p_al27_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_mg24_to_p_al27_derived); + rate_eval.dscreened_rates_dT(k_he4_mg24_to_p_al27_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 13.0_rt, 27.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_al27_to_si28); + rate_eval.screened_rates(k_p_al27_to_si28) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_al27_to_si28); + rate_eval.dscreened_rates_dT(k_p_al27_to_si28) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_al27_to_he4_mg24); + rate_eval.screened_rates(k_p_al27_to_he4_mg24) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_al27_to_he4_mg24); + rate_eval.dscreened_rates_dT(k_p_al27_to_he4_mg24) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 14.0_rt, 28.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_si28_to_s32); + rate_eval.screened_rates(k_he4_si28_to_s32) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_si28_to_s32); + rate_eval.dscreened_rates_dT(k_he4_si28_to_s32) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_si28_to_p_p31_derived); + rate_eval.screened_rates(k_he4_si28_to_p_p31_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_si28_to_p_p31_derived); + rate_eval.dscreened_rates_dT(k_he4_si28_to_p_p31_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 15.0_rt, 31.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_p31_to_s32); + rate_eval.screened_rates(k_p_p31_to_s32) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_p31_to_s32); + rate_eval.dscreened_rates_dT(k_p_p31_to_s32) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_p31_to_he4_si28); + rate_eval.screened_rates(k_p_p31_to_he4_si28) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_p31_to_he4_si28); + rate_eval.dscreened_rates_dT(k_p_p31_to_he4_si28) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 24.0_rt, 48.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_cr48_to_fe52); + rate_eval.screened_rates(k_he4_cr48_to_fe52) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_cr48_to_fe52); + rate_eval.dscreened_rates_dT(k_he4_cr48_to_fe52) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_cr48_to_p_mn51); + rate_eval.screened_rates(k_he4_cr48_to_p_mn51) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_cr48_to_p_mn51); + rate_eval.dscreened_rates_dT(k_he4_cr48_to_p_mn51) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 25.0_rt, 51.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_mn51_to_fe52); + rate_eval.screened_rates(k_p_mn51_to_fe52) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_mn51_to_fe52); + rate_eval.dscreened_rates_dT(k_p_mn51_to_fe52) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_mn51_to_he4_cr48_derived); + rate_eval.screened_rates(k_p_mn51_to_he4_cr48_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_mn51_to_he4_cr48_derived); + rate_eval.dscreened_rates_dT(k_p_mn51_to_he4_cr48_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 25.0_rt, 51.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_mn51_to_co55); + rate_eval.screened_rates(k_he4_mn51_to_co55) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_mn51_to_co55); + rate_eval.dscreened_rates_dT(k_he4_mn51_to_co55) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_mn51_to_p_fe54); + rate_eval.screened_rates(k_he4_mn51_to_p_fe54) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_mn51_to_p_fe54); + rate_eval.dscreened_rates_dT(k_he4_mn51_to_p_fe54) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 52.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_fe52_to_ni56); + rate_eval.screened_rates(k_he4_fe52_to_ni56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe52_to_ni56); + rate_eval.dscreened_rates_dT(k_he4_fe52_to_ni56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_fe52_to_p_co55); + rate_eval.screened_rates(k_he4_fe52_to_p_co55) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe52_to_p_co55); + rate_eval.dscreened_rates_dT(k_he4_fe52_to_p_co55) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 27.0_rt, 55.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_co55_to_ni56); + rate_eval.screened_rates(k_p_co55_to_ni56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co55_to_ni56); + rate_eval.dscreened_rates_dT(k_p_co55_to_ni56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_co55_to_he4_fe52_derived); + rate_eval.screened_rates(k_p_co55_to_he4_fe52_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co55_to_he4_fe52_derived); + rate_eval.dscreened_rates_dT(k_p_co55_to_he4_fe52_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 27.0_rt, 55.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_co55_to_cu59); + rate_eval.screened_rates(k_he4_co55_to_cu59) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_co55_to_cu59); + rate_eval.dscreened_rates_dT(k_he4_co55_to_cu59) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_co55_to_p_ni58); + rate_eval.screened_rates(k_he4_co55_to_p_ni58) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_co55_to_p_ni58); + rate_eval.dscreened_rates_dT(k_he4_co55_to_p_ni58) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 28.0_rt, 56.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ni56_to_zn60); + rate_eval.screened_rates(k_he4_ni56_to_zn60) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ni56_to_zn60); + rate_eval.dscreened_rates_dT(k_he4_ni56_to_zn60) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_ni56_to_p_cu59_derived); + rate_eval.screened_rates(k_he4_ni56_to_p_cu59_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ni56_to_p_cu59_derived); + rate_eval.dscreened_rates_dT(k_he4_ni56_to_p_cu59_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 29.0_rt, 59.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_cu59_to_zn60); + rate_eval.screened_rates(k_p_cu59_to_zn60) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_cu59_to_zn60); + rate_eval.dscreened_rates_dT(k_p_cu59_to_zn60) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_cu59_to_he4_ni56); + rate_eval.screened_rates(k_p_cu59_to_he4_ni56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_cu59_to_he4_ni56); + rate_eval.dscreened_rates_dT(k_p_cu59_to_he4_ni56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(6.0_rt, 12.0_rt, 6.0_rt, 12.0_rt); + + + static_assert(scn_fac.z1 == 6.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_c12_c12_to_p_na23); + rate_eval.screened_rates(k_c12_c12_to_p_na23) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_c12_to_p_na23); + rate_eval.dscreened_rates_dT(k_c12_c12_to_p_na23) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_c12_c12_to_he4_ne20); + rate_eval.screened_rates(k_c12_c12_to_he4_ne20) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_c12_to_he4_ne20); + rate_eval.dscreened_rates_dT(k_c12_c12_to_he4_ne20) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_c12_c12_to_mg24_modified); + rate_eval.screened_rates(k_c12_c12_to_mg24_modified) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_c12_to_mg24_modified); + rate_eval.dscreened_rates_dT(k_c12_c12_to_mg24_modified) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 7.0_rt, 13.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_n13_to_p_o16); + rate_eval.screened_rates(k_he4_n13_to_p_o16) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_n13_to_p_o16); + rate_eval.dscreened_rates_dT(k_he4_n13_to_p_o16) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(6.0_rt, 12.0_rt, 8.0_rt, 16.0_rt); + + + static_assert(scn_fac.z1 == 6.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_c12_o16_to_p_al27); + rate_eval.screened_rates(k_c12_o16_to_p_al27) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_o16_to_p_al27); + rate_eval.dscreened_rates_dT(k_c12_o16_to_p_al27) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_c12_o16_to_he4_mg24); + rate_eval.screened_rates(k_c12_o16_to_he4_mg24) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_o16_to_he4_mg24); + rate_eval.dscreened_rates_dT(k_c12_o16_to_he4_mg24) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_c12_o16_to_si28_modified); + rate_eval.screened_rates(k_c12_o16_to_si28_modified) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_o16_to_si28_modified); + rate_eval.dscreened_rates_dT(k_c12_o16_to_si28_modified) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(8.0_rt, 16.0_rt, 8.0_rt, 16.0_rt); + + + static_assert(scn_fac.z1 == 8.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_o16_o16_to_p_p31); + rate_eval.screened_rates(k_o16_o16_to_p_p31) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_o16_o16_to_p_p31); + rate_eval.dscreened_rates_dT(k_o16_o16_to_p_p31) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_o16_o16_to_he4_si28); + rate_eval.screened_rates(k_o16_o16_to_he4_si28) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_o16_o16_to_he4_si28); + rate_eval.dscreened_rates_dT(k_o16_o16_to_he4_si28) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_o16_o16_to_s32_modified); + rate_eval.screened_rates(k_o16_o16_to_s32_modified) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_o16_o16_to_s32_modified); + rate_eval.dscreened_rates_dT(k_o16_o16_to_s32_modified) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 2.0_rt, 4.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + + { + constexpr auto scn_fac2 = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 4.0_rt, 8.0_rt); + + + static_assert(scn_fac2.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac2, scor2, dscor2_dt); + + } + + + ratraw = rate_eval.screened_rates(k_he4_he4_he4_to_c12); + rate_eval.screened_rates(k_he4_he4_he4_to_c12) *= scor * scor2; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_he4_he4_to_c12); + rate_eval.dscreened_rates_dT(k_he4_he4_he4_to_c12) = ratraw * (scor * dscor2_dt + dscor_dt * scor2) + dratraw_dT * scor * scor2; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 25.0_rt, 55.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_mn55_to_fe56); + rate_eval.screened_rates(k_p_mn55_to_fe56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_mn55_to_fe56); + rate_eval.dscreened_rates_dT(k_p_mn55_to_fe56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_mn55_to_n_fe55_derived); + rate_eval.screened_rates(k_p_mn55_to_n_fe55_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_mn55_to_n_fe55_derived); + rate_eval.dscreened_rates_dT(k_p_mn55_to_n_fe55_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 53.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_fe53_to_ni57); + rate_eval.screened_rates(k_he4_fe53_to_ni57) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe53_to_ni57); + rate_eval.dscreened_rates_dT(k_he4_fe53_to_ni57) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_fe53_to_p_co56); + rate_eval.screened_rates(k_he4_fe53_to_p_co56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe53_to_p_co56); + rate_eval.dscreened_rates_dT(k_he4_fe53_to_p_co56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_fe53_to_n_ni56_derived); + rate_eval.screened_rates(k_he4_fe53_to_n_ni56_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe53_to_n_ni56_derived); + rate_eval.dscreened_rates_dT(k_he4_fe53_to_n_ni56_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 26.0_rt, 54.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_fe54_to_co55); + rate_eval.screened_rates(k_p_fe54_to_co55) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe54_to_co55); + rate_eval.dscreened_rates_dT(k_p_fe54_to_co55) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_fe54_to_he4_mn51_derived); + rate_eval.screened_rates(k_p_fe54_to_he4_mn51_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe54_to_he4_mn51_derived); + rate_eval.dscreened_rates_dT(k_p_fe54_to_he4_mn51_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 54.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_fe54_to_ni58); + rate_eval.screened_rates(k_he4_fe54_to_ni58) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe54_to_ni58); + rate_eval.dscreened_rates_dT(k_he4_fe54_to_ni58) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_fe54_to_n_ni57_derived); + rate_eval.screened_rates(k_he4_fe54_to_n_ni57_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe54_to_n_ni57_derived); + rate_eval.dscreened_rates_dT(k_he4_fe54_to_n_ni57_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_fe54_to_p_co57_derived); + rate_eval.screened_rates(k_he4_fe54_to_p_co57_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe54_to_p_co57_derived); + rate_eval.dscreened_rates_dT(k_he4_fe54_to_p_co57_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 26.0_rt, 55.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_fe55_to_co56); + rate_eval.screened_rates(k_p_fe55_to_co56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe55_to_co56); + rate_eval.dscreened_rates_dT(k_p_fe55_to_co56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_fe55_to_n_co55_derived); + rate_eval.screened_rates(k_p_fe55_to_n_co55_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe55_to_n_co55_derived); + rate_eval.dscreened_rates_dT(k_p_fe55_to_n_co55_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 26.0_rt, 56.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_fe56_to_co57); + rate_eval.screened_rates(k_p_fe56_to_co57) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe56_to_co57); + rate_eval.dscreened_rates_dT(k_p_fe56_to_co57) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_fe56_to_n_co56_derived); + rate_eval.screened_rates(k_p_fe56_to_n_co56_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe56_to_n_co56_derived); + rate_eval.dscreened_rates_dT(k_p_fe56_to_n_co56_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 27.0_rt, 56.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_co56_to_ni57); + rate_eval.screened_rates(k_p_co56_to_ni57) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co56_to_ni57); + rate_eval.dscreened_rates_dT(k_p_co56_to_ni57) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_co56_to_n_ni56_derived); + rate_eval.screened_rates(k_p_co56_to_n_ni56_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co56_to_n_ni56_derived); + rate_eval.dscreened_rates_dT(k_p_co56_to_n_ni56_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_co56_to_he4_fe53_derived); + rate_eval.screened_rates(k_p_co56_to_he4_fe53_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co56_to_he4_fe53_derived); + rate_eval.dscreened_rates_dT(k_p_co56_to_he4_fe53_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 27.0_rt, 57.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_co57_to_ni58); + rate_eval.screened_rates(k_p_co57_to_ni58) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co57_to_ni58); + rate_eval.dscreened_rates_dT(k_p_co57_to_ni58) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_co57_to_he4_fe54); + rate_eval.screened_rates(k_p_co57_to_he4_fe54) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co57_to_he4_fe54); + rate_eval.dscreened_rates_dT(k_p_co57_to_he4_fe54) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_co57_to_n_ni57_derived); + rate_eval.screened_rates(k_p_co57_to_n_ni57_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co57_to_n_ni57_derived); + rate_eval.dscreened_rates_dT(k_p_co57_to_n_ni57_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 28.0_rt, 58.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_ni58_to_cu59); + rate_eval.screened_rates(k_p_ni58_to_cu59) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_ni58_to_cu59); + rate_eval.dscreened_rates_dT(k_p_ni58_to_cu59) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_ni58_to_he4_co55_derived); + rate_eval.screened_rates(k_p_ni58_to_he4_co55_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_ni58_to_he4_co55_derived); + rate_eval.dscreened_rates_dT(k_p_ni58_to_he4_co55_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 8.0_rt, 16.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_o16_to_he4_n13_derived); + rate_eval.screened_rates(k_p_o16_to_he4_n13_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_o16_to_he4_n13_derived); + rate_eval.dscreened_rates_dT(k_p_o16_to_he4_n13_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 55.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_fe55_to_n_ni58_derived); + rate_eval.screened_rates(k_he4_fe55_to_n_ni58_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe55_to_n_ni58_derived); + rate_eval.dscreened_rates_dT(k_he4_fe55_to_n_ni58_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 27.0_rt, 56.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_co56_to_n_cu59_derived); + rate_eval.screened_rates(k_he4_co56_to_n_cu59_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_co56_to_n_cu59_derived); + rate_eval.dscreened_rates_dT(k_he4_co56_to_n_cu59_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 28.0_rt, 57.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ni57_to_n_zn60_derived); + rate_eval.screened_rates(k_he4_ni57_to_n_zn60_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ni57_to_n_zn60_derived); + rate_eval.dscreened_rates_dT(k_he4_ni57_to_n_zn60_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 16.0_rt, 32.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_s32_to_ar36_removed); + rate_eval.screened_rates(k_he4_s32_to_ar36_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_s32_to_ar36_removed); + rate_eval.dscreened_rates_dT(k_he4_s32_to_ar36_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_s32_to_p_cl35_derived_removed); + rate_eval.screened_rates(k_he4_s32_to_p_cl35_derived_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_s32_to_p_cl35_derived_removed); + rate_eval.dscreened_rates_dT(k_he4_s32_to_p_cl35_derived_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 17.0_rt, 35.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_cl35_to_ar36_removed); + rate_eval.screened_rates(k_p_cl35_to_ar36_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_cl35_to_ar36_removed); + rate_eval.dscreened_rates_dT(k_p_cl35_to_ar36_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_cl35_to_he4_s32_removed); + rate_eval.screened_rates(k_p_cl35_to_he4_s32_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_cl35_to_he4_s32_removed); + rate_eval.dscreened_rates_dT(k_p_cl35_to_he4_s32_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 18.0_rt, 36.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ar36_to_ca40_removed); + rate_eval.screened_rates(k_he4_ar36_to_ca40_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ar36_to_ca40_removed); + rate_eval.dscreened_rates_dT(k_he4_ar36_to_ca40_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_ar36_to_p_k39_derived_removed); + rate_eval.screened_rates(k_he4_ar36_to_p_k39_derived_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ar36_to_p_k39_derived_removed); + rate_eval.dscreened_rates_dT(k_he4_ar36_to_p_k39_derived_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 19.0_rt, 39.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_k39_to_ca40_removed); + rate_eval.screened_rates(k_p_k39_to_ca40_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_k39_to_ca40_removed); + rate_eval.dscreened_rates_dT(k_p_k39_to_ca40_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_k39_to_he4_ar36_removed); + rate_eval.screened_rates(k_p_k39_to_he4_ar36_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_k39_to_he4_ar36_removed); + rate_eval.dscreened_rates_dT(k_p_k39_to_he4_ar36_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 20.0_rt, 40.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ca40_to_ti44_removed); + rate_eval.screened_rates(k_he4_ca40_to_ti44_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ca40_to_ti44_removed); + rate_eval.dscreened_rates_dT(k_he4_ca40_to_ti44_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_ca40_to_p_sc43_derived_removed); + rate_eval.screened_rates(k_he4_ca40_to_p_sc43_derived_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ca40_to_p_sc43_derived_removed); + rate_eval.dscreened_rates_dT(k_he4_ca40_to_p_sc43_derived_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 21.0_rt, 43.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_sc43_to_ti44_removed); + rate_eval.screened_rates(k_p_sc43_to_ti44_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_sc43_to_ti44_removed); + rate_eval.dscreened_rates_dT(k_p_sc43_to_ti44_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_sc43_to_he4_ca40_removed); + rate_eval.screened_rates(k_p_sc43_to_he4_ca40_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_sc43_to_he4_ca40_removed); + rate_eval.dscreened_rates_dT(k_p_sc43_to_he4_ca40_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 22.0_rt, 44.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ti44_to_cr48_removed); + rate_eval.screened_rates(k_he4_ti44_to_cr48_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ti44_to_cr48_removed); + rate_eval.dscreened_rates_dT(k_he4_ti44_to_cr48_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_ti44_to_p_v47_removed); + rate_eval.screened_rates(k_he4_ti44_to_p_v47_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ti44_to_p_v47_removed); + rate_eval.dscreened_rates_dT(k_he4_ti44_to_p_v47_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 23.0_rt, 47.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_v47_to_cr48_removed); + rate_eval.screened_rates(k_p_v47_to_cr48_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_v47_to_cr48_removed); + rate_eval.dscreened_rates_dT(k_p_v47_to_cr48_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_v47_to_he4_ti44_derived_removed); + rate_eval.screened_rates(k_p_v47_to_he4_ti44_derived_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_v47_to_he4_ti44_derived_removed); + rate_eval.dscreened_rates_dT(k_p_v47_to_he4_ti44_derived_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + // Fill approximate rates + + fill_approx_rates(tfactors, rate_eval); + + // Calculate tabular rates + + [[maybe_unused]] Real rate, drate_dt, edot_nu, edot_gamma; + + tabular_evaluate(j_co55_fe55_meta, j_co55_fe55_rhoy, j_co55_fe55_temp, j_co55_fe55_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_co55_to_fe55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co55_to_fe55) = drate_dt; + } + rate_eval.add_energy_rate(k_co55_to_fe55) = edot_nu + edot_gamma; + + tabular_evaluate(j_co56_fe56_meta, j_co56_fe56_rhoy, j_co56_fe56_temp, j_co56_fe56_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_co56_to_fe56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co56_to_fe56) = drate_dt; + } + rate_eval.add_energy_rate(k_co56_to_fe56) = edot_nu + edot_gamma; + + tabular_evaluate(j_co56_ni56_meta, j_co56_ni56_rhoy, j_co56_ni56_temp, j_co56_ni56_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_co56_to_ni56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co56_to_ni56) = drate_dt; + } + rate_eval.add_energy_rate(k_co56_to_ni56) = edot_nu + edot_gamma; + + tabular_evaluate(j_co57_ni57_meta, j_co57_ni57_rhoy, j_co57_ni57_temp, j_co57_ni57_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_co57_to_ni57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co57_to_ni57) = drate_dt; + } + rate_eval.add_energy_rate(k_co57_to_ni57) = edot_nu + edot_gamma; + + tabular_evaluate(j_fe55_co55_meta, j_fe55_co55_rhoy, j_fe55_co55_temp, j_fe55_co55_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_fe55_to_co55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe55_to_co55) = drate_dt; + } + rate_eval.add_energy_rate(k_fe55_to_co55) = edot_nu + edot_gamma; + + tabular_evaluate(j_fe55_mn55_meta, j_fe55_mn55_rhoy, j_fe55_mn55_temp, j_fe55_mn55_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_fe55_to_mn55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe55_to_mn55) = drate_dt; + } + rate_eval.add_energy_rate(k_fe55_to_mn55) = edot_nu + edot_gamma; + + tabular_evaluate(j_fe56_co56_meta, j_fe56_co56_rhoy, j_fe56_co56_temp, j_fe56_co56_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_fe56_to_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe56_to_co56) = drate_dt; + } + rate_eval.add_energy_rate(k_fe56_to_co56) = edot_nu + edot_gamma; + + tabular_evaluate(j_mn55_fe55_meta, j_mn55_fe55_rhoy, j_mn55_fe55_temp, j_mn55_fe55_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_mn55_to_fe55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_mn55_to_fe55) = drate_dt; + } + rate_eval.add_energy_rate(k_mn55_to_fe55) = edot_nu + edot_gamma; + + tabular_evaluate(j_ni56_co56_meta, j_ni56_co56_rhoy, j_ni56_co56_temp, j_ni56_co56_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_ni56_to_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni56_to_co56) = drate_dt; + } + rate_eval.add_energy_rate(k_ni56_to_co56) = edot_nu + edot_gamma; + + tabular_evaluate(j_ni57_co57_meta, j_ni57_co57_rhoy, j_ni57_co57_temp, j_ni57_co57_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_ni57_to_co57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni57_to_co57) = drate_dt; + } + rate_eval.add_energy_rate(k_ni57_to_co57) = edot_nu + edot_gamma; + + +} + +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rhs_nuc(const burn_t& state, + Array1D& ydot_nuc, + const Array1D& Y, + const Array1D& screened_rates) { + + using namespace Rates; + + ydot_nuc(N) = + -screened_rates(k_n_to_p_weak_wc12)*Y(N) + + (-screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*Y(N)*state.rho + screened_rates(k_fe53_to_n_fe52_derived)*Y(Fe53)) + + (-screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*Y(N)*state.rho + screened_rates(k_fe54_to_n_fe53_derived)*Y(Fe54)) + + (-screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*Y(N)*state.rho + screened_rates(k_fe55_to_n_fe54_derived)*Y(Fe55)) + + (-screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*Y(N)*state.rho + screened_rates(k_fe56_to_n_fe55_derived)*Y(Fe56)) + + (-screened_rates(k_n_co55_to_co56)*Y(Co55)*Y(N)*state.rho + screened_rates(k_co56_to_n_co55_derived)*Y(Co56)) + + (-screened_rates(k_n_co56_to_co57)*Y(Co56)*Y(N)*state.rho + screened_rates(k_co57_to_n_co56_derived)*Y(Co57)) + + (-screened_rates(k_n_ni56_to_ni57)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_ni57_to_n_ni56_derived)*Y(Ni57)) + + (-screened_rates(k_n_ni57_to_ni58)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_ni58_to_n_ni57_derived)*Y(Ni58)) + + (-screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*Y(N)*state.rho + screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*Y(H1)*state.rho) + + (-screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*Y(N)*state.rho + screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (-screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*Y(N)*state.rho + screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni56_to_p_co56)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*Y(He4)*state.rho) + + (-screened_rates(k_n_ni57_to_p_co57)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (-screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*Y(Ni58)*state.rho + screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*Y(He4)*state.rho) + + (-screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*Y(N)*state.rho + screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*Y(He4)*state.rho) + + (-screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*Y(Zn60)*state.rho + screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*Y(Ni57)*state.rho); + + ydot_nuc(H1) = + (-screened_rates(k_p_c12_to_n13)*Y(C12)*Y(H1)*state.rho + screened_rates(k_n13_to_p_c12_derived)*Y(N13)) + + (-screened_rates(k_p_ne21_to_na22)*Y(Ne21)*Y(H1)*state.rho + screened_rates(k_na22_to_p_ne21_derived)*Y(Na22)) + + (-screened_rates(k_p_na23_to_mg24)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_mg24_to_p_na23_derived)*Y(Mg24)) + + (-screened_rates(k_p_al27_to_si28)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_si28_to_p_al27_derived)*Y(Si28)) + + (-screened_rates(k_p_p31_to_s32)*Y(P31)*Y(H1)*state.rho + screened_rates(k_s32_to_p_p31_derived)*Y(S32)) + + (-screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*Y(H1)*state.rho + screened_rates(k_fe52_to_p_mn51_derived)*Y(Fe52)) + + (-screened_rates(k_p_co55_to_ni56)*Y(Co55)*Y(H1)*state.rho + screened_rates(k_ni56_to_p_co55_derived)*Y(Ni56)) + + (-screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_zn60_to_p_cu59_derived)*Y(Zn60)) + + 0.5*screened_rates(k_c12_c12_to_p_na23)*std::pow(Y(C12), 2)*state.rho + + (screened_rates(k_he4_n13_to_p_o16)*Y(He4)*Y(N13)*state.rho + -screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*Y(H1)*state.rho) + + screened_rates(k_c12_o16_to_p_al27)*Y(C12)*Y(O16)*state.rho + + 0.5*screened_rates(k_o16_o16_to_p_p31)*std::pow(Y(O16), 2)*state.rho + + (screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*Y(He4)*state.rho + -screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*Y(H1)*state.rho) + + (-screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*Y(Ne20)*state.rho) + + (-screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*Y(Mg24)*state.rho) + + (-screened_rates(k_p_p31_to_he4_si28)*Y(P31)*Y(H1)*state.rho + screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*Y(Si28)*state.rho) + + (screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*Y(He4)*state.rho + -screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*Y(H1)*state.rho) + + (screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*Y(He4)*state.rho + -screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (-screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*Y(Ni56)*state.rho) + + screened_rates(k_n_to_p_weak_wc12)*Y(N) + + (-screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*Y(H1)*state.rho + screened_rates(k_fe56_to_p_mn55_derived)*Y(Fe56)) + + (-screened_rates(k_p_fe54_to_co55)*Y(Fe54)*Y(H1)*state.rho + screened_rates(k_co55_to_p_fe54_derived)*Y(Co55)) + + (-screened_rates(k_p_fe55_to_co56)*Y(Fe55)*Y(H1)*state.rho + screened_rates(k_co56_to_p_fe55_derived)*Y(Co56)) + + (-screened_rates(k_p_fe56_to_co57)*Y(Fe56)*Y(H1)*state.rho + screened_rates(k_co57_to_p_fe56_derived)*Y(Co57)) + + (-screened_rates(k_p_co56_to_ni57)*Y(Co56)*Y(H1)*state.rho + screened_rates(k_ni57_to_p_co56_derived)*Y(Ni57)) + + (-screened_rates(k_p_co57_to_ni58)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_ni58_to_p_co57_derived)*Y(Ni58)) + + (-screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*Y(H1)*state.rho + screened_rates(k_cu59_to_p_ni58_derived)*Y(Cu59)) + + (screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*Y(Mn51)*state.rho + -screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*Y(H1)*state.rho) + + (screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*Y(He4)*state.rho + -screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*Y(N)*state.rho + -screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*Y(H1)*state.rho) + + (screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*Y(N)*state.rho + -screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*Y(He4)*state.rho + -screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*Y(N)*state.rho + -screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (-screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_ni56_to_p_co56)*Y(N)*Y(Ni56)*state.rho + -screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_ni57_to_p_co57)*Y(N)*Y(Ni57)*state.rho + -screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*Y(H1)*state.rho); + + ydot_nuc(He4) = + (-screened_rates(k_he4_c12_to_o16)*Y(C12)*Y(He4)*state.rho + screened_rates(k_o16_to_he4_c12_derived)*Y(O16)) + + (-screened_rates(k_he4_n14_to_f18)*Y(He4)*Y(N14)*state.rho + screened_rates(k_f18_to_he4_n14_derived)*Y(F18)) + + (-screened_rates(k_he4_o16_to_ne20)*Y(He4)*Y(O16)*state.rho + screened_rates(k_ne20_to_he4_o16_derived)*Y(Ne20)) + + (-screened_rates(k_he4_f18_to_na22)*Y(F18)*Y(He4)*state.rho + screened_rates(k_na22_to_he4_f18_derived)*Y(Na22)) + + (-screened_rates(k_he4_ne20_to_mg24)*Y(He4)*Y(Ne20)*state.rho + screened_rates(k_mg24_to_he4_ne20_derived)*Y(Mg24)) + + (-screened_rates(k_he4_mg24_to_si28)*Y(He4)*Y(Mg24)*state.rho + screened_rates(k_si28_to_he4_mg24_derived)*Y(Si28)) + + (-screened_rates(k_he4_si28_to_s32)*Y(He4)*Y(Si28)*state.rho + screened_rates(k_s32_to_he4_si28_derived)*Y(S32)) + + (-screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_fe52_to_he4_cr48_derived)*Y(Fe52)) + + (-screened_rates(k_he4_mn51_to_co55)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_co55_to_he4_mn51_derived)*Y(Co55)) + + (-screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_ni56_to_he4_fe52_derived)*Y(Ni56)) + + (-screened_rates(k_he4_co55_to_cu59)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_cu59_to_he4_co55_derived)*Y(Cu59)) + + (-screened_rates(k_he4_ni56_to_zn60)*Y(He4)*Y(Ni56)*state.rho + screened_rates(k_zn60_to_he4_ni56_derived)*Y(Zn60)) + + 0.5*screened_rates(k_c12_c12_to_he4_ne20)*std::pow(Y(C12), 2)*state.rho + + (-screened_rates(k_he4_n13_to_p_o16)*Y(He4)*Y(N13)*state.rho + screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*Y(H1)*state.rho) + + screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*Y(O16)*state.rho + + 0.5*screened_rates(k_o16_o16_to_he4_si28)*std::pow(Y(O16), 2)*state.rho + + (-screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*Y(He4)*state.rho + screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*Y(H1)*state.rho) + + (screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*Y(H1)*state.rho + -screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*Y(Ne20)*state.rho) + + (screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*Y(H1)*state.rho + -screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*Y(Mg24)*state.rho) + + (screened_rates(k_p_p31_to_he4_si28)*Y(P31)*Y(H1)*state.rho + -screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*Y(Si28)*state.rho) + + (-screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*Y(H1)*state.rho) + + (-screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*Y(H1)*state.rho + -screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*Y(Ni56)*state.rho) + + (-0.5*screened_rates(k_he4_he4_he4_to_c12)*std::pow(Y(He4), 3)*std::pow(state.rho, 2) + 3.0*screened_rates(k_c12_to_he4_he4_he4_derived)*Y(C12)) + + (-screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_ni57_to_he4_fe53_derived)*Y(Ni57)) + + (-screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*Y(He4)*state.rho + screened_rates(k_ni58_to_he4_fe54_derived)*Y(Ni58)) + + (-screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*Y(H1)*state.rho) + + (-screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (-screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*Y(H1)*state.rho + -screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*Y(Ni56)*state.rho + -screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*Y(He4)*state.rho) + + (screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*Y(Ni57)*state.rho + -screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*Y(Ni58)*state.rho + -screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*Y(He4)*state.rho) + + (screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*Y(N)*state.rho + -screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*Y(He4)*state.rho) + + (screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*Y(Zn60)*state.rho + -screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*Y(Ni57)*state.rho) + + (-screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*Y(S32)*state.rho + screened_rates(k_ar36_to_s32_he4_approx)*Y(Ar36)) + + (-screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*Y(He4)*state.rho + screened_rates(k_ca40_to_ar36_he4_approx)*Y(Ca40)) + + (-screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*Y(He4)*state.rho + screened_rates(k_ti44_to_ca40_he4_approx)*Y(Ti44)) + + (-screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*Y(Ti44)*state.rho + screened_rates(k_cr48_to_ti44_he4_approx)*Y(Cr48)); + + ydot_nuc(C12) = + (-screened_rates(k_p_c12_to_n13)*Y(C12)*Y(H1)*state.rho + screened_rates(k_n13_to_p_c12_derived)*Y(N13)) + + (-screened_rates(k_he4_c12_to_o16)*Y(C12)*Y(He4)*state.rho + screened_rates(k_o16_to_he4_c12_derived)*Y(O16)) + + -screened_rates(k_c12_c12_to_p_na23)*std::pow(Y(C12), 2)*state.rho + + -screened_rates(k_c12_c12_to_he4_ne20)*std::pow(Y(C12), 2)*state.rho + + -screened_rates(k_c12_o16_to_p_al27)*Y(C12)*Y(O16)*state.rho + + -screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*Y(O16)*state.rho + + (0.16666666666666667*screened_rates(k_he4_he4_he4_to_c12)*std::pow(Y(He4), 3)*std::pow(state.rho, 2) + -screened_rates(k_c12_to_he4_he4_he4_derived)*Y(C12)) + + -screened_rates(k_c12_c12_to_mg24_modified)*std::pow(Y(C12), 2)*state.rho + + -screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*Y(O16)*state.rho; + + ydot_nuc(N13) = + (screened_rates(k_p_c12_to_n13)*Y(C12)*Y(H1)*state.rho + -screened_rates(k_n13_to_p_c12_derived)*Y(N13)) + + (-screened_rates(k_he4_n13_to_p_o16)*Y(He4)*Y(N13)*state.rho + screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*Y(H1)*state.rho); + + ydot_nuc(N14) = + (-screened_rates(k_he4_n14_to_f18)*Y(He4)*Y(N14)*state.rho + screened_rates(k_f18_to_he4_n14_derived)*Y(F18)); + + ydot_nuc(O16) = + (screened_rates(k_he4_c12_to_o16)*Y(C12)*Y(He4)*state.rho + -screened_rates(k_o16_to_he4_c12_derived)*Y(O16)) + + (-screened_rates(k_he4_o16_to_ne20)*Y(He4)*Y(O16)*state.rho + screened_rates(k_ne20_to_he4_o16_derived)*Y(Ne20)) + + (screened_rates(k_he4_n13_to_p_o16)*Y(He4)*Y(N13)*state.rho + -screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*Y(H1)*state.rho) + + -screened_rates(k_c12_o16_to_p_al27)*Y(C12)*Y(O16)*state.rho + + -screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*Y(O16)*state.rho + + -screened_rates(k_o16_o16_to_p_p31)*std::pow(Y(O16), 2)*state.rho + + -screened_rates(k_o16_o16_to_he4_si28)*std::pow(Y(O16), 2)*state.rho + + -screened_rates(k_o16_o16_to_s32_modified)*std::pow(Y(O16), 2)*state.rho + + -screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*Y(O16)*state.rho; + + ydot_nuc(F18) = + (screened_rates(k_he4_n14_to_f18)*Y(He4)*Y(N14)*state.rho + -screened_rates(k_f18_to_he4_n14_derived)*Y(F18)) + + (-screened_rates(k_he4_f18_to_na22)*Y(F18)*Y(He4)*state.rho + screened_rates(k_na22_to_he4_f18_derived)*Y(Na22)) + + (-screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*Y(He4)*state.rho + screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*Y(H1)*state.rho); + + ydot_nuc(Ne20) = + (screened_rates(k_he4_o16_to_ne20)*Y(He4)*Y(O16)*state.rho + -screened_rates(k_ne20_to_he4_o16_derived)*Y(Ne20)) + + (-screened_rates(k_he4_ne20_to_mg24)*Y(He4)*Y(Ne20)*state.rho + screened_rates(k_mg24_to_he4_ne20_derived)*Y(Mg24)) + + 0.5*screened_rates(k_c12_c12_to_he4_ne20)*std::pow(Y(C12), 2)*state.rho + + (screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*Y(H1)*state.rho + -screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*Y(Ne20)*state.rho); + + ydot_nuc(Ne21) = + (-screened_rates(k_p_ne21_to_na22)*Y(Ne21)*Y(H1)*state.rho + screened_rates(k_na22_to_p_ne21_derived)*Y(Na22)) + + (screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*Y(He4)*state.rho + -screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*Y(H1)*state.rho); + + ydot_nuc(Na22) = + (screened_rates(k_he4_f18_to_na22)*Y(F18)*Y(He4)*state.rho + -screened_rates(k_na22_to_he4_f18_derived)*Y(Na22)) + + (screened_rates(k_p_ne21_to_na22)*Y(Ne21)*Y(H1)*state.rho + -screened_rates(k_na22_to_p_ne21_derived)*Y(Na22)); + + ydot_nuc(Na23) = + (-screened_rates(k_p_na23_to_mg24)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_mg24_to_p_na23_derived)*Y(Mg24)) + + 0.5*screened_rates(k_c12_c12_to_p_na23)*std::pow(Y(C12), 2)*state.rho + + (-screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*Y(Ne20)*state.rho); + + ydot_nuc(Mg24) = + (screened_rates(k_he4_ne20_to_mg24)*Y(He4)*Y(Ne20)*state.rho + -screened_rates(k_mg24_to_he4_ne20_derived)*Y(Mg24)) + + (screened_rates(k_p_na23_to_mg24)*Y(Na23)*Y(H1)*state.rho + -screened_rates(k_mg24_to_p_na23_derived)*Y(Mg24)) + + (-screened_rates(k_he4_mg24_to_si28)*Y(He4)*Y(Mg24)*state.rho + screened_rates(k_si28_to_he4_mg24_derived)*Y(Si28)) + + screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*Y(O16)*state.rho + + (screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*Y(H1)*state.rho + -screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*Y(Mg24)*state.rho) + + 0.5*screened_rates(k_c12_c12_to_mg24_modified)*std::pow(Y(C12), 2)*state.rho; + + ydot_nuc(Al27) = + (-screened_rates(k_p_al27_to_si28)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_si28_to_p_al27_derived)*Y(Si28)) + + screened_rates(k_c12_o16_to_p_al27)*Y(C12)*Y(O16)*state.rho + + (-screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*Y(Mg24)*state.rho); + + ydot_nuc(Si28) = + (screened_rates(k_he4_mg24_to_si28)*Y(He4)*Y(Mg24)*state.rho + -screened_rates(k_si28_to_he4_mg24_derived)*Y(Si28)) + + (screened_rates(k_p_al27_to_si28)*Y(Al27)*Y(H1)*state.rho + -screened_rates(k_si28_to_p_al27_derived)*Y(Si28)) + + (-screened_rates(k_he4_si28_to_s32)*Y(He4)*Y(Si28)*state.rho + screened_rates(k_s32_to_he4_si28_derived)*Y(S32)) + + 0.5*screened_rates(k_o16_o16_to_he4_si28)*std::pow(Y(O16), 2)*state.rho + + (screened_rates(k_p_p31_to_he4_si28)*Y(P31)*Y(H1)*state.rho + -screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*Y(Si28)*state.rho) + + screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*Y(O16)*state.rho; + + ydot_nuc(P31) = + (-screened_rates(k_p_p31_to_s32)*Y(P31)*Y(H1)*state.rho + screened_rates(k_s32_to_p_p31_derived)*Y(S32)) + + 0.5*screened_rates(k_o16_o16_to_p_p31)*std::pow(Y(O16), 2)*state.rho + + (-screened_rates(k_p_p31_to_he4_si28)*Y(P31)*Y(H1)*state.rho + screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*Y(Si28)*state.rho); + + ydot_nuc(S32) = + (screened_rates(k_he4_si28_to_s32)*Y(He4)*Y(Si28)*state.rho + -screened_rates(k_s32_to_he4_si28_derived)*Y(S32)) + + (screened_rates(k_p_p31_to_s32)*Y(P31)*Y(H1)*state.rho + -screened_rates(k_s32_to_p_p31_derived)*Y(S32)) + + 0.5*screened_rates(k_o16_o16_to_s32_modified)*std::pow(Y(O16), 2)*state.rho + + (-screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*Y(S32)*state.rho + screened_rates(k_ar36_to_s32_he4_approx)*Y(Ar36)); + + ydot_nuc(Ar36) = + (screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*Y(S32)*state.rho + -screened_rates(k_ar36_to_s32_he4_approx)*Y(Ar36)) + + (-screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*Y(He4)*state.rho + screened_rates(k_ca40_to_ar36_he4_approx)*Y(Ca40)); + + ydot_nuc(Ca40) = + (screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*Y(He4)*state.rho + -screened_rates(k_ca40_to_ar36_he4_approx)*Y(Ca40)) + + (-screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*Y(He4)*state.rho + screened_rates(k_ti44_to_ca40_he4_approx)*Y(Ti44)); + + ydot_nuc(Ti44) = + (screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*Y(He4)*state.rho + -screened_rates(k_ti44_to_ca40_he4_approx)*Y(Ti44)) + + (-screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*Y(Ti44)*state.rho + screened_rates(k_cr48_to_ti44_he4_approx)*Y(Cr48)); + + ydot_nuc(Cr48) = + (-screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_fe52_to_he4_cr48_derived)*Y(Fe52)) + + (-screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*Y(H1)*state.rho) + + (screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*Y(Ti44)*state.rho + -screened_rates(k_cr48_to_ti44_he4_approx)*Y(Cr48)); + + ydot_nuc(Mn51) = + (-screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*Y(H1)*state.rho + screened_rates(k_fe52_to_p_mn51_derived)*Y(Fe52)) + + (-screened_rates(k_he4_mn51_to_co55)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_co55_to_he4_mn51_derived)*Y(Co55)) + + (screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*Y(He4)*state.rho + -screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*Y(H1)*state.rho) + + (-screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*Y(H1)*state.rho); + + ydot_nuc(Mn55) = + (-screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*Y(H1)*state.rho + screened_rates(k_fe56_to_p_mn55_derived)*Y(Fe56)) + + (screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*Y(N)*state.rho + -screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*Y(H1)*state.rho) + + (screened_rates(k_fe55_to_mn55)*Y(Fe55) + -screened_rates(k_mn55_to_fe55)*Y(Mn55)); + + ydot_nuc(Fe52) = + (screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*Y(He4)*state.rho + -screened_rates(k_fe52_to_he4_cr48_derived)*Y(Fe52)) + + (screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*Y(H1)*state.rho + -screened_rates(k_fe52_to_p_mn51_derived)*Y(Fe52)) + + (-screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_ni56_to_he4_fe52_derived)*Y(Ni56)) + + (-screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (-screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*Y(N)*state.rho + screened_rates(k_fe53_to_n_fe52_derived)*Y(Fe53)); + + ydot_nuc(Fe53) = + (screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*Y(N)*state.rho + -screened_rates(k_fe53_to_n_fe52_derived)*Y(Fe53)) + + (-screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*Y(N)*state.rho + screened_rates(k_fe54_to_n_fe53_derived)*Y(Fe54)) + + (-screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_ni57_to_he4_fe53_derived)*Y(Ni57)) + + (-screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*Y(Ni56)*state.rho + -screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*Y(He4)*state.rho); + + ydot_nuc(Fe54) = + (screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*Y(N)*state.rho + -screened_rates(k_fe54_to_n_fe53_derived)*Y(Fe54)) + + (-screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*Y(N)*state.rho + screened_rates(k_fe55_to_n_fe54_derived)*Y(Fe55)) + + (-screened_rates(k_p_fe54_to_co55)*Y(Fe54)*Y(H1)*state.rho + screened_rates(k_co55_to_p_fe54_derived)*Y(Co55)) + + (-screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*Y(He4)*state.rho + screened_rates(k_ni58_to_he4_fe54_derived)*Y(Ni58)) + + (screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*Y(Mn51)*state.rho + -screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*Y(H1)*state.rho) + + (screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*Y(H1)*state.rho + -screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*Y(Ni57)*state.rho + -screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*Y(He4)*state.rho); + + ydot_nuc(Fe55) = + (screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*Y(N)*state.rho + -screened_rates(k_fe55_to_n_fe54_derived)*Y(Fe55)) + + (-screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*Y(N)*state.rho + screened_rates(k_fe56_to_n_fe55_derived)*Y(Fe56)) + + (-screened_rates(k_p_fe55_to_co56)*Y(Fe55)*Y(H1)*state.rho + screened_rates(k_co56_to_p_fe55_derived)*Y(Co56)) + + (-screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*Y(N)*state.rho + screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*Y(H1)*state.rho) + + (screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*Y(N)*state.rho + -screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*Y(Ni58)*state.rho + -screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*Y(He4)*state.rho) + + (screened_rates(k_co55_to_fe55)*Y(Co55) + -screened_rates(k_fe55_to_co55)*Y(Fe55)) + + (-screened_rates(k_fe55_to_mn55)*Y(Fe55) + screened_rates(k_mn55_to_fe55)*Y(Mn55)); + + ydot_nuc(Fe56) = + (screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*Y(H1)*state.rho + -screened_rates(k_fe56_to_p_mn55_derived)*Y(Fe56)) + + (screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*Y(N)*state.rho + -screened_rates(k_fe56_to_n_fe55_derived)*Y(Fe56)) + + (-screened_rates(k_p_fe56_to_co57)*Y(Fe56)*Y(H1)*state.rho + screened_rates(k_co57_to_p_fe56_derived)*Y(Co57)) + + (screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*Y(N)*state.rho + -screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (screened_rates(k_co56_to_fe56)*Y(Co56) + -screened_rates(k_fe56_to_co56)*Y(Fe56)); + + ydot_nuc(Co55) = + (screened_rates(k_he4_mn51_to_co55)*Y(He4)*Y(Mn51)*state.rho + -screened_rates(k_co55_to_he4_mn51_derived)*Y(Co55)) + + (-screened_rates(k_p_co55_to_ni56)*Y(Co55)*Y(H1)*state.rho + screened_rates(k_ni56_to_p_co55_derived)*Y(Ni56)) + + (-screened_rates(k_he4_co55_to_cu59)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_cu59_to_he4_co55_derived)*Y(Cu59)) + + (screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*Y(He4)*state.rho + -screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (screened_rates(k_p_fe54_to_co55)*Y(Fe54)*Y(H1)*state.rho + -screened_rates(k_co55_to_p_fe54_derived)*Y(Co55)) + + (-screened_rates(k_n_co55_to_co56)*Y(Co55)*Y(N)*state.rho + screened_rates(k_co56_to_n_co55_derived)*Y(Co56)) + + (-screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*Y(N)*state.rho + screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (-screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (-screened_rates(k_co55_to_fe55)*Y(Co55) + screened_rates(k_fe55_to_co55)*Y(Fe55)); + + ydot_nuc(Co56) = + (screened_rates(k_p_fe55_to_co56)*Y(Fe55)*Y(H1)*state.rho + -screened_rates(k_co56_to_p_fe55_derived)*Y(Co56)) + + (screened_rates(k_n_co55_to_co56)*Y(Co55)*Y(N)*state.rho + -screened_rates(k_co56_to_n_co55_derived)*Y(Co56)) + + (-screened_rates(k_n_co56_to_co57)*Y(Co56)*Y(N)*state.rho + screened_rates(k_co57_to_n_co56_derived)*Y(Co57)) + + (-screened_rates(k_p_co56_to_ni57)*Y(Co56)*Y(H1)*state.rho + screened_rates(k_ni57_to_p_co56_derived)*Y(Ni57)) + + (screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*Y(He4)*state.rho + -screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (-screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*Y(N)*state.rho + screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (screened_rates(k_n_ni56_to_p_co56)*Y(N)*Y(Ni56)*state.rho + -screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*Y(N)*state.rho + -screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*Y(He4)*state.rho) + + (-screened_rates(k_co56_to_fe56)*Y(Co56) + screened_rates(k_fe56_to_co56)*Y(Fe56)) + + (screened_rates(k_ni56_to_co56)*Y(Ni56) + -screened_rates(k_co56_to_ni56)*Y(Co56)); + + ydot_nuc(Co57) = + (screened_rates(k_p_fe56_to_co57)*Y(Fe56)*Y(H1)*state.rho + -screened_rates(k_co57_to_p_fe56_derived)*Y(Co57)) + + (screened_rates(k_n_co56_to_co57)*Y(Co56)*Y(N)*state.rho + -screened_rates(k_co57_to_n_co56_derived)*Y(Co57)) + + (-screened_rates(k_p_co57_to_ni58)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_ni58_to_p_co57_derived)*Y(Ni58)) + + (-screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_ni57_to_p_co57)*Y(N)*Y(Ni57)*state.rho + -screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*Y(H1)*state.rho) + + (screened_rates(k_ni57_to_co57)*Y(Ni57) + -screened_rates(k_co57_to_ni57)*Y(Co57)); + + ydot_nuc(Ni56) = + (screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*Y(He4)*state.rho + -screened_rates(k_ni56_to_he4_fe52_derived)*Y(Ni56)) + + (screened_rates(k_p_co55_to_ni56)*Y(Co55)*Y(H1)*state.rho + -screened_rates(k_ni56_to_p_co55_derived)*Y(Ni56)) + + (-screened_rates(k_he4_ni56_to_zn60)*Y(He4)*Y(Ni56)*state.rho + screened_rates(k_zn60_to_he4_ni56_derived)*Y(Zn60)) + + (screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*Y(H1)*state.rho + -screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*Y(Ni56)*state.rho) + + (-screened_rates(k_n_ni56_to_ni57)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_ni57_to_n_ni56_derived)*Y(Ni57)) + + (-screened_rates(k_n_ni56_to_p_co56)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*Y(He4)*state.rho) + + (-screened_rates(k_ni56_to_co56)*Y(Ni56) + screened_rates(k_co56_to_ni56)*Y(Co56)); + + ydot_nuc(Ni57) = + (screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*Y(He4)*state.rho + -screened_rates(k_ni57_to_he4_fe53_derived)*Y(Ni57)) + + (screened_rates(k_p_co56_to_ni57)*Y(Co56)*Y(H1)*state.rho + -screened_rates(k_ni57_to_p_co56_derived)*Y(Ni57)) + + (screened_rates(k_n_ni56_to_ni57)*Y(N)*Y(Ni56)*state.rho + -screened_rates(k_ni57_to_n_ni56_derived)*Y(Ni57)) + + (-screened_rates(k_n_ni57_to_ni58)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_ni58_to_n_ni57_derived)*Y(Ni58)) + + (-screened_rates(k_n_ni57_to_p_co57)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*Y(Zn60)*state.rho + -screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*Y(Ni57)*state.rho) + + (-screened_rates(k_ni57_to_co57)*Y(Ni57) + screened_rates(k_co57_to_ni57)*Y(Co57)); + + ydot_nuc(Ni58) = + (screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*Y(He4)*state.rho + -screened_rates(k_ni58_to_he4_fe54_derived)*Y(Ni58)) + + (screened_rates(k_p_co57_to_ni58)*Y(Co57)*Y(H1)*state.rho + -screened_rates(k_ni58_to_p_co57_derived)*Y(Ni58)) + + (screened_rates(k_n_ni57_to_ni58)*Y(N)*Y(Ni57)*state.rho + -screened_rates(k_ni58_to_n_ni57_derived)*Y(Ni58)) + + (-screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*Y(H1)*state.rho + screened_rates(k_cu59_to_p_ni58_derived)*Y(Cu59)) + + (screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*Y(He4)*state.rho + -screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*Y(Ni58)*state.rho + screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*Y(He4)*state.rho); + + ydot_nuc(Cu59) = + (screened_rates(k_he4_co55_to_cu59)*Y(Co55)*Y(He4)*state.rho + -screened_rates(k_cu59_to_he4_co55_derived)*Y(Cu59)) + + (-screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_zn60_to_p_cu59_derived)*Y(Zn60)) + + (-screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*Y(Ni56)*state.rho) + + (screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*Y(H1)*state.rho + -screened_rates(k_cu59_to_p_ni58_derived)*Y(Cu59)) + + (-screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*Y(N)*state.rho + screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*Y(He4)*state.rho); + + ydot_nuc(Zn60) = + (screened_rates(k_he4_ni56_to_zn60)*Y(He4)*Y(Ni56)*state.rho + -screened_rates(k_zn60_to_he4_ni56_derived)*Y(Zn60)) + + (screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*Y(H1)*state.rho + -screened_rates(k_zn60_to_p_cu59_derived)*Y(Zn60)) + + (-screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*Y(Zn60)*state.rho + screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*Y(Ni57)*state.rho); + +} + + +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void actual_rhs (burn_t& state, Array1D& ydot) +{ + for (int i = 1; i <= neqs; ++i) { + ydot(i) = 0.0_rt; + } + + + // Set molar abundances + Array1D Y; + for (int i = 1; i <= NumSpec; ++i) { + Y(i) = state.xn[i-1] * aion_inv[i-1]; + } + + // build the rates + + rate_t rate_eval; + + constexpr int do_T_derivatives = 0; + evaluate_rates(state, rate_eval); + + rhs_nuc(state, ydot, Y, rate_eval.screened_rates); + + // ion binding energy contributions + + Real enuc; + ener_gener_rate(ydot, enuc); + + // include reaction neutrino losses (non-thermal) and gamma heating + enuc += C::Legacy::n_A * Y(Co55) * rate_eval.add_energy_rate(k_co55_to_fe55); + enuc += C::Legacy::n_A * Y(Co56) * rate_eval.add_energy_rate(k_co56_to_fe56); + enuc += C::Legacy::n_A * Y(Co56) * rate_eval.add_energy_rate(k_co56_to_ni56); + enuc += C::Legacy::n_A * Y(Co57) * rate_eval.add_energy_rate(k_co57_to_ni57); + enuc += C::Legacy::n_A * Y(Fe55) * rate_eval.add_energy_rate(k_fe55_to_co55); + enuc += C::Legacy::n_A * Y(Fe55) * rate_eval.add_energy_rate(k_fe55_to_mn55); + enuc += C::Legacy::n_A * Y(Fe56) * rate_eval.add_energy_rate(k_fe56_to_co56); + enuc += C::Legacy::n_A * Y(Mn55) * rate_eval.add_energy_rate(k_mn55_to_fe55); + enuc += C::Legacy::n_A * Y(Ni56) * rate_eval.add_energy_rate(k_ni56_to_co56); + enuc += C::Legacy::n_A * Y(Ni57) * rate_eval.add_energy_rate(k_ni57_to_co57); + + // Get the thermal neutrino losses + + Real sneut, dsneutdt, dsneutdd, dsnuda, dsnudz; + constexpr int do_derivatives{0}; + sneut5(state.T, state.rho, state.abar, state.zbar, sneut, dsneutdt, dsneutdd, dsnuda, dsnudz); + + // Append the energy equation (this is erg/g/s) + + ydot(net_ienuc) = enuc - sneut; + +} + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void jac_nuc(const burn_t& state, + MatrixType& jac, + const Array1D& Y, + const Array1D& screened_rates) +{ + + Real scratch; + + scratch = -screened_rates(k_n_co55_to_co56)*Y(Co55)*state.rho - screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*state.rho - screened_rates(k_n_co56_to_co57)*Y(Co56)*state.rho - screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*state.rho - screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*state.rho - screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*state.rho - screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*state.rho - screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*state.rho - screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*state.rho - screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*state.rho - screened_rates(k_n_ni56_to_he4_fe53)*Y(Ni56)*state.rho - screened_rates(k_n_ni56_to_ni57)*Y(Ni56)*state.rho - screened_rates(k_n_ni56_to_p_co56)*Y(Ni56)*state.rho - screened_rates(k_n_ni57_to_he4_fe54)*Y(Ni57)*state.rho - screened_rates(k_n_ni57_to_ni58)*Y(Ni57)*state.rho - screened_rates(k_n_ni57_to_p_co57)*Y(Ni57)*state.rho - screened_rates(k_n_ni58_to_he4_fe55)*Y(Ni58)*state.rho - screened_rates(k_n_to_p_weak_wc12) - screened_rates(k_n_zn60_to_he4_ni57)*Y(Zn60)*state.rho; + jac.set(N, N, scratch); + + scratch = screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*state.rho + screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*state.rho + screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*state.rho + screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*state.rho + screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*state.rho; + jac.set(N, H1, scratch); + + scratch = screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*state.rho + screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*state.rho + screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*state.rho + screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*state.rho + screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(Ni57)*state.rho; + jac.set(N, He4, scratch); + + scratch = screened_rates(k_p_mn55_to_n_fe55_derived)*Y(H1)*state.rho; + jac.set(N, Mn55, scratch); + + scratch = -screened_rates(k_n_fe52_to_fe53)*Y(N)*state.rho; + jac.set(N, Fe52, scratch); + + scratch = screened_rates(k_fe53_to_n_fe52_derived) + screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(He4)*state.rho - screened_rates(k_n_fe53_to_fe54)*Y(N)*state.rho; + jac.set(N, Fe53, scratch); + + scratch = screened_rates(k_fe54_to_n_fe53_derived) + screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(He4)*state.rho - screened_rates(k_n_fe54_to_fe55)*Y(N)*state.rho; + jac.set(N, Fe54, scratch); + + scratch = screened_rates(k_fe55_to_n_fe54_derived) + screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(He4)*state.rho - screened_rates(k_n_fe55_to_fe56)*Y(N)*state.rho - screened_rates(k_n_fe55_to_p_mn55)*Y(N)*state.rho + screened_rates(k_p_fe55_to_n_co55_derived)*Y(H1)*state.rho; + jac.set(N, Fe55, scratch); + + scratch = screened_rates(k_fe56_to_n_fe55_derived) + screened_rates(k_p_fe56_to_n_co56_derived)*Y(H1)*state.rho; + jac.set(N, Fe56, scratch); + + scratch = -screened_rates(k_n_co55_to_co56)*Y(N)*state.rho - screened_rates(k_n_co55_to_p_fe55)*Y(N)*state.rho; + jac.set(N, Co55, scratch); + + scratch = screened_rates(k_co56_to_n_co55_derived) + screened_rates(k_he4_co56_to_n_cu59_derived)*Y(He4)*state.rho - screened_rates(k_n_co56_to_co57)*Y(N)*state.rho - screened_rates(k_n_co56_to_p_fe56)*Y(N)*state.rho + screened_rates(k_p_co56_to_n_ni56_derived)*Y(H1)*state.rho; + jac.set(N, Co56, scratch); + + scratch = screened_rates(k_co57_to_n_co56_derived) + screened_rates(k_p_co57_to_n_ni57_derived)*Y(H1)*state.rho; + jac.set(N, Co57, scratch); + + scratch = -screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*state.rho - screened_rates(k_n_ni56_to_ni57)*Y(N)*state.rho - screened_rates(k_n_ni56_to_p_co56)*Y(N)*state.rho; + jac.set(N, Ni56, scratch); + + scratch = screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*state.rho - screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*state.rho - screened_rates(k_n_ni57_to_ni58)*Y(N)*state.rho - screened_rates(k_n_ni57_to_p_co57)*Y(N)*state.rho + screened_rates(k_ni57_to_n_ni56_derived); + jac.set(N, Ni57, scratch); + + scratch = -screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*state.rho + screened_rates(k_ni58_to_n_ni57_derived); + jac.set(N, Ni58, scratch); + + scratch = -screened_rates(k_n_cu59_to_he4_co56)*Y(N)*state.rho; + jac.set(N, Cu59, scratch); + + scratch = -screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*state.rho; + jac.set(N, Zn60, scratch); + + scratch = screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*state.rho + screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*state.rho + screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*state.rho + screened_rates(k_n_ni56_to_p_co56)*Y(Ni56)*state.rho + screened_rates(k_n_ni57_to_p_co57)*Y(Ni57)*state.rho + screened_rates(k_n_to_p_weak_wc12); + jac.set(H1, N, scratch); + + scratch = -screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*state.rho - screened_rates(k_p_al27_to_si28)*Y(Al27)*state.rho - screened_rates(k_p_c12_to_n13)*Y(C12)*state.rho - screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*state.rho - screened_rates(k_p_co55_to_ni56)*Y(Co55)*state.rho - screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*state.rho - screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*state.rho - screened_rates(k_p_co56_to_ni57)*Y(Co56)*state.rho - screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*state.rho - screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*state.rho - screened_rates(k_p_co57_to_ni58)*Y(Co57)*state.rho - screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*state.rho - screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*state.rho - screened_rates(k_p_fe54_to_co55)*Y(Fe54)*state.rho - screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*state.rho - screened_rates(k_p_fe55_to_co56)*Y(Fe55)*state.rho - screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*state.rho - screened_rates(k_p_fe56_to_co57)*Y(Fe56)*state.rho - screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*state.rho - screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*state.rho - screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*state.rho - screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*state.rho - screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*state.rho - screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*state.rho - screened_rates(k_p_na23_to_mg24)*Y(Na23)*state.rho - screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*state.rho - screened_rates(k_p_ne21_to_na22)*Y(Ne21)*state.rho - screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*state.rho - screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*state.rho - screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*state.rho - screened_rates(k_p_p31_to_he4_si28)*Y(P31)*state.rho - screened_rates(k_p_p31_to_s32)*Y(P31)*state.rho; + jac.set(H1, H1, scratch); + + scratch = screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*state.rho + screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*state.rho + screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*state.rho + screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*state.rho + screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*state.rho + screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*state.rho + screened_rates(k_he4_mg24_to_p_al27_derived)*Y(Mg24)*state.rho + screened_rates(k_he4_mn51_to_p_fe54)*Y(Mn51)*state.rho + screened_rates(k_he4_n13_to_p_o16)*Y(N13)*state.rho + screened_rates(k_he4_ne20_to_p_na23_derived)*Y(Ne20)*state.rho + screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(Ni56)*state.rho + screened_rates(k_he4_si28_to_p_p31_derived)*Y(Si28)*state.rho; + jac.set(H1, He4, scratch); + + scratch = 1.0*screened_rates(k_c12_c12_to_p_na23)*Y(C12)*state.rho + screened_rates(k_c12_o16_to_p_al27)*Y(O16)*state.rho - screened_rates(k_p_c12_to_n13)*Y(H1)*state.rho; + jac.set(H1, C12, scratch); + + scratch = screened_rates(k_he4_n13_to_p_o16)*Y(He4)*state.rho + screened_rates(k_n13_to_p_c12_derived); + jac.set(H1, N13, scratch); + + scratch = screened_rates(k_c12_o16_to_p_al27)*Y(C12)*state.rho + 1.0*screened_rates(k_o16_o16_to_p_p31)*Y(O16)*state.rho - screened_rates(k_p_o16_to_he4_n13_derived)*Y(H1)*state.rho; + jac.set(H1, O16, scratch); + + scratch = screened_rates(k_he4_f18_to_p_ne21)*Y(He4)*state.rho; + jac.set(H1, F18, scratch); + + scratch = screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*state.rho; + jac.set(H1, Ne20, scratch); + + scratch = -screened_rates(k_p_ne21_to_he4_f18_derived)*Y(H1)*state.rho - screened_rates(k_p_ne21_to_na22)*Y(H1)*state.rho; + jac.set(H1, Ne21, scratch); + + scratch = screened_rates(k_na22_to_p_ne21_derived); + jac.set(H1, Na22, scratch); + + scratch = -screened_rates(k_p_na23_to_he4_ne20)*Y(H1)*state.rho - screened_rates(k_p_na23_to_mg24)*Y(H1)*state.rho; + jac.set(H1, Na23, scratch); + + scratch = screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*state.rho + screened_rates(k_mg24_to_p_na23_derived); + jac.set(H1, Mg24, scratch); + + scratch = -screened_rates(k_p_al27_to_he4_mg24)*Y(H1)*state.rho - screened_rates(k_p_al27_to_si28)*Y(H1)*state.rho; + jac.set(H1, Al27, scratch); + + scratch = screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*state.rho + screened_rates(k_si28_to_p_al27_derived); + jac.set(H1, Si28, scratch); + + scratch = -screened_rates(k_p_p31_to_he4_si28)*Y(H1)*state.rho - screened_rates(k_p_p31_to_s32)*Y(H1)*state.rho; + jac.set(H1, P31, scratch); + + scratch = screened_rates(k_s32_to_p_p31_derived); + jac.set(H1, S32, scratch); + + scratch = screened_rates(k_he4_cr48_to_p_mn51)*Y(He4)*state.rho; + jac.set(H1, Cr48, scratch); + + scratch = screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*state.rho - screened_rates(k_p_mn51_to_fe52)*Y(H1)*state.rho - screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(H1)*state.rho; + jac.set(H1, Mn51, scratch); + + scratch = -screened_rates(k_p_mn55_to_fe56)*Y(H1)*state.rho - screened_rates(k_p_mn55_to_n_fe55_derived)*Y(H1)*state.rho; + jac.set(H1, Mn55, scratch); + + scratch = screened_rates(k_fe52_to_p_mn51_derived) + screened_rates(k_he4_fe52_to_p_co55)*Y(He4)*state.rho; + jac.set(H1, Fe52, scratch); + + scratch = screened_rates(k_he4_fe53_to_p_co56)*Y(He4)*state.rho; + jac.set(H1, Fe53, scratch); + + scratch = screened_rates(k_he4_fe54_to_p_co57_derived)*Y(He4)*state.rho - screened_rates(k_p_fe54_to_co55)*Y(H1)*state.rho - screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(H1)*state.rho; + jac.set(H1, Fe54, scratch); + + scratch = screened_rates(k_n_fe55_to_p_mn55)*Y(N)*state.rho - screened_rates(k_p_fe55_to_co56)*Y(H1)*state.rho - screened_rates(k_p_fe55_to_n_co55_derived)*Y(H1)*state.rho; + jac.set(H1, Fe55, scratch); + + scratch = screened_rates(k_fe56_to_p_mn55_derived) - screened_rates(k_p_fe56_to_co57)*Y(H1)*state.rho - screened_rates(k_p_fe56_to_n_co56_derived)*Y(H1)*state.rho; + jac.set(H1, Fe56, scratch); + + scratch = screened_rates(k_co55_to_p_fe54_derived) + screened_rates(k_he4_co55_to_p_ni58)*Y(He4)*state.rho + screened_rates(k_n_co55_to_p_fe55)*Y(N)*state.rho - screened_rates(k_p_co55_to_he4_fe52_derived)*Y(H1)*state.rho - screened_rates(k_p_co55_to_ni56)*Y(H1)*state.rho; + jac.set(H1, Co55, scratch); + + scratch = screened_rates(k_co56_to_p_fe55_derived) + screened_rates(k_n_co56_to_p_fe56)*Y(N)*state.rho - screened_rates(k_p_co56_to_he4_fe53_derived)*Y(H1)*state.rho - screened_rates(k_p_co56_to_n_ni56_derived)*Y(H1)*state.rho - screened_rates(k_p_co56_to_ni57)*Y(H1)*state.rho; + jac.set(H1, Co56, scratch); + + scratch = screened_rates(k_co57_to_p_fe56_derived) - screened_rates(k_p_co57_to_he4_fe54)*Y(H1)*state.rho - screened_rates(k_p_co57_to_n_ni57_derived)*Y(H1)*state.rho - screened_rates(k_p_co57_to_ni58)*Y(H1)*state.rho; + jac.set(H1, Co57, scratch); + + scratch = screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*state.rho + screened_rates(k_n_ni56_to_p_co56)*Y(N)*state.rho + screened_rates(k_ni56_to_p_co55_derived); + jac.set(H1, Ni56, scratch); + + scratch = screened_rates(k_n_ni57_to_p_co57)*Y(N)*state.rho + screened_rates(k_ni57_to_p_co56_derived); + jac.set(H1, Ni57, scratch); + + scratch = screened_rates(k_ni58_to_p_co57_derived) - screened_rates(k_p_ni58_to_cu59)*Y(H1)*state.rho - screened_rates(k_p_ni58_to_he4_co55_derived)*Y(H1)*state.rho; + jac.set(H1, Ni58, scratch); + + scratch = screened_rates(k_cu59_to_p_ni58_derived) - screened_rates(k_p_cu59_to_he4_ni56)*Y(H1)*state.rho - screened_rates(k_p_cu59_to_zn60)*Y(H1)*state.rho; + jac.set(H1, Cu59, scratch); + + scratch = screened_rates(k_zn60_to_p_cu59_derived); + jac.set(H1, Zn60, scratch); + + scratch = screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*state.rho + screened_rates(k_n_ni56_to_he4_fe53)*Y(Ni56)*state.rho + screened_rates(k_n_ni57_to_he4_fe54)*Y(Ni57)*state.rho + screened_rates(k_n_ni58_to_he4_fe55)*Y(Ni58)*state.rho + screened_rates(k_n_zn60_to_he4_ni57)*Y(Zn60)*state.rho; + jac.set(He4, N, scratch); + + scratch = screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*state.rho + screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*state.rho + screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*state.rho + screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*state.rho + screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*state.rho + screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*state.rho + screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*state.rho + screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*state.rho + screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*state.rho + screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*state.rho + screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*state.rho + screened_rates(k_p_p31_to_he4_si28)*Y(P31)*state.rho; + jac.set(He4, H1, scratch); + + scratch = -screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*state.rho - screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*state.rho - screened_rates(k_he4_c12_to_o16)*Y(C12)*state.rho - screened_rates(k_he4_co55_to_cu59)*Y(Co55)*state.rho - screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*state.rho - screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*state.rho - screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*state.rho - screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*state.rho - screened_rates(k_he4_f18_to_na22)*Y(F18)*state.rho - screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*state.rho - screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*state.rho - screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*state.rho - screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*state.rho - screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*state.rho - screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*state.rho - screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*state.rho - screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*state.rho - screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*state.rho - screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*state.rho - 1.5*screened_rates(k_he4_he4_he4_to_c12)*std::pow(Y(He4), 2)*std::pow(state.rho, 2) - screened_rates(k_he4_mg24_to_p_al27_derived)*Y(Mg24)*state.rho - screened_rates(k_he4_mg24_to_si28)*Y(Mg24)*state.rho - screened_rates(k_he4_mn51_to_co55)*Y(Mn51)*state.rho - screened_rates(k_he4_mn51_to_p_fe54)*Y(Mn51)*state.rho - screened_rates(k_he4_n13_to_p_o16)*Y(N13)*state.rho - screened_rates(k_he4_n14_to_f18)*Y(N14)*state.rho - screened_rates(k_he4_ne20_to_mg24)*Y(Ne20)*state.rho - screened_rates(k_he4_ne20_to_p_na23_derived)*Y(Ne20)*state.rho - screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(Ni56)*state.rho - screened_rates(k_he4_ni56_to_zn60)*Y(Ni56)*state.rho - screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(Ni57)*state.rho - screened_rates(k_he4_o16_to_ne20)*Y(O16)*state.rho - screened_rates(k_he4_si28_to_p_p31_derived)*Y(Si28)*state.rho - screened_rates(k_he4_si28_to_s32)*Y(Si28)*state.rho - screened_rates(k_s32_he4_to_ar36_approx)*Y(S32)*state.rho - screened_rates(k_ti44_he4_to_cr48_approx)*Y(Ti44)*state.rho; + jac.set(He4, He4, scratch); + + scratch = 1.0*screened_rates(k_c12_c12_to_he4_ne20)*Y(C12)*state.rho + screened_rates(k_c12_o16_to_he4_mg24)*Y(O16)*state.rho + 3.0*screened_rates(k_c12_to_he4_he4_he4_derived) - screened_rates(k_he4_c12_to_o16)*Y(He4)*state.rho; + jac.set(He4, C12, scratch); + + scratch = -screened_rates(k_he4_n13_to_p_o16)*Y(He4)*state.rho; + jac.set(He4, N13, scratch); + + scratch = -screened_rates(k_he4_n14_to_f18)*Y(He4)*state.rho; + jac.set(He4, N14, scratch); + + scratch = screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*state.rho - screened_rates(k_he4_o16_to_ne20)*Y(He4)*state.rho + 1.0*screened_rates(k_o16_o16_to_he4_si28)*Y(O16)*state.rho + screened_rates(k_o16_to_he4_c12_derived) + screened_rates(k_p_o16_to_he4_n13_derived)*Y(H1)*state.rho; + jac.set(He4, O16, scratch); + + scratch = screened_rates(k_f18_to_he4_n14_derived) - screened_rates(k_he4_f18_to_na22)*Y(He4)*state.rho - screened_rates(k_he4_f18_to_p_ne21)*Y(He4)*state.rho; + jac.set(He4, F18, scratch); + + scratch = -screened_rates(k_he4_ne20_to_mg24)*Y(He4)*state.rho - screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*state.rho + screened_rates(k_ne20_to_he4_o16_derived); + jac.set(He4, Ne20, scratch); + + scratch = screened_rates(k_p_ne21_to_he4_f18_derived)*Y(H1)*state.rho; + jac.set(He4, Ne21, scratch); + + scratch = screened_rates(k_na22_to_he4_f18_derived); + jac.set(He4, Na22, scratch); + + scratch = screened_rates(k_p_na23_to_he4_ne20)*Y(H1)*state.rho; + jac.set(He4, Na23, scratch); + + scratch = -screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*state.rho - screened_rates(k_he4_mg24_to_si28)*Y(He4)*state.rho + screened_rates(k_mg24_to_he4_ne20_derived); + jac.set(He4, Mg24, scratch); + + scratch = screened_rates(k_p_al27_to_he4_mg24)*Y(H1)*state.rho; + jac.set(He4, Al27, scratch); + + scratch = -screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*state.rho - screened_rates(k_he4_si28_to_s32)*Y(He4)*state.rho + screened_rates(k_si28_to_he4_mg24_derived); + jac.set(He4, Si28, scratch); + + scratch = screened_rates(k_p_p31_to_he4_si28)*Y(H1)*state.rho; + jac.set(He4, P31, scratch); + + scratch = -screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*state.rho + screened_rates(k_s32_to_he4_si28_derived); + jac.set(He4, S32, scratch); + + scratch = -screened_rates(k_ar36_he4_to_ca40_approx)*Y(He4)*state.rho + screened_rates(k_ar36_to_s32_he4_approx); + jac.set(He4, Ar36, scratch); + + scratch = -screened_rates(k_ca40_he4_to_ti44_approx)*Y(He4)*state.rho + screened_rates(k_ca40_to_ar36_he4_approx); + jac.set(He4, Ca40, scratch); + + scratch = -screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*state.rho + screened_rates(k_ti44_to_ca40_he4_approx); + jac.set(He4, Ti44, scratch); + + scratch = screened_rates(k_cr48_to_ti44_he4_approx) - screened_rates(k_he4_cr48_to_fe52)*Y(He4)*state.rho - screened_rates(k_he4_cr48_to_p_mn51)*Y(He4)*state.rho; + jac.set(He4, Cr48, scratch); + + scratch = -screened_rates(k_he4_mn51_to_co55)*Y(He4)*state.rho - screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*state.rho + screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(H1)*state.rho; + jac.set(He4, Mn51, scratch); + + scratch = screened_rates(k_fe52_to_he4_cr48_derived) - screened_rates(k_he4_fe52_to_ni56)*Y(He4)*state.rho - screened_rates(k_he4_fe52_to_p_co55)*Y(He4)*state.rho; + jac.set(He4, Fe52, scratch); + + scratch = -screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(He4)*state.rho - screened_rates(k_he4_fe53_to_ni57)*Y(He4)*state.rho - screened_rates(k_he4_fe53_to_p_co56)*Y(He4)*state.rho; + jac.set(He4, Fe53, scratch); + + scratch = -screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(He4)*state.rho - screened_rates(k_he4_fe54_to_ni58)*Y(He4)*state.rho - screened_rates(k_he4_fe54_to_p_co57_derived)*Y(He4)*state.rho + screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(H1)*state.rho; + jac.set(He4, Fe54, scratch); + + scratch = -screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(He4)*state.rho; + jac.set(He4, Fe55, scratch); + + scratch = screened_rates(k_co55_to_he4_mn51_derived) - screened_rates(k_he4_co55_to_cu59)*Y(He4)*state.rho - screened_rates(k_he4_co55_to_p_ni58)*Y(He4)*state.rho + screened_rates(k_p_co55_to_he4_fe52_derived)*Y(H1)*state.rho; + jac.set(He4, Co55, scratch); + + scratch = -screened_rates(k_he4_co56_to_n_cu59_derived)*Y(He4)*state.rho + screened_rates(k_p_co56_to_he4_fe53_derived)*Y(H1)*state.rho; + jac.set(He4, Co56, scratch); + + scratch = screened_rates(k_p_co57_to_he4_fe54)*Y(H1)*state.rho; + jac.set(He4, Co57, scratch); + + scratch = -screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*state.rho - screened_rates(k_he4_ni56_to_zn60)*Y(He4)*state.rho + screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*state.rho + screened_rates(k_ni56_to_he4_fe52_derived); + jac.set(He4, Ni56, scratch); + + scratch = -screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*state.rho + screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*state.rho + screened_rates(k_ni57_to_he4_fe53_derived); + jac.set(He4, Ni57, scratch); + + scratch = screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*state.rho + screened_rates(k_ni58_to_he4_fe54_derived) + screened_rates(k_p_ni58_to_he4_co55_derived)*Y(H1)*state.rho; + jac.set(He4, Ni58, scratch); + + scratch = screened_rates(k_cu59_to_he4_co55_derived) + screened_rates(k_n_cu59_to_he4_co56)*Y(N)*state.rho + screened_rates(k_p_cu59_to_he4_ni56)*Y(H1)*state.rho; + jac.set(He4, Cu59, scratch); + + scratch = screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*state.rho + screened_rates(k_zn60_to_he4_ni56_derived); + jac.set(He4, Zn60, scratch); + + scratch = -screened_rates(k_p_c12_to_n13)*Y(C12)*state.rho; + jac.set(C12, H1, scratch); + + scratch = -screened_rates(k_he4_c12_to_o16)*Y(C12)*state.rho + 0.5*screened_rates(k_he4_he4_he4_to_c12)*std::pow(Y(He4), 2)*std::pow(state.rho, 2); + jac.set(C12, He4, scratch); + + scratch = -2.0*screened_rates(k_c12_c12_to_he4_ne20)*Y(C12)*state.rho - 2.0*screened_rates(k_c12_c12_to_mg24_modified)*Y(C12)*state.rho - 2.0*screened_rates(k_c12_c12_to_p_na23)*Y(C12)*state.rho - screened_rates(k_c12_o16_to_he4_mg24)*Y(O16)*state.rho - screened_rates(k_c12_o16_to_p_al27)*Y(O16)*state.rho - screened_rates(k_c12_o16_to_si28_modified)*Y(O16)*state.rho - screened_rates(k_c12_to_he4_he4_he4_derived) - screened_rates(k_he4_c12_to_o16)*Y(He4)*state.rho - screened_rates(k_p_c12_to_n13)*Y(H1)*state.rho; + jac.set(C12, C12, scratch); + + scratch = screened_rates(k_n13_to_p_c12_derived); + jac.set(C12, N13, scratch); + + scratch = -screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*state.rho - screened_rates(k_c12_o16_to_p_al27)*Y(C12)*state.rho - screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*state.rho + screened_rates(k_o16_to_he4_c12_derived); + jac.set(C12, O16, scratch); + + scratch = screened_rates(k_p_c12_to_n13)*Y(C12)*state.rho + screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*state.rho; + jac.set(N13, H1, scratch); + + scratch = -screened_rates(k_he4_n13_to_p_o16)*Y(N13)*state.rho; + jac.set(N13, He4, scratch); + + scratch = screened_rates(k_p_c12_to_n13)*Y(H1)*state.rho; + jac.set(N13, C12, scratch); + + scratch = -screened_rates(k_he4_n13_to_p_o16)*Y(He4)*state.rho - screened_rates(k_n13_to_p_c12_derived); + jac.set(N13, N13, scratch); + + scratch = screened_rates(k_p_o16_to_he4_n13_derived)*Y(H1)*state.rho; + jac.set(N13, O16, scratch); + + scratch = -screened_rates(k_he4_n14_to_f18)*Y(N14)*state.rho; + jac.set(N14, He4, scratch); + + scratch = -screened_rates(k_he4_n14_to_f18)*Y(He4)*state.rho; + jac.set(N14, N14, scratch); + + scratch = screened_rates(k_f18_to_he4_n14_derived); + jac.set(N14, F18, scratch); + + scratch = -screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*state.rho; + jac.set(O16, H1, scratch); + + scratch = screened_rates(k_he4_c12_to_o16)*Y(C12)*state.rho + screened_rates(k_he4_n13_to_p_o16)*Y(N13)*state.rho - screened_rates(k_he4_o16_to_ne20)*Y(O16)*state.rho; + jac.set(O16, He4, scratch); + + scratch = -screened_rates(k_c12_o16_to_he4_mg24)*Y(O16)*state.rho - screened_rates(k_c12_o16_to_p_al27)*Y(O16)*state.rho - screened_rates(k_c12_o16_to_si28_modified)*Y(O16)*state.rho + screened_rates(k_he4_c12_to_o16)*Y(He4)*state.rho; + jac.set(O16, C12, scratch); + + scratch = screened_rates(k_he4_n13_to_p_o16)*Y(He4)*state.rho; + jac.set(O16, N13, scratch); + + scratch = -screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*state.rho - screened_rates(k_c12_o16_to_p_al27)*Y(C12)*state.rho - screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*state.rho - screened_rates(k_he4_o16_to_ne20)*Y(He4)*state.rho - 2.0*screened_rates(k_o16_o16_to_he4_si28)*Y(O16)*state.rho - 2.0*screened_rates(k_o16_o16_to_p_p31)*Y(O16)*state.rho - 2.0*screened_rates(k_o16_o16_to_s32_modified)*Y(O16)*state.rho - screened_rates(k_o16_to_he4_c12_derived) - screened_rates(k_p_o16_to_he4_n13_derived)*Y(H1)*state.rho; + jac.set(O16, O16, scratch); + + scratch = screened_rates(k_ne20_to_he4_o16_derived); + jac.set(O16, Ne20, scratch); + + scratch = screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*state.rho; + jac.set(F18, H1, scratch); + + scratch = -screened_rates(k_he4_f18_to_na22)*Y(F18)*state.rho - screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*state.rho + screened_rates(k_he4_n14_to_f18)*Y(N14)*state.rho; + jac.set(F18, He4, scratch); + + scratch = screened_rates(k_he4_n14_to_f18)*Y(He4)*state.rho; + jac.set(F18, N14, scratch); + + scratch = -screened_rates(k_f18_to_he4_n14_derived) - screened_rates(k_he4_f18_to_na22)*Y(He4)*state.rho - screened_rates(k_he4_f18_to_p_ne21)*Y(He4)*state.rho; + jac.set(F18, F18, scratch); + + scratch = screened_rates(k_p_ne21_to_he4_f18_derived)*Y(H1)*state.rho; + jac.set(F18, Ne21, scratch); + + scratch = screened_rates(k_na22_to_he4_f18_derived); + jac.set(F18, Na22, scratch); + + scratch = screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*state.rho; + jac.set(Ne20, H1, scratch); + + scratch = -screened_rates(k_he4_ne20_to_mg24)*Y(Ne20)*state.rho - screened_rates(k_he4_ne20_to_p_na23_derived)*Y(Ne20)*state.rho + screened_rates(k_he4_o16_to_ne20)*Y(O16)*state.rho; + jac.set(Ne20, He4, scratch); + + scratch = 1.0*screened_rates(k_c12_c12_to_he4_ne20)*Y(C12)*state.rho; + jac.set(Ne20, C12, scratch); + + scratch = screened_rates(k_he4_o16_to_ne20)*Y(He4)*state.rho; + jac.set(Ne20, O16, scratch); + + scratch = -screened_rates(k_he4_ne20_to_mg24)*Y(He4)*state.rho - screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*state.rho - screened_rates(k_ne20_to_he4_o16_derived); + jac.set(Ne20, Ne20, scratch); + + scratch = screened_rates(k_p_na23_to_he4_ne20)*Y(H1)*state.rho; + jac.set(Ne20, Na23, scratch); + + scratch = screened_rates(k_mg24_to_he4_ne20_derived); + jac.set(Ne20, Mg24, scratch); + + scratch = -screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*state.rho - screened_rates(k_p_ne21_to_na22)*Y(Ne21)*state.rho; + jac.set(Ne21, H1, scratch); + + scratch = screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*state.rho; + jac.set(Ne21, He4, scratch); + + scratch = screened_rates(k_he4_f18_to_p_ne21)*Y(He4)*state.rho; + jac.set(Ne21, F18, scratch); + + scratch = -screened_rates(k_p_ne21_to_he4_f18_derived)*Y(H1)*state.rho - screened_rates(k_p_ne21_to_na22)*Y(H1)*state.rho; + jac.set(Ne21, Ne21, scratch); + + scratch = screened_rates(k_na22_to_p_ne21_derived); + jac.set(Ne21, Na22, scratch); + + scratch = screened_rates(k_p_ne21_to_na22)*Y(Ne21)*state.rho; + jac.set(Na22, H1, scratch); + + scratch = screened_rates(k_he4_f18_to_na22)*Y(F18)*state.rho; + jac.set(Na22, He4, scratch); + + scratch = screened_rates(k_he4_f18_to_na22)*Y(He4)*state.rho; + jac.set(Na22, F18, scratch); + + scratch = screened_rates(k_p_ne21_to_na22)*Y(H1)*state.rho; + jac.set(Na22, Ne21, scratch); + + scratch = -screened_rates(k_na22_to_he4_f18_derived) - screened_rates(k_na22_to_p_ne21_derived); + jac.set(Na22, Na22, scratch); + + scratch = -screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*state.rho - screened_rates(k_p_na23_to_mg24)*Y(Na23)*state.rho; + jac.set(Na23, H1, scratch); + + scratch = screened_rates(k_he4_ne20_to_p_na23_derived)*Y(Ne20)*state.rho; + jac.set(Na23, He4, scratch); + + scratch = 1.0*screened_rates(k_c12_c12_to_p_na23)*Y(C12)*state.rho; + jac.set(Na23, C12, scratch); + + scratch = screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*state.rho; + jac.set(Na23, Ne20, scratch); + + scratch = -screened_rates(k_p_na23_to_he4_ne20)*Y(H1)*state.rho - screened_rates(k_p_na23_to_mg24)*Y(H1)*state.rho; + jac.set(Na23, Na23, scratch); + + scratch = screened_rates(k_mg24_to_p_na23_derived); + jac.set(Na23, Mg24, scratch); + + scratch = screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*state.rho + screened_rates(k_p_na23_to_mg24)*Y(Na23)*state.rho; + jac.set(Mg24, H1, scratch); + + scratch = -screened_rates(k_he4_mg24_to_p_al27_derived)*Y(Mg24)*state.rho - screened_rates(k_he4_mg24_to_si28)*Y(Mg24)*state.rho + screened_rates(k_he4_ne20_to_mg24)*Y(Ne20)*state.rho; + jac.set(Mg24, He4, scratch); + + scratch = 1.0*screened_rates(k_c12_c12_to_mg24_modified)*Y(C12)*state.rho + screened_rates(k_c12_o16_to_he4_mg24)*Y(O16)*state.rho; + jac.set(Mg24, C12, scratch); + + scratch = screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*state.rho; + jac.set(Mg24, O16, scratch); + + scratch = screened_rates(k_he4_ne20_to_mg24)*Y(He4)*state.rho; + jac.set(Mg24, Ne20, scratch); + + scratch = screened_rates(k_p_na23_to_mg24)*Y(H1)*state.rho; + jac.set(Mg24, Na23, scratch); + + scratch = -screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*state.rho - screened_rates(k_he4_mg24_to_si28)*Y(He4)*state.rho - screened_rates(k_mg24_to_he4_ne20_derived) - screened_rates(k_mg24_to_p_na23_derived); + jac.set(Mg24, Mg24, scratch); + + scratch = screened_rates(k_p_al27_to_he4_mg24)*Y(H1)*state.rho; + jac.set(Mg24, Al27, scratch); + + scratch = screened_rates(k_si28_to_he4_mg24_derived); + jac.set(Mg24, Si28, scratch); + + scratch = -screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*state.rho - screened_rates(k_p_al27_to_si28)*Y(Al27)*state.rho; + jac.set(Al27, H1, scratch); + + scratch = screened_rates(k_he4_mg24_to_p_al27_derived)*Y(Mg24)*state.rho; + jac.set(Al27, He4, scratch); + + scratch = screened_rates(k_c12_o16_to_p_al27)*Y(O16)*state.rho; + jac.set(Al27, C12, scratch); + + scratch = screened_rates(k_c12_o16_to_p_al27)*Y(C12)*state.rho; + jac.set(Al27, O16, scratch); + + scratch = screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*state.rho; + jac.set(Al27, Mg24, scratch); + + scratch = -screened_rates(k_p_al27_to_he4_mg24)*Y(H1)*state.rho - screened_rates(k_p_al27_to_si28)*Y(H1)*state.rho; + jac.set(Al27, Al27, scratch); + + scratch = screened_rates(k_si28_to_p_al27_derived); + jac.set(Al27, Si28, scratch); + + scratch = screened_rates(k_p_al27_to_si28)*Y(Al27)*state.rho + screened_rates(k_p_p31_to_he4_si28)*Y(P31)*state.rho; + jac.set(Si28, H1, scratch); + + scratch = screened_rates(k_he4_mg24_to_si28)*Y(Mg24)*state.rho - screened_rates(k_he4_si28_to_p_p31_derived)*Y(Si28)*state.rho - screened_rates(k_he4_si28_to_s32)*Y(Si28)*state.rho; + jac.set(Si28, He4, scratch); + + scratch = screened_rates(k_c12_o16_to_si28_modified)*Y(O16)*state.rho; + jac.set(Si28, C12, scratch); + + scratch = screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*state.rho + 1.0*screened_rates(k_o16_o16_to_he4_si28)*Y(O16)*state.rho; + jac.set(Si28, O16, scratch); + + scratch = screened_rates(k_he4_mg24_to_si28)*Y(He4)*state.rho; + jac.set(Si28, Mg24, scratch); + + scratch = screened_rates(k_p_al27_to_si28)*Y(H1)*state.rho; + jac.set(Si28, Al27, scratch); + + scratch = -screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*state.rho - screened_rates(k_he4_si28_to_s32)*Y(He4)*state.rho - screened_rates(k_si28_to_he4_mg24_derived) - screened_rates(k_si28_to_p_al27_derived); + jac.set(Si28, Si28, scratch); + + scratch = screened_rates(k_p_p31_to_he4_si28)*Y(H1)*state.rho; + jac.set(Si28, P31, scratch); + + scratch = screened_rates(k_s32_to_he4_si28_derived); + jac.set(Si28, S32, scratch); + + scratch = -screened_rates(k_p_p31_to_he4_si28)*Y(P31)*state.rho - screened_rates(k_p_p31_to_s32)*Y(P31)*state.rho; + jac.set(P31, H1, scratch); + + scratch = screened_rates(k_he4_si28_to_p_p31_derived)*Y(Si28)*state.rho; + jac.set(P31, He4, scratch); + + scratch = 1.0*screened_rates(k_o16_o16_to_p_p31)*Y(O16)*state.rho; + jac.set(P31, O16, scratch); + + scratch = screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*state.rho; + jac.set(P31, Si28, scratch); + + scratch = -screened_rates(k_p_p31_to_he4_si28)*Y(H1)*state.rho - screened_rates(k_p_p31_to_s32)*Y(H1)*state.rho; + jac.set(P31, P31, scratch); + + scratch = screened_rates(k_s32_to_p_p31_derived); + jac.set(P31, S32, scratch); + + scratch = screened_rates(k_p_p31_to_s32)*Y(P31)*state.rho; + jac.set(S32, H1, scratch); + + scratch = screened_rates(k_he4_si28_to_s32)*Y(Si28)*state.rho - screened_rates(k_s32_he4_to_ar36_approx)*Y(S32)*state.rho; + jac.set(S32, He4, scratch); + + scratch = 1.0*screened_rates(k_o16_o16_to_s32_modified)*Y(O16)*state.rho; + jac.set(S32, O16, scratch); + + scratch = screened_rates(k_he4_si28_to_s32)*Y(He4)*state.rho; + jac.set(S32, Si28, scratch); + + scratch = screened_rates(k_p_p31_to_s32)*Y(H1)*state.rho; + jac.set(S32, P31, scratch); + + scratch = -screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*state.rho - screened_rates(k_s32_to_he4_si28_derived) - screened_rates(k_s32_to_p_p31_derived); + jac.set(S32, S32, scratch); + + scratch = screened_rates(k_ar36_to_s32_he4_approx); + jac.set(S32, Ar36, scratch); + + scratch = -screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*state.rho + screened_rates(k_s32_he4_to_ar36_approx)*Y(S32)*state.rho; + jac.set(Ar36, He4, scratch); + + scratch = screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*state.rho; + jac.set(Ar36, S32, scratch); + + scratch = -screened_rates(k_ar36_he4_to_ca40_approx)*Y(He4)*state.rho - screened_rates(k_ar36_to_s32_he4_approx); + jac.set(Ar36, Ar36, scratch); + + scratch = screened_rates(k_ca40_to_ar36_he4_approx); + jac.set(Ar36, Ca40, scratch); + + scratch = screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*state.rho - screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*state.rho; + jac.set(Ca40, He4, scratch); + + scratch = screened_rates(k_ar36_he4_to_ca40_approx)*Y(He4)*state.rho; + jac.set(Ca40, Ar36, scratch); + + scratch = -screened_rates(k_ca40_he4_to_ti44_approx)*Y(He4)*state.rho - screened_rates(k_ca40_to_ar36_he4_approx); + jac.set(Ca40, Ca40, scratch); + + scratch = screened_rates(k_ti44_to_ca40_he4_approx); + jac.set(Ca40, Ti44, scratch); + + scratch = screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*state.rho - screened_rates(k_ti44_he4_to_cr48_approx)*Y(Ti44)*state.rho; + jac.set(Ti44, He4, scratch); + + scratch = screened_rates(k_ca40_he4_to_ti44_approx)*Y(He4)*state.rho; + jac.set(Ti44, Ca40, scratch); + + scratch = -screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*state.rho - screened_rates(k_ti44_to_ca40_he4_approx); + jac.set(Ti44, Ti44, scratch); + + scratch = screened_rates(k_cr48_to_ti44_he4_approx); + jac.set(Ti44, Cr48, scratch); + + scratch = screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*state.rho; + jac.set(Cr48, H1, scratch); + + scratch = -screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*state.rho - screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*state.rho + screened_rates(k_ti44_he4_to_cr48_approx)*Y(Ti44)*state.rho; + jac.set(Cr48, He4, scratch); + + scratch = screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*state.rho; + jac.set(Cr48, Ti44, scratch); + + scratch = -screened_rates(k_cr48_to_ti44_he4_approx) - screened_rates(k_he4_cr48_to_fe52)*Y(He4)*state.rho - screened_rates(k_he4_cr48_to_p_mn51)*Y(He4)*state.rho; + jac.set(Cr48, Cr48, scratch); + + scratch = screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(H1)*state.rho; + jac.set(Cr48, Mn51, scratch); + + scratch = screened_rates(k_fe52_to_he4_cr48_derived); + jac.set(Cr48, Fe52, scratch); + + scratch = screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*state.rho - screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*state.rho - screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*state.rho; + jac.set(Mn51, H1, scratch); + + scratch = screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*state.rho - screened_rates(k_he4_mn51_to_co55)*Y(Mn51)*state.rho - screened_rates(k_he4_mn51_to_p_fe54)*Y(Mn51)*state.rho; + jac.set(Mn51, He4, scratch); + + scratch = screened_rates(k_he4_cr48_to_p_mn51)*Y(He4)*state.rho; + jac.set(Mn51, Cr48, scratch); + + scratch = -screened_rates(k_he4_mn51_to_co55)*Y(He4)*state.rho - screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*state.rho - screened_rates(k_p_mn51_to_fe52)*Y(H1)*state.rho - screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(H1)*state.rho; + jac.set(Mn51, Mn51, scratch); + + scratch = screened_rates(k_fe52_to_p_mn51_derived); + jac.set(Mn51, Fe52, scratch); + + scratch = screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(H1)*state.rho; + jac.set(Mn51, Fe54, scratch); + + scratch = screened_rates(k_co55_to_he4_mn51_derived); + jac.set(Mn51, Co55, scratch); + + scratch = screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*state.rho; + jac.set(Mn55, N, scratch); + + scratch = -screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*state.rho - screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*state.rho; + jac.set(Mn55, H1, scratch); + + scratch = -screened_rates(k_mn55_to_fe55) - screened_rates(k_p_mn55_to_fe56)*Y(H1)*state.rho - screened_rates(k_p_mn55_to_n_fe55_derived)*Y(H1)*state.rho; + jac.set(Mn55, Mn55, scratch); + + scratch = screened_rates(k_fe55_to_mn55) + screened_rates(k_n_fe55_to_p_mn55)*Y(N)*state.rho; + jac.set(Mn55, Fe55, scratch); + + scratch = screened_rates(k_fe56_to_p_mn55_derived); + jac.set(Mn55, Fe56, scratch); + + scratch = -screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*state.rho; + jac.set(Fe52, N, scratch); + + scratch = screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*state.rho + screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*state.rho; + jac.set(Fe52, H1, scratch); + + scratch = screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*state.rho - screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*state.rho - screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*state.rho; + jac.set(Fe52, He4, scratch); + + scratch = screened_rates(k_he4_cr48_to_fe52)*Y(He4)*state.rho; + jac.set(Fe52, Cr48, scratch); + + scratch = screened_rates(k_p_mn51_to_fe52)*Y(H1)*state.rho; + jac.set(Fe52, Mn51, scratch); + + scratch = -screened_rates(k_fe52_to_he4_cr48_derived) - screened_rates(k_fe52_to_p_mn51_derived) - screened_rates(k_he4_fe52_to_ni56)*Y(He4)*state.rho - screened_rates(k_he4_fe52_to_p_co55)*Y(He4)*state.rho - screened_rates(k_n_fe52_to_fe53)*Y(N)*state.rho; + jac.set(Fe52, Fe52, scratch); + + scratch = screened_rates(k_fe53_to_n_fe52_derived); + jac.set(Fe52, Fe53, scratch); + + scratch = screened_rates(k_p_co55_to_he4_fe52_derived)*Y(H1)*state.rho; + jac.set(Fe52, Co55, scratch); + + scratch = screened_rates(k_ni56_to_he4_fe52_derived); + jac.set(Fe52, Ni56, scratch); + + scratch = screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*state.rho - screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*state.rho + screened_rates(k_n_ni56_to_he4_fe53)*Y(Ni56)*state.rho; + jac.set(Fe53, N, scratch); + + scratch = screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*state.rho; + jac.set(Fe53, H1, scratch); + + scratch = -screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*state.rho - screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*state.rho - screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*state.rho; + jac.set(Fe53, He4, scratch); + + scratch = screened_rates(k_n_fe52_to_fe53)*Y(N)*state.rho; + jac.set(Fe53, Fe52, scratch); + + scratch = -screened_rates(k_fe53_to_n_fe52_derived) - screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(He4)*state.rho - screened_rates(k_he4_fe53_to_ni57)*Y(He4)*state.rho - screened_rates(k_he4_fe53_to_p_co56)*Y(He4)*state.rho - screened_rates(k_n_fe53_to_fe54)*Y(N)*state.rho; + jac.set(Fe53, Fe53, scratch); + + scratch = screened_rates(k_fe54_to_n_fe53_derived); + jac.set(Fe53, Fe54, scratch); + + scratch = screened_rates(k_p_co56_to_he4_fe53_derived)*Y(H1)*state.rho; + jac.set(Fe53, Co56, scratch); + + scratch = screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*state.rho; + jac.set(Fe53, Ni56, scratch); + + scratch = screened_rates(k_ni57_to_he4_fe53_derived); + jac.set(Fe53, Ni57, scratch); + + scratch = screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*state.rho - screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*state.rho + screened_rates(k_n_ni57_to_he4_fe54)*Y(Ni57)*state.rho; + jac.set(Fe54, N, scratch); + + scratch = screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*state.rho - screened_rates(k_p_fe54_to_co55)*Y(Fe54)*state.rho - screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*state.rho; + jac.set(Fe54, H1, scratch); + + scratch = -screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*state.rho - screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*state.rho - screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*state.rho + screened_rates(k_he4_mn51_to_p_fe54)*Y(Mn51)*state.rho; + jac.set(Fe54, He4, scratch); + + scratch = screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*state.rho; + jac.set(Fe54, Mn51, scratch); + + scratch = screened_rates(k_n_fe53_to_fe54)*Y(N)*state.rho; + jac.set(Fe54, Fe53, scratch); + + scratch = -screened_rates(k_fe54_to_n_fe53_derived) - screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(He4)*state.rho - screened_rates(k_he4_fe54_to_ni58)*Y(He4)*state.rho - screened_rates(k_he4_fe54_to_p_co57_derived)*Y(He4)*state.rho - screened_rates(k_n_fe54_to_fe55)*Y(N)*state.rho - screened_rates(k_p_fe54_to_co55)*Y(H1)*state.rho - screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(H1)*state.rho; + jac.set(Fe54, Fe54, scratch); + + scratch = screened_rates(k_fe55_to_n_fe54_derived); + jac.set(Fe54, Fe55, scratch); + + scratch = screened_rates(k_co55_to_p_fe54_derived); + jac.set(Fe54, Co55, scratch); + + scratch = screened_rates(k_p_co57_to_he4_fe54)*Y(H1)*state.rho; + jac.set(Fe54, Co57, scratch); + + scratch = screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*state.rho; + jac.set(Fe54, Ni57, scratch); + + scratch = screened_rates(k_ni58_to_he4_fe54_derived); + jac.set(Fe54, Ni58, scratch); + + scratch = screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*state.rho + screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*state.rho - screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*state.rho - screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*state.rho + screened_rates(k_n_ni58_to_he4_fe55)*Y(Ni58)*state.rho; + jac.set(Fe55, N, scratch); + + scratch = -screened_rates(k_p_fe55_to_co56)*Y(Fe55)*state.rho - screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*state.rho + screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*state.rho; + jac.set(Fe55, H1, scratch); + + scratch = -screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*state.rho; + jac.set(Fe55, He4, scratch); + + scratch = screened_rates(k_mn55_to_fe55) + screened_rates(k_p_mn55_to_n_fe55_derived)*Y(H1)*state.rho; + jac.set(Fe55, Mn55, scratch); + + scratch = screened_rates(k_n_fe54_to_fe55)*Y(N)*state.rho; + jac.set(Fe55, Fe54, scratch); + + scratch = -screened_rates(k_fe55_to_co55) - screened_rates(k_fe55_to_mn55) - screened_rates(k_fe55_to_n_fe54_derived) - screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(He4)*state.rho - screened_rates(k_n_fe55_to_fe56)*Y(N)*state.rho - screened_rates(k_n_fe55_to_p_mn55)*Y(N)*state.rho - screened_rates(k_p_fe55_to_co56)*Y(H1)*state.rho - screened_rates(k_p_fe55_to_n_co55_derived)*Y(H1)*state.rho; + jac.set(Fe55, Fe55, scratch); + + scratch = screened_rates(k_fe56_to_n_fe55_derived); + jac.set(Fe55, Fe56, scratch); + + scratch = screened_rates(k_co55_to_fe55) + screened_rates(k_n_co55_to_p_fe55)*Y(N)*state.rho; + jac.set(Fe55, Co55, scratch); + + scratch = screened_rates(k_co56_to_p_fe55_derived); + jac.set(Fe55, Co56, scratch); + + scratch = screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*state.rho; + jac.set(Fe55, Ni58, scratch); + + scratch = screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*state.rho + screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*state.rho; + jac.set(Fe56, N, scratch); + + scratch = -screened_rates(k_p_fe56_to_co57)*Y(Fe56)*state.rho - screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*state.rho + screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*state.rho; + jac.set(Fe56, H1, scratch); + + scratch = screened_rates(k_p_mn55_to_fe56)*Y(H1)*state.rho; + jac.set(Fe56, Mn55, scratch); + + scratch = screened_rates(k_n_fe55_to_fe56)*Y(N)*state.rho; + jac.set(Fe56, Fe55, scratch); + + scratch = -screened_rates(k_fe56_to_co56) - screened_rates(k_fe56_to_n_fe55_derived) - screened_rates(k_fe56_to_p_mn55_derived) - screened_rates(k_p_fe56_to_co57)*Y(H1)*state.rho - screened_rates(k_p_fe56_to_n_co56_derived)*Y(H1)*state.rho; + jac.set(Fe56, Fe56, scratch); + + scratch = screened_rates(k_co56_to_fe56) + screened_rates(k_n_co56_to_p_fe56)*Y(N)*state.rho; + jac.set(Fe56, Co56, scratch); + + scratch = screened_rates(k_co57_to_p_fe56_derived); + jac.set(Fe56, Co57, scratch); + + scratch = -screened_rates(k_n_co55_to_co56)*Y(Co55)*state.rho - screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*state.rho; + jac.set(Co55, N, scratch); + + scratch = -screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*state.rho - screened_rates(k_p_co55_to_ni56)*Y(Co55)*state.rho + screened_rates(k_p_fe54_to_co55)*Y(Fe54)*state.rho + screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*state.rho + screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*state.rho; + jac.set(Co55, H1, scratch); + + scratch = -screened_rates(k_he4_co55_to_cu59)*Y(Co55)*state.rho - screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*state.rho + screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*state.rho + screened_rates(k_he4_mn51_to_co55)*Y(Mn51)*state.rho; + jac.set(Co55, He4, scratch); + + scratch = screened_rates(k_he4_mn51_to_co55)*Y(He4)*state.rho; + jac.set(Co55, Mn51, scratch); + + scratch = screened_rates(k_he4_fe52_to_p_co55)*Y(He4)*state.rho; + jac.set(Co55, Fe52, scratch); + + scratch = screened_rates(k_p_fe54_to_co55)*Y(H1)*state.rho; + jac.set(Co55, Fe54, scratch); + + scratch = screened_rates(k_fe55_to_co55) + screened_rates(k_p_fe55_to_n_co55_derived)*Y(H1)*state.rho; + jac.set(Co55, Fe55, scratch); + + scratch = -screened_rates(k_co55_to_fe55) - screened_rates(k_co55_to_he4_mn51_derived) - screened_rates(k_co55_to_p_fe54_derived) - screened_rates(k_he4_co55_to_cu59)*Y(He4)*state.rho - screened_rates(k_he4_co55_to_p_ni58)*Y(He4)*state.rho - screened_rates(k_n_co55_to_co56)*Y(N)*state.rho - screened_rates(k_n_co55_to_p_fe55)*Y(N)*state.rho - screened_rates(k_p_co55_to_he4_fe52_derived)*Y(H1)*state.rho - screened_rates(k_p_co55_to_ni56)*Y(H1)*state.rho; + jac.set(Co55, Co55, scratch); + + scratch = screened_rates(k_co56_to_n_co55_derived); + jac.set(Co55, Co56, scratch); + + scratch = screened_rates(k_ni56_to_p_co55_derived); + jac.set(Co55, Ni56, scratch); + + scratch = screened_rates(k_p_ni58_to_he4_co55_derived)*Y(H1)*state.rho; + jac.set(Co55, Ni58, scratch); + + scratch = screened_rates(k_cu59_to_he4_co55_derived); + jac.set(Co55, Cu59, scratch); + + scratch = screened_rates(k_n_co55_to_co56)*Y(Co55)*state.rho - screened_rates(k_n_co56_to_co57)*Y(Co56)*state.rho - screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*state.rho + screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*state.rho + screened_rates(k_n_ni56_to_p_co56)*Y(Ni56)*state.rho; + jac.set(Co56, N, scratch); + + scratch = -screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*state.rho - screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*state.rho - screened_rates(k_p_co56_to_ni57)*Y(Co56)*state.rho + screened_rates(k_p_fe55_to_co56)*Y(Fe55)*state.rho + screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*state.rho; + jac.set(Co56, H1, scratch); + + scratch = -screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*state.rho + screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*state.rho; + jac.set(Co56, He4, scratch); + + scratch = screened_rates(k_he4_fe53_to_p_co56)*Y(He4)*state.rho; + jac.set(Co56, Fe53, scratch); + + scratch = screened_rates(k_p_fe55_to_co56)*Y(H1)*state.rho; + jac.set(Co56, Fe55, scratch); + + scratch = screened_rates(k_fe56_to_co56) + screened_rates(k_p_fe56_to_n_co56_derived)*Y(H1)*state.rho; + jac.set(Co56, Fe56, scratch); + + scratch = screened_rates(k_n_co55_to_co56)*Y(N)*state.rho; + jac.set(Co56, Co55, scratch); + + scratch = -screened_rates(k_co56_to_fe56) - screened_rates(k_co56_to_n_co55_derived) - screened_rates(k_co56_to_ni56) - screened_rates(k_co56_to_p_fe55_derived) - screened_rates(k_he4_co56_to_n_cu59_derived)*Y(He4)*state.rho - screened_rates(k_n_co56_to_co57)*Y(N)*state.rho - screened_rates(k_n_co56_to_p_fe56)*Y(N)*state.rho - screened_rates(k_p_co56_to_he4_fe53_derived)*Y(H1)*state.rho - screened_rates(k_p_co56_to_n_ni56_derived)*Y(H1)*state.rho - screened_rates(k_p_co56_to_ni57)*Y(H1)*state.rho; + jac.set(Co56, Co56, scratch); + + scratch = screened_rates(k_co57_to_n_co56_derived); + jac.set(Co56, Co57, scratch); + + scratch = screened_rates(k_n_ni56_to_p_co56)*Y(N)*state.rho + screened_rates(k_ni56_to_co56); + jac.set(Co56, Ni56, scratch); + + scratch = screened_rates(k_ni57_to_p_co56_derived); + jac.set(Co56, Ni57, scratch); + + scratch = screened_rates(k_n_cu59_to_he4_co56)*Y(N)*state.rho; + jac.set(Co56, Cu59, scratch); + + scratch = screened_rates(k_n_co56_to_co57)*Y(Co56)*state.rho + screened_rates(k_n_ni57_to_p_co57)*Y(Ni57)*state.rho; + jac.set(Co57, N, scratch); + + scratch = -screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*state.rho - screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*state.rho - screened_rates(k_p_co57_to_ni58)*Y(Co57)*state.rho + screened_rates(k_p_fe56_to_co57)*Y(Fe56)*state.rho; + jac.set(Co57, H1, scratch); + + scratch = screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*state.rho; + jac.set(Co57, He4, scratch); + + scratch = screened_rates(k_he4_fe54_to_p_co57_derived)*Y(He4)*state.rho; + jac.set(Co57, Fe54, scratch); + + scratch = screened_rates(k_p_fe56_to_co57)*Y(H1)*state.rho; + jac.set(Co57, Fe56, scratch); + + scratch = screened_rates(k_n_co56_to_co57)*Y(N)*state.rho; + jac.set(Co57, Co56, scratch); + + scratch = -screened_rates(k_co57_to_n_co56_derived) - screened_rates(k_co57_to_ni57) - screened_rates(k_co57_to_p_fe56_derived) - screened_rates(k_p_co57_to_he4_fe54)*Y(H1)*state.rho - screened_rates(k_p_co57_to_n_ni57_derived)*Y(H1)*state.rho - screened_rates(k_p_co57_to_ni58)*Y(H1)*state.rho; + jac.set(Co57, Co57, scratch); + + scratch = screened_rates(k_n_ni57_to_p_co57)*Y(N)*state.rho + screened_rates(k_ni57_to_co57); + jac.set(Co57, Ni57, scratch); + + scratch = screened_rates(k_ni58_to_p_co57_derived); + jac.set(Co57, Ni58, scratch); + + scratch = -screened_rates(k_n_ni56_to_he4_fe53)*Y(Ni56)*state.rho - screened_rates(k_n_ni56_to_ni57)*Y(Ni56)*state.rho - screened_rates(k_n_ni56_to_p_co56)*Y(Ni56)*state.rho; + jac.set(Ni56, N, scratch); + + scratch = screened_rates(k_p_co55_to_ni56)*Y(Co55)*state.rho + screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*state.rho + screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*state.rho; + jac.set(Ni56, H1, scratch); + + scratch = screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*state.rho + screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*state.rho - screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(Ni56)*state.rho - screened_rates(k_he4_ni56_to_zn60)*Y(Ni56)*state.rho; + jac.set(Ni56, He4, scratch); + + scratch = screened_rates(k_he4_fe52_to_ni56)*Y(He4)*state.rho; + jac.set(Ni56, Fe52, scratch); + + scratch = screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(He4)*state.rho; + jac.set(Ni56, Fe53, scratch); + + scratch = screened_rates(k_p_co55_to_ni56)*Y(H1)*state.rho; + jac.set(Ni56, Co55, scratch); + + scratch = screened_rates(k_co56_to_ni56) + screened_rates(k_p_co56_to_n_ni56_derived)*Y(H1)*state.rho; + jac.set(Ni56, Co56, scratch); + + scratch = -screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*state.rho - screened_rates(k_he4_ni56_to_zn60)*Y(He4)*state.rho - screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*state.rho - screened_rates(k_n_ni56_to_ni57)*Y(N)*state.rho - screened_rates(k_n_ni56_to_p_co56)*Y(N)*state.rho - screened_rates(k_ni56_to_co56) - screened_rates(k_ni56_to_he4_fe52_derived) - screened_rates(k_ni56_to_p_co55_derived); + jac.set(Ni56, Ni56, scratch); + + scratch = screened_rates(k_ni57_to_n_ni56_derived); + jac.set(Ni56, Ni57, scratch); + + scratch = screened_rates(k_p_cu59_to_he4_ni56)*Y(H1)*state.rho; + jac.set(Ni56, Cu59, scratch); + + scratch = screened_rates(k_zn60_to_he4_ni56_derived); + jac.set(Ni56, Zn60, scratch); + + scratch = screened_rates(k_n_ni56_to_ni57)*Y(Ni56)*state.rho - screened_rates(k_n_ni57_to_he4_fe54)*Y(Ni57)*state.rho - screened_rates(k_n_ni57_to_ni58)*Y(Ni57)*state.rho - screened_rates(k_n_ni57_to_p_co57)*Y(Ni57)*state.rho + screened_rates(k_n_zn60_to_he4_ni57)*Y(Zn60)*state.rho; + jac.set(Ni57, N, scratch); + + scratch = screened_rates(k_p_co56_to_ni57)*Y(Co56)*state.rho + screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*state.rho; + jac.set(Ni57, H1, scratch); + + scratch = screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*state.rho + screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*state.rho - screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(Ni57)*state.rho; + jac.set(Ni57, He4, scratch); + + scratch = screened_rates(k_he4_fe53_to_ni57)*Y(He4)*state.rho; + jac.set(Ni57, Fe53, scratch); + + scratch = screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(He4)*state.rho; + jac.set(Ni57, Fe54, scratch); + + scratch = screened_rates(k_p_co56_to_ni57)*Y(H1)*state.rho; + jac.set(Ni57, Co56, scratch); + + scratch = screened_rates(k_co57_to_ni57) + screened_rates(k_p_co57_to_n_ni57_derived)*Y(H1)*state.rho; + jac.set(Ni57, Co57, scratch); + + scratch = screened_rates(k_n_ni56_to_ni57)*Y(N)*state.rho; + jac.set(Ni57, Ni56, scratch); + + scratch = -screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*state.rho - screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*state.rho - screened_rates(k_n_ni57_to_ni58)*Y(N)*state.rho - screened_rates(k_n_ni57_to_p_co57)*Y(N)*state.rho - screened_rates(k_ni57_to_co57) - screened_rates(k_ni57_to_he4_fe53_derived) - screened_rates(k_ni57_to_n_ni56_derived) - screened_rates(k_ni57_to_p_co56_derived); + jac.set(Ni57, Ni57, scratch); + + scratch = screened_rates(k_ni58_to_n_ni57_derived); + jac.set(Ni57, Ni58, scratch); + + scratch = screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*state.rho; + jac.set(Ni57, Zn60, scratch); + + scratch = screened_rates(k_n_ni57_to_ni58)*Y(Ni57)*state.rho - screened_rates(k_n_ni58_to_he4_fe55)*Y(Ni58)*state.rho; + jac.set(Ni58, N, scratch); + + scratch = screened_rates(k_p_co57_to_ni58)*Y(Co57)*state.rho - screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*state.rho - screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*state.rho; + jac.set(Ni58, H1, scratch); + + scratch = screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*state.rho + screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*state.rho + screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*state.rho; + jac.set(Ni58, He4, scratch); + + scratch = screened_rates(k_he4_fe54_to_ni58)*Y(He4)*state.rho; + jac.set(Ni58, Fe54, scratch); + + scratch = screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(He4)*state.rho; + jac.set(Ni58, Fe55, scratch); + + scratch = screened_rates(k_he4_co55_to_p_ni58)*Y(He4)*state.rho; + jac.set(Ni58, Co55, scratch); + + scratch = screened_rates(k_p_co57_to_ni58)*Y(H1)*state.rho; + jac.set(Ni58, Co57, scratch); + + scratch = screened_rates(k_n_ni57_to_ni58)*Y(N)*state.rho; + jac.set(Ni58, Ni57, scratch); + + scratch = -screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*state.rho - screened_rates(k_ni58_to_he4_fe54_derived) - screened_rates(k_ni58_to_n_ni57_derived) - screened_rates(k_ni58_to_p_co57_derived) - screened_rates(k_p_ni58_to_cu59)*Y(H1)*state.rho - screened_rates(k_p_ni58_to_he4_co55_derived)*Y(H1)*state.rho; + jac.set(Ni58, Ni58, scratch); + + scratch = screened_rates(k_cu59_to_p_ni58_derived); + jac.set(Ni58, Cu59, scratch); + + scratch = -screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*state.rho; + jac.set(Cu59, N, scratch); + + scratch = -screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*state.rho - screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*state.rho + screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*state.rho; + jac.set(Cu59, H1, scratch); + + scratch = screened_rates(k_he4_co55_to_cu59)*Y(Co55)*state.rho + screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*state.rho + screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(Ni56)*state.rho; + jac.set(Cu59, He4, scratch); + + scratch = screened_rates(k_he4_co55_to_cu59)*Y(He4)*state.rho; + jac.set(Cu59, Co55, scratch); + + scratch = screened_rates(k_he4_co56_to_n_cu59_derived)*Y(He4)*state.rho; + jac.set(Cu59, Co56, scratch); + + scratch = screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*state.rho; + jac.set(Cu59, Ni56, scratch); + + scratch = screened_rates(k_p_ni58_to_cu59)*Y(H1)*state.rho; + jac.set(Cu59, Ni58, scratch); + + scratch = -screened_rates(k_cu59_to_he4_co55_derived) - screened_rates(k_cu59_to_p_ni58_derived) - screened_rates(k_n_cu59_to_he4_co56)*Y(N)*state.rho - screened_rates(k_p_cu59_to_he4_ni56)*Y(H1)*state.rho - screened_rates(k_p_cu59_to_zn60)*Y(H1)*state.rho; + jac.set(Cu59, Cu59, scratch); + + scratch = screened_rates(k_zn60_to_p_cu59_derived); + jac.set(Cu59, Zn60, scratch); + + scratch = -screened_rates(k_n_zn60_to_he4_ni57)*Y(Zn60)*state.rho; + jac.set(Zn60, N, scratch); + + scratch = screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*state.rho; + jac.set(Zn60, H1, scratch); + + scratch = screened_rates(k_he4_ni56_to_zn60)*Y(Ni56)*state.rho + screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(Ni57)*state.rho; + jac.set(Zn60, He4, scratch); + + scratch = screened_rates(k_he4_ni56_to_zn60)*Y(He4)*state.rho; + jac.set(Zn60, Ni56, scratch); + + scratch = screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*state.rho; + jac.set(Zn60, Ni57, scratch); + + scratch = screened_rates(k_p_cu59_to_zn60)*Y(H1)*state.rho; + jac.set(Zn60, Cu59, scratch); + + scratch = -screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*state.rho - screened_rates(k_zn60_to_he4_ni56_derived) - screened_rates(k_zn60_to_p_cu59_derived); + jac.set(Zn60, Zn60, scratch); + + +} + + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void actual_jac(const burn_t& state, MatrixType& jac) +{ + + // Set molar abundances + Array1D Y; + for (int i = 1; i <= NumSpec; ++i) { + Y(i) = state.xn[i-1] * aion_inv[i-1]; + } + + + jac.zero(); + + rate_derivs_t rate_eval; + + constexpr int do_T_derivatives = 1; + evaluate_rates(state, rate_eval); + + // Species Jacobian elements with respect to other species + + jac_nuc(state, jac, Y, rate_eval.screened_rates); + + // Energy generation rate Jacobian elements with respect to species + + for (int j = 1; j <= NumSpec; ++j) { + auto jac_slice_2 = [&](int i) -> Real { return jac.get(i, j); }; + ener_gener_rate(jac_slice_2, jac(net_ienuc,j)); + } + + // Account for the thermal neutrino losses + + Real sneut, dsneutdt, dsneutdd, dsnuda, dsnudz; + constexpr int do_derivatives{1}; + sneut5(state.T, state.rho, state.abar, state.zbar, sneut, dsneutdt, dsneutdd, dsnuda, dsnudz); + + for (int j = 1; j <= NumSpec; ++j) { + Real b1 = (-state.abar * state.abar * dsnuda + (zion[j-1] - state.zbar) * state.abar * dsnudz); + jac.add(net_ienuc, j, -b1); + } + + + // Evaluate the Jacobian elements with respect to energy by + // calling the RHS using d(rate) / dT and then transform them + // to our energy integration variable. + + Array1D yderivs; + + rhs_nuc(state, yderivs, Y, rate_eval.dscreened_rates_dT); + + for (int k = 1; k <= NumSpec; k++) { + jac.set(k, net_ienuc, temperature_to_energy_jacobian(state, yderivs(k))); + } + + + // finally, d(de/dt)/de + + Real jac_e_T; + ener_gener_rate(yderivs, jac_e_T); + jac_e_T -= dsneutdt; + jac.set(net_ienuc, net_ienuc, temperature_to_energy_jacobian(state, jac_e_T)); + +} + + +AMREX_INLINE +void actual_rhs_init () { + + init_tabular(); + +} + + +#endif diff --git a/networks/He-C-Fe-group/inputs.burn_cell.VODE b/networks/He-C-Fe-group/inputs.burn_cell.VODE new file mode 100644 index 0000000000..320d26fb4d --- /dev/null +++ b/networks/He-C-Fe-group/inputs.burn_cell.VODE @@ -0,0 +1,62 @@ +unit_test.run_prefix = "react_pynucastro_" + +unit_test.small_temp = 1e5 +unit_test.small_dens = 1e5 + +integrator.burner_verbose = 0 + +# Set which jacobian to use +# 1 = analytic jacobian +# 2 = numerical jacobian +integrator.jacobian = 1 + +integrator.renormalize_abundances = 0 + +integrator.rtol_spec = 1.0e-6 +integrator.rtol_enuc = 1.0e-6 +integrator.atol_spec = 1.0e-6 +integrator.atol_enuc = 1.0e-6 + + +unit_test.tmax = 1.0 +unit_test.nsteps = 1000 + +unit_test.density = 1.0e7 +unit_test.temperature = 1.0e8 + +unit_test.X1 = 1.0 +unit_test.X2 = 0.0 +unit_test.X3 = 0.0 +unit_test.X4 = 0.0 +unit_test.X5 = 0.0 +unit_test.X6 = 0.0 +unit_test.X7 = 0.0 +unit_test.X8 = 0.0 +unit_test.X9 = 0.0 +unit_test.X10 = 0.0 +unit_test.X11 = 0.0 +unit_test.X12 = 0.0 +unit_test.X13 = 0.0 +unit_test.X14 = 0.0 +unit_test.X15 = 0.0 +unit_test.X16 = 0.0 +unit_test.X17 = 0.0 +unit_test.X18 = 0.0 +unit_test.X19 = 0.0 +unit_test.X20 = 0.0 +unit_test.X21 = 0.0 +unit_test.X22 = 0.0 +unit_test.X23 = 0.0 +unit_test.X24 = 0.0 +unit_test.X25 = 0.0 +unit_test.X26 = 0.0 +unit_test.X27 = 0.0 +unit_test.X28 = 0.0 +unit_test.X29 = 0.0 +unit_test.X30 = 0.0 +unit_test.X31 = 0.0 +unit_test.X32 = 0.0 +unit_test.X33 = 0.0 +unit_test.X34 = 0.0 +unit_test.X35 = 0.0 +unit_test.X36 = 0.0 diff --git a/networks/He-C-Fe-group/partition_functions.H b/networks/He-C-Fe-group/partition_functions.H new file mode 100644 index 0000000000..03c1db628a --- /dev/null +++ b/networks/He-C-Fe-group/partition_functions.H @@ -0,0 +1,1011 @@ +#ifndef PARTITION_FUNCTIONS_H +#define PARTITION_FUNCTIONS_H + +#include +#include + +#include +#include +#include + +using namespace amrex; +using namespace Species; + +namespace part_fun { + + constexpr int npts_1 = 72; + + // this is T9 + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real temp_array_1[npts_1] = { + 0.01, 0.15, 0.2, 0.3, 0.4, + 0.5, 0.6, 0.7, 0.8, 0.9, + 1.0, 1.5, 2.0, 2.5, 3.0, + 3.5, 4.0, 4.5, 5.0, 6.0, + 7.0, 8.0, 9.0, 10.0, 12.0, + 14.0, 16.0, 18.0, 20.0, 22.0, + 24.0, 26.0, 28.0, 30.0, 35.0, + 40.0, 45.0, 50.0, 55.0, 60.0, + 65.0, 70.0, 75.0, 80.0, 85.0, + 90.0, 95.0, 100.0, 105.0, 110.0, + 115.0, 120.0, 125.0, 130.0, 135.0, + 140.0, 145.0, 150.0, 155.0, 160.0, + 165.0, 170.0, 175.0, 180.0, 190.0, + 200.0, 210.0, 220.0, 230.0, 240.0, + 250.0, 275.0, + }; + + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real o16_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.012837224705172217, + 0.03742649794062367, 0.07188200730612536, 0.1205739312058499, 0.1846914308175988, 0.26245108973042947, + 0.3463529744506387, 0.437750562820388, 0.534026106056135, 0.6344772701607315, 0.8981764834976765, + 1.1760912590556813, 1.4668676203541096, 1.7641761323903307, 2.0644579892269186, 2.367355921026019, + 2.667452952889954, 2.9656719712201065, 3.2624510897304293, 3.555094448578319, 3.845098040014257, + 4.133538908370218, 4.419955748489758, 4.704150516839799, 4.986771734266245, 5.267171728403014, + 5.547774705387822, 5.8267225201689925, 6.103803720955957, 6.380211241711606, 6.6551384348113825, + 6.929929560084588, 7.204119982655925, 7.477121254719663, 7.748962861256161, 8.021189299069938, + 8.292256071356476, 8.562292864456476, 8.832508912706237, 9.100370545117563, 9.640481436970422, + 10.178976947293169, 10.714329759745233, 11.250420002308894, 11.785329835010767, 12.320146286111054, + 12.856124444242301, 14.195899652409233, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real f18_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.008600171761917567, 0.02530586526477026, 0.04921802267018165, + 0.08635983067474821, 0.12385164096708583, 0.16731733474817606, 0.20682587603184974, 0.28330122870354957, + 0.35024801833416286, 0.4065401804339551, 0.45331834004703764, 0.4941545940184428, 0.6646419755561255, + 0.756636108245848, 0.8419848045901139, 0.9232440186302765, 1.0043213737826426, 1.08278537031645, + 1.1643528557844371, 1.250420002308894, 1.3384564936046048, 1.429752280002408, 1.6748611407378116, + 1.9405164849325671, 2.220108088040055, 2.505149978319906, 2.79309160017658, 3.0827853703164503, + 3.369215857410143, 3.6570558528571038, 3.9434945159061026, 4.230448921378274, 4.514547752660286, + 4.800029359244134, 5.086359830674748, 5.371067862271737, 5.657055852857104, 5.94299959336604, + 6.230448921378274, 6.515873843711679, 6.803457115648414, 7.089905111439398, 7.378397900948138, + 7.6674529528899535, 7.956168430475364, 8.24551266781415, 8.534026106056135, 8.823474229170301, + 9.113943352306837, 9.403120521175818, 9.69460519893357, 9.984977126415494, 10.568201724066995, + 11.152288344383056, 11.73798732633343, 12.324282455297693, 12.913813852383717, 13.503790683057181, + 14.096910013008056, 15.584331224367531, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ne20_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 6.948656121358244e-06, 0.00016586881316040883, 0.0011034421778731533, 0.003892457497077877, + 0.00954097493969645, 0.01859524021829981, 0.03107544483336982, 0.04661767038571622, 0.0846241727916796, + 0.12822183093465686, 0.174311933665943, 0.22124805254602342, 0.2683385291343481, 0.36172783601759284, + 0.456366033129043, 0.5514499979728752, 0.6483600109809317, 0.7466341989375788, 0.8481891169913987, + 0.9532763366673044, 1.0644579892269186, 1.1789769472931695, 1.3031960574204888, 1.6434526764861874, + 2.0170333392987803, 2.4099331233312946, 2.8068580295188172, 3.2013971243204513, 3.5899496013257077, + 3.9731278535996988, 4.352182518111363, 4.725911632295048, 5.096910013008056, 5.465382851448418, + 5.830588668685144, 6.193124598354461, 6.556302500767288, 6.916980047320382, 7.276461804173244, + 7.6344772701607315, 7.991669007379948, 8.34830486304816, 8.703291378118662, 9.056904851336473, + 9.411619705963231, 9.763427993562937, 10.117271295655764, 10.46686762035411, 10.818225893613956, + 11.170261715394957, 11.519827993775719, 11.869231719730976, 12.217483944213907, 12.916453948549925, + 13.613841821876068, 14.3096301674259, 15.004321373782643, 15.702430536445526, 16.399673721481037, + 17.096910013008056, 18.838849090737256, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ne21_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 8.685880952436747e-07, 2.4754079983896385e-05, + 0.0001901793368385613, 0.0007372402163824667, 0.0019404293040471109, 0.0040039218205739505, 0.007021925578680666, + 0.010986057727319889, 0.04118891376750491, 0.0777722105539352, 0.11230632139519969, 0.14260436993417835, + 0.16888829052162926, 0.19197861038694294, 0.2126999294489824, 0.23172922294680384, 0.2666728249346414, + 0.2996105757244402, 0.3321030146619489, 0.3650139334448046, 0.3988146649899236, 0.46982201597816303, + 0.546542663478131, 0.6283889300503115, 0.7176705030022621, 0.8142475957319202, 0.9180303367848801, + 1.0293837776852097, 1.14921911265538, 1.276461804173244, 1.4082399653118496, 1.760422483423212, + 2.1271047983648077, 2.499687082618404, 2.870403905279027, 3.2380461031287955, 3.603144372620182, + 3.9656719712201065, 4.326335860928752, 4.683947130751513, 5.041392685158225, 5.396199347095736, + 5.752048447819439, 6.107209969647869, 6.4623979978989565, 6.817565369559781, 7.173186268412274, + 7.5276299008713385, 7.8819549713396, 8.23552844690755, 8.5910646070265, 8.944975908412047, + 9.298853076409706, 9.653212513775344, 10.008600171761918, 10.361727836017593, 10.716837723299525, + 11.071882007306126, 11.424881636631067, 11.780317312140152, 12.133538908370218, 12.84447717574568, + 13.55509444857832, 14.267171728403014, 14.979548374704095, 15.693726948923647, 16.40823996531185, + 17.123851640967086, 18.923244018630278, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real na22_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 4.342942647204277e-07, 2.605759074128604e-06, 1.3028639028478182e-05, 4.559852671908958e-05, 0.00011984873864003521, + 0.0002626687122755098, 0.0029928105843703536, 0.010836979076306525, 0.02428653620880802, 0.04242704733870039, + 0.06402310268617777, 0.08796765614200239, 0.11338308526345184, 0.13961150376071624, 0.19275584832811385, + 0.2451455832343637, 0.2958922043442712, 0.3448263511644293, 0.39212883410565064, 0.48287358360875376, + 0.5717088318086876, 0.6627578316815741, 0.756636108245848, 0.8561244442423004, 0.9633155113861113, + 1.0791812460476249, 1.2013971243204515, 1.3283796034387378, 1.4638929889859074, 1.8215135284047732, + 2.1931245983544616, 2.5705429398818973, 2.9474337218870508, 3.322219294733919, 3.6954816764901977, + 4.068185861746161, 4.4361626470407565, 4.804820678721162, 5.173186268412274, 5.540329474790874, + 5.907411360774586, 6.27415784926368, 6.642464520242122, 7.008600171761918, 7.378397900948138, + 7.746634198937579, 8.113943352306837, 8.482873583608754, 8.851258348719075, 9.220108088040055, + 9.588831725594208, 9.957607287060096, 10.32633586092875, 10.695481676490198, 11.064457989226918, + 11.4345689040342, 11.80413943233535, 12.173186268412273, 12.544068044350276, 13.285557309007773, + 14.02938377768521, 14.773054693364262, 15.518513939877888, 16.264817823009537, 17.012837224705173, + 17.76492298464989, 19.64933485871214, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real na23_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 1.7371744532199383e-06, + 2.3885539658322847e-05, 0.00013113713282427166, 0.0004423207528904243, 0.0010999766245234136, 0.002232173197636284, + 0.003929471989446119, 0.021128907257497758, 0.0479649055541949, 0.07726249885377771, 0.10525805048344757, + 0.13079227003361296, 0.15390201926318714, 0.17503899265296466, 0.19472325248715508, 0.23147162936712465, + 0.26668504599022796, 0.3016913566252569, 0.33713446730536967, 0.37335950050705796, 0.4487063199050799, + 0.5314789170422551, 0.6211762817750351, 0.7218106152125465, 0.8344207036815325, 0.9590413923210935, + 1.0934216851622351, 1.2405492482825997, 1.3926969532596658, 1.5514499979728753, 1.9628426812012425, + 2.383815365980431, 2.803457115648414, 3.220108088040055, 3.6344772701607315, 4.045322978786658, + 4.453318340047038, 4.857935264719429, 5.26245108973043, 5.664641975556125, 6.064457989226918, + 6.466867620354109, 6.867467487859051, 7.267171728403014, 7.666517980554881, 8.064457989226918, + 8.463892988985908, 8.861534410859038, 9.260071387985075, 9.656098202012831, 10.05307844348342, + 10.450249108319362, 10.846337112129806, 11.243038048686294, 11.638489256954637, 12.03342375548695, + 12.429752280002408, 12.826074802700827, 13.222716471147583, 13.6170003411209, 14.40823996531185, + 15.20139712432045, 15.993876914941211, 16.787460474518415, 17.582063362911708, 18.378397900948137, + 19.17609125905568, 21.173186268412273, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real mg24_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 4.342942647204277e-07, 5.471765757979972e-05, 0.0007714899373308071, 0.0037633124724497633, 0.010764115210255056, + 0.022625058328435317, 0.039160607597355665, 0.05951911533271758, 0.08262238957783377, 0.13324118689139802, + 0.185518640557017, 0.2370005304649223, 0.2870228837145503, 0.3357157930198095, 0.43136376415898736, + 0.5263392773898441, 0.6253124509616739, 0.7307822756663892, 0.8463371121298052, 0.9749719942980689, + 1.1172712956557642, 1.2741578492636798, 1.4424797690644486, 1.6232492903979006, 2.103803720955957, + 2.598790506763115, 3.089905111439398, 3.577491799837225, 4.05307844348342, 4.52244423350632, + 4.984527313343793, 5.440909082065217, 5.894869656745253, 6.344392273685111, 6.791690649020118, + 7.235528446907549, 7.6785183790401135, 8.12057393120585, 8.558708570533165, 8.99563519459755, + 9.431363764158988, 9.866287339084195, 10.301029995663981, 10.732393759822969, 11.164352855784436, + 11.594392550375426, 12.02530586526477, 12.453318340047037, 12.881384656770573, 13.3096301674259, + 13.736396502276643, 14.161368002234974, 14.588831725594208, 15.012837224705173, 15.86569605991607, + 16.715167357848458, 17.56466606425209, 18.413299764081252, 19.26245108973043, 20.113943352306837, + 20.96284268120124, 23.089905111439396, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real al27_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 8.685880952436747e-07, 3.4743419578801875e-06, + 1.0422942490878872e-05, 0.00032429686817590634, 0.0018833542475028369, 0.005477808032249925, 0.011239204769804155, + 0.01890428637893266, 0.028126564553716336, 0.03862016194970278, 0.05018673657450416, 0.07608019569340022, + 0.10530099179798431, 0.13774106877747655, 0.1734986149135784, 0.21278880583973628, 0.30319605742048883, + 0.4099331233312945, 0.5352941200427705, 0.6794278966121189, 0.8394780473741984, 1.0128372247051722, + 1.1958996524092338, 1.3873898263387294, 1.5843312243675307, 1.783903579272735, 2.287801729930226, + 2.7944880466591697, 3.296665190261531, 3.7944880466591697, 4.2878017299302265, 4.779596491257824, + 5.269512944217916, 5.7558748556724915, 6.2405492482825995, 6.725094521081469, 7.209515014542631, + 7.691081492122969, 8.173186268412275, 8.653212513775344, 9.133538908370218, 9.611723308007342, + 10.089905111439398, 10.568201724066995, 11.045322978786658, 11.521138083704036, 11.997386384397313, + 12.472756449317213, 12.947923619831727, 13.423245873936807, 13.89707700320942, 14.371067862271737, + 14.845098040014257, 15.320146286111054, 15.79309160017658, 16.267171728403014, 17.214843848047696, + 18.161368002234976, 19.110589710299248, 20.060697840353612, 21.012837224705173, 21.96284268120124, + 22.915927211697117, 25.305351369446623, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real si28_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 2.1714669808675565e-06, 7.12184552784347e-05, 0.0005624812393818785, 0.002223099674110693, + 0.0059171580771474625, 0.012282407118825528, 0.02157709561709228, 0.03370716078346824, 0.06502557053071237, + 0.1027522772573885, 0.14387160800291654, 0.1866035043986153, 0.2302807913268337, 0.3222192947339193, + 0.42324587393680785, 0.541579243946581, 0.6839471307515121, 0.8518696007297664, 1.041392685158225, + 1.250420002308894, 1.4727564493172123, 1.7024305364455252, 1.9375178920173466, 2.531478917042255, + 3.12057393120585, 3.7024305364455254, 4.271841606536499, 4.834420703681532, 5.389166084364533, + 5.937517892017347, 6.481442628502305, 7.021189299069938, 7.557507201905658, 8.089905111439398, + 8.622214022966295, 9.14921911265538, 9.675778341674086, 10.198657086954423, 10.721810615212547, + 11.2405492482826, 11.75966784468963, 12.276461804173245, 12.791690649020119, 13.305351369446624, + 13.818225893613956, 14.330413773349191, 14.840733234611807, 15.350248018334163, 15.85913829729453, + 16.367355921026018, 16.8750612633917, 17.38201704257487, 17.88874096068289, 18.90036712865647, + 19.911157608739977, 20.921166050637737, 21.9304395947667, 22.93951925261862, 23.948901760970212, + 24.958563883221967, 27.48572142648158, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real p31_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 4.342942647204277e-07, 4.820401221806151e-05, 0.0005624812393818785, 0.002468018295084159, 0.006670091319158333, + 0.013688955408210905, 0.023674199668938998, 0.03655105068012579, 0.05215275629691826, 0.09085986215557586, + 0.13887811232360858, 0.19608052467040618, 0.26289299085539924, 0.33982852740425823, 0.5237464668115644, + 0.7419390777291989, 0.9827233876685453, 1.235528446907549, 1.4899584794248346, 1.7442929831226763, + 1.9960736544852753, 2.24551266781415, 2.4913616938342726, 2.733999286538387, 3.330413773349191, + 3.9132839017604186, 4.48572142648158, 5.049218022670182, 5.608526033577194, 6.164352855784437, + 6.714329759745233, 7.264817823009537, 7.812913356642856, 8.359835482339887, 8.90687353472207, + 9.453318340047037, 9.997823080745725, 10.54282542695918, 11.086359830674748, 11.629409599102718, + 12.170261715394957, 12.712649701627212, 13.255272505103306, 13.79448804665917, 14.334453751150932, + 14.874481817699467, 15.414973347970818, 15.953276336667304, 16.492760389026838, 17.029383777685208, + 17.570542939881896, 18.10720996964787, 18.64738297011462, 19.187520720836464, 20.264817823009537, + 21.342422680822207, 22.42160392686983, 23.503790683057183, 24.5854607295085, 25.66931688056611, + 26.75511226639507, 29.477121254719663, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real s32_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 5.211502513843472e-06, 6.948155872801059e-05, 0.0003893875360542875, + 0.001336870159627728, 0.003378232401258555, 0.006963377556787149, 0.012456734172197398, 0.03011415790845077, + 0.057484285853877215, 0.0950053699501746, 0.14295136988131382, 0.20165707691270435, 0.3521825181113625, + 0.5502283530550941, 0.787460474518415, 1.0569048513364727, 1.3404441148401183, 1.631443769013172, + 1.92272545799326, 2.2121876044039577, 2.4955443375464483, 2.7737864449811935, 3.44870631990508, + 4.096910013008056, 4.726727209026572, 5.3404441148401185, 5.944975908412048, 6.541579243946581, + 7.133538908370218, 7.720985744153739, 8.305351369446624, 8.888740960682892, 9.469822015978163, + 10.049218022670182, 10.628388930050312, 11.20682587603185, 11.78175537465247, 12.356025857193123, + 12.9304395947667, 13.502427119984432, 14.075546961392531, 14.645422269349092, 15.214843848047698, + 15.783903579272735, 16.352182518111363, 16.920123326290724, 17.487138375477187, 18.053078443483418, + 18.621176281775035, 19.187520720836464, 19.753583058892907, 20.318063334962762, 21.450249108319362, + 22.580924975675618, 23.71264970162721, 24.84385542262316, 25.976808337338067, 27.110589710299248, + 28.24551266781415, 31.08635983067475, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real cl35_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 1.8239985202970884e-05, 0.00020710907627919203, 0.0009431313908907785, 0.002698987769012708, + 0.005906875936599731, 0.010907713111778477, 0.017957319425972694, 0.027253766962590423, 0.0532486689285615, + 0.09021853774459236, 0.13964204799692437, 0.20296975189964023, 0.28111453407611076, 0.48000694295715063, + 0.7234556720351858, 0.9934362304976116, 1.2741578492636798, 1.5587085705331658, 1.841984804590114, + 2.123851640967086, 2.401400540781544, 2.678518379040114, 2.951823035315912, 3.6263403673750423, + 4.2878017299302265, 4.942008053022313, 5.588831725594207, 6.230448921378274, 6.870988813760575, + 7.509202522331103, 8.146128035678238, 8.781036938621131, 9.414973347970818, 10.049218022670182, + 10.681241237375588, 11.313867220369154, 11.943988875073773, 12.574031267727719, 13.204119982655925, + 13.831229693867064, 14.457881896733992, 15.086359830674748, 15.710963118995275, 16.33645973384853, + 16.96189547366785, 17.586587304671756, 18.212187604403958, 18.835056101720117, 19.45939248775923, + 20.08278537031645, 20.705863712283918, 21.33041377334919, 21.95375969173323, 23.20139712432045, + 24.450249108319362, 25.699837725867244, 26.950364854376122, 28.20139712432045, 29.456366033129044, + 30.71264970162721, 33.862131379313034, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ar36_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 4.342942647204277e-07, 2.3451268844214655e-05, 0.00023141729162330258, 0.0010622869460975197, + 0.0031540913067783544, 0.007135153007315866, 0.013474284663478431, 0.02245187936733961, 0.048771089883939175, + 0.08643600351808534, 0.13560900039779808, 0.1965840257248699, 0.2696980636423851, 0.45331834004703764, + 0.6848453616444125, 0.9585638832219674, 1.2624510897304295, 1.5809249756756194, 1.9057958803678685, + 2.230448921378274, 2.550228353055094, 2.8662873390841948, 3.1760912590556813, 3.929418925714293, + 4.657055852857104, 5.365487984890899, 6.060697840353612, 6.746634198937579, 7.426511261364575, + 8.100370545117563, 8.773054693364262, 9.442479769064448, 10.11058971029925, 10.77451696572855, + 11.437750562820387, 12.100370545117563, 12.758911892397974, 13.41664050733828, 14.071882007306126, + 14.727541257028557, 15.38201704257487, 16.03342375548695, 16.684845361644413, 17.33445375115093, + 17.983626287124533, 18.63144376901317, 19.27875360095283, 19.92582757462474, 20.57170883180869, + 21.217483944213907, 21.863322860120455, 22.50785587169583, 23.152288344383056, 24.440909082065218, + 25.72916478969277, 27.01703333929878, 28.305351369446623, 29.595496221825574, 30.885926339801433, + 32.17897694729317, 35.41329976408125, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real k39_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 3.908632748276029e-06, 3.4307908925770636e-05, + 0.00016282990201490303, 0.0005394928156396339, 0.0014074368520356395, 0.0031075244141559894, 0.010846721573671135, + 0.028297088943748088, 0.06095682921468604, 0.11414775667614005, 0.1912997955319451, 0.4132997640812518, + 0.7015679850559274, 1.0170333392987803, 1.3384564936046048, 1.6599162000698502, 1.9772662124272926, + 2.292256071356476, 2.6020599913279625, 2.910090545594068, 3.214843848047698, 3.9684829485539352, + 4.710963118995275, 5.444044795918076, 6.173186268412274, 6.897627091290442, 7.619093330626742, + 8.338456493604605, 9.056904851336473, 9.771587480881255, 10.48572142648158, 11.198657086954423, + 11.907948521612273, 12.6170003411209, 13.324282455297693, 14.02938377768521, 14.733999286538387, + 15.437750562820389, 16.139879086401237, 16.839478047374197, 17.539076098792776, 18.238046103128795, + 18.936513742478894, 19.633468455579585, 20.33041377334919, 21.02530586526477, 21.723455672035186, + 22.418301291319747, 23.113943352306837, 23.809559714635267, 24.505149978319906, 25.89542254603941, + 27.285557309007775, 28.678518379040113, 30.071882007306126, 31.465382851448418, 32.860936620700095, + 34.25767857486918, 37.761927838420526, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ca40_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 3.4743419578801875e-06, + 2.6056887215373325e-05, 0.00012419046343446514, 0.0004254001802063995, 0.0011532564515138494, 0.005324252203746658, + 0.016451245325404363, 0.03938040551055626, 0.07909980819723089, 0.13972800117379408, 0.33041377334919086, + 0.6063813651106049, 0.9385197251764918, 1.2988530764097066, 1.6693168805661123, 2.037426497940624, + 2.403120521175818, 2.761927838420529, 3.113943352306837, 3.459392487759231, 4.301029995663981, + 5.117271295655764, 5.9148718175400505, 6.701567985055927, 7.478566495593843, 8.250420002308894, + 9.01703333929878, 9.781036938621131, 10.540329474790873, 11.296665190261532, 12.049218022670182, + 12.801403710017356, 13.549003262025789, 14.294466226161592, 15.037426497940624, 15.779596491257825, + 16.518513939877888, 17.255272505103306, 17.99211148778695, 18.72591163229505, 19.45939248775923, + 20.19033169817029, 20.920645001406786, 21.650307523131936, 22.378397900948137, 23.10720996964787, + 23.832508912706235, 24.558708570533167, 25.285557309007775, 26.008600171761916, 27.45939248775923, + 28.907948521612273, 30.356025857193124, 31.804820678721164, 33.25285303097989, 34.704150516839796, + 36.15533603746506, 39.78816837114117, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real sc43_pf_array[npts_1] = { + 0.0, 1.7371744532199383e-06, 3.2136602621167924e-05, 0.0006088881229004689, 0.0026394223512168323, + 0.006348788305828209, 0.011375876688411647, 0.017242084547645732, 0.02355944464942603, 0.03006796257543875, + 0.03661053325876141, 0.06810122175372875, 0.09804672309111766, 0.12848424511267922, 0.16058766813472455, + 0.1946644458530261, 0.23055748142930874, 0.26792627543589265, 0.3064134462100847, 0.3856843680943845, + 0.4672642331672854, 0.5514418243762168, 0.6393550853495756, 0.732465412501299, 0.9380190974762103, + 1.1760912590556813, 1.4456042032735976, 1.7371926427047373, 2.0453229787866576, 2.359835482339888, + 2.678518379040114, 3.0, 3.322219294733919, 3.6424645202421213, 4.439332693830263, + 5.230448921378274, 6.017033339298781, 6.8020892578817325, 7.585460729508501, 8.36735592102602, + 9.14921911265538, 9.929418925714293, 10.710117365111817, 11.489958479424836, 12.267171728403014, + 13.045322978786658, 13.822168079368018, 14.597695185925513, 15.371067862271737, 16.146128035678238, + 16.916453948549925, 17.687528961214635, 18.45788189673399, 19.227886704613674, 19.99694924849538, + 20.76492298464989, 21.532754378992497, 22.30102999566398, 23.068185861746162, 23.835690571492425, + 24.602059991327963, 25.369215857410143, 26.136720567156406, 26.903632516084237, 28.439332693830263, + 29.97497199429807, 31.511883360978874, 33.05307844348342, 34.59217675739587, 36.13672056715641, + 37.68214507637383, 41.55870857053316, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ti44_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 4.342942647204277e-07, 1.7371744532199383e-06, + 7.382943437485089e-06, 0.0004987179011085028, 0.004043078170724821, 0.01413521502778782, 0.032426549056877405, + 0.05856115101668825, 0.09131586357749837, 0.1294359425571275, 0.17190802974603506, 0.2667731684215763, + 0.37035022176288673, 0.47788465213962983, 0.5860935485551829, 0.693748838923791, 0.9116901587538612, + 1.1522883443830565, 1.4409090820652177, 1.7788744720027396, 2.1522883443830563, 2.5415792439465807, + 2.9334872878487053, 3.322219294733919, 3.7041505168397992, 4.079181246047625, 4.996073654485276, + 5.885361220031512, 6.757396028793024, 7.619093330626742, 8.472756449317213, 9.32221929473392, + 10.167317334748176, 11.008600171761918, 11.85003325768977, 12.687528961214634, 13.52244423350632, + 14.354108439147401, 15.1846914308176, 16.012837224705173, 16.836956737059552, 17.65991620006985, + 18.481442628502304, 19.298853076409706, 20.117271295655765, 20.9329808219232, 21.746634198937578, + 22.559906625036113, 23.371067862271737, 24.181843587944773, 24.991226075692495, 25.799340549453582, + 26.60745502321467, 27.414973347970818, 28.220108088040057, 29.02530586526477, 30.63748972951251, + 32.247973266361804, 33.8561244442423, 35.46538285144842, 37.07554696139253, 38.68484536164441, + 40.29666519026153, 44.33041377334919, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real v47_pf_array[npts_1] = { + 2.518834949526704e-05, 0.0007584840322833457, 0.004226764680268442, 0.024475815916759104, 0.05998274311239668, + 0.10280266491559079, 0.14672973694476377, 0.1885209834473098, 0.22688178294786615, 0.2615226538586488, + 0.29260868165003595, 0.4071409645052156, 0.48021742410342627, 0.5329079468954852, 0.5750746363992424, + 0.6115960803783954, 0.6450760714077263, 0.6770396273057074, 0.708482088001612, 0.7725618227871047, + 0.8417322779915452, 0.9194240819892174, 1.0083997539725875, 1.110602503281611, 1.3560258571931227, + 1.651278013998144, 1.9813655090785445, 2.330413773349191, 2.6884198220027105, 3.0492180226701815, + 3.41161970596323, 3.7708520116421442, 4.127104798364807, 4.484299839346786, 5.365487984890899, + 6.238046103128795, 7.103803720955957, 7.967547976218862, 8.830588668685145, 9.69460519893357, + 10.557507201905658, 11.421603926869832, 12.285557309007773, 13.146128035678238, 14.008600171761918, + 14.869231719730976, 15.728353782021228, 16.586587304671756, 17.442479769064448, 18.298853076409706, + 19.152288344383056, 20.00432137378264, 20.85793526471943, 21.70926996097583, 22.559906625036113, + 23.409933123331296, 24.260071387985075, 25.10720996964787, 25.956648579205204, 26.804820678721164, + 27.652246341003323, 28.50105926221775, 29.34830486304816, 30.195899652409235, 31.891537457672566, + 33.588831725594204, 35.28555730900777, 36.985875357308394, 38.68752896121463, 40.39093510710338, + 42.096910013008056, 46.372912002970104, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real cr48_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 8.685880952436747e-07, 8.251516766996927e-06, 3.951899976600419e-05, 0.00013330794422173613, + 0.00035120219371925, 0.006401856055765157, 0.02685304570895992, 0.06215311825135839, 0.10696594975266842, + 0.15598699109465686, 0.205815844445829, 0.25471214514215257, 0.30198352738731143, 0.39152612205819926, + 0.47640596203905256, 0.5602400543128645, 0.6474755901642433, 0.7433846322638775, 0.983175072037813, + 1.3096301674258988, 1.7067177823367587, 2.1398790864012365, 2.577491799837225, 3.012837224705172, + 3.437750562820388, 3.8549130223078554, 4.264817823009537, 4.666517980554881, 5.648360010980932, + 6.606381365110605, 7.550228353055094, 8.484299839346786, 9.414973347970818, 10.340444114840118, + 11.264817823009537, 12.1846914308176, 13.103803720955957, 14.021189299069938, 14.935003151453655, + 15.846337112129806, 16.75511226639507, 17.66181268553726, 18.565847818673518, 19.468347330412158, + 20.369215857410143, 21.267171728403014, 22.161368002234976, 23.056904851336473, 23.94939000664491, + 24.840733234611807, 25.73078227566639, 26.619093330626743, 27.50785587169583, 28.394451680826215, + 29.281033367247726, 30.164352855784436, 31.049218022670182, 31.934498451243567, 33.70156798505593, + 35.46834733041216, 37.23299611039215, 38.99913054128737, 40.764922984649886, 42.5327543789925, + 44.30102999566398, 48.727541257028555, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real mn51_pf_array[npts_1] = { + 0.0, 0.0, 4.342942647204277e-07, 6.0362737871404116e-05, 0.0005954436481690331, + 0.002352703452491265, 0.0058636025937444025, 0.011219737158250306, 0.018191443590229183, 0.026405776501228783, + 0.035473365577059296, 0.08393991903492294, 0.12694077261184436, 0.16267998396542166, 0.19356340377635362, + 0.22185561141496238, 0.2491212785730439, 0.27638918590325057, 0.30436276263857276, 0.36442247019537943, + 0.4326074417788097, 0.5117005179251304, 0.6041057952026397, 0.7115562776994953, 0.9717395908877782, + 1.287801729930226, 1.640481436970422, 2.0170333392987803, 2.403120521175818, 2.7944880466591697, + 3.1903316981702914, 3.5854607295085006, 3.9827233876685453, 4.380211241711606, 5.372912002970106, + 6.363611979892144, 7.354108439147401, 8.342422680822207, 9.328379603438737, 10.311753861055754, + 11.292256071356476, 12.269512944217917, 13.24551266781415, 14.214843848047698, 15.1846914308176, + 16.14921911265538, 17.110589710299248, 18.071882007306126, 19.029383777685208, 19.985426474083003, + 20.93851972517649, 21.88986172125819, 22.839478047374197, 23.787460474518415, 24.73399928653839, + 25.67942789661212, 26.6232492903979, 27.56702636615906, 28.5092025223311, 29.45178643552429, + 30.392696953259666, 31.33445375115093, 32.27415784926368, 33.2148438480477, 35.093421685162234, + 36.97451169273733, 38.8555191556678, 40.737192642704734, 42.620136054973756, 44.505149978319906, + 46.392696953259666, 51.12057393120585, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real mn55_pf_array[npts_1] = { + 4.342942647204277e-07, 3.387364853334388e-05, 0.00038895363056868775, 0.004419831370155497, 0.014756522503960728, + 0.030096733930175052, 0.04796879437078968, 0.06646457923244158, 0.08445866292767418, 0.10139372238408119, + 0.1170521039752435, 0.17736880968990507, 0.2173557426191723, 0.247461626286143, 0.27333907966395066, + 0.29784648633228855, 0.3224882671969808, 0.3481517618665124, 0.3754616886642864, 0.43708831382108987, + 0.5113111854322745, 0.6017866255084809, 0.7113195335442632, 0.8411244873729985, 1.1553360374650619, + 1.5289167002776547, 1.931457870689005, 2.3502480183341627, 2.7781512503836434, 3.2068258760318495, + 3.639486489268586, 4.071882007306125, 4.505149978319906, 4.937016107464814, 6.017033339298781, + 7.096910013008056, 8.176091259055681, 9.252853030979892, 10.324282455297693, 11.394451680826217, + 12.460897842756548, 13.523746466811565, 14.583198773968622, 15.638489256954637, 16.69108149212297, + 17.73878055848437, 18.783903579272735, 19.826074802700827, 20.864511081058392, 21.90091306773767, + 22.935003151453653, 23.966610986681935, 24.996073654485276, 26.02530586526477, 27.049218022670182, + 28.07554696139253, 29.096910013008056, 30.12057393120585, 31.139879086401237, 32.16136800223497, + 33.18184358794477, 34.20139712432045, 35.22010808804006, 36.238046103128795, 38.27415784926368, + 40.311753861055756, 42.34830486304816, 44.38560627359831, 46.426511261364574, 48.46686762035411, + 50.51054501020661, 55.632457292184725, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real fe52_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 1.7371744532199383e-06, 9.554373504133797e-06, 3.778197643341552e-05, + 0.00011333607006293108, 0.0030242952161453874, 0.015422212189991184, 0.040215337130588114, 0.07478865660777631, + 0.11488541698288196, 0.15714990338033966, 0.19960737134331175, 0.24132628928072955, 0.3217032118192907, + 0.3993396534463543, 0.4778337814344742, 0.5623989859221217, 0.6594581913549248, 0.9153998352122699, + 1.2695129442179163, 1.6910814921229684, 2.143014800254095, 2.6009728956867484, 3.0569048513364727, + 3.503790683057181, 3.946452265013073, 4.383815365980431, 4.818225893613955, 5.888740960682893, + 6.944482672150168, 7.989894563718773, 9.02938377768521, 10.060697840353612, 11.086359830674748, + 12.11058971029925, 13.127104798364808, 14.139879086401237, 15.14921911265538, 16.152288344383056, + 17.152288344383056, 18.14921911265538, 19.143014800254097, 20.133538908370216, 21.12057393120585, + 22.103803720955955, 23.08635983067475, 24.06445798922692, 25.041392685158225, 26.01703333929878, + 26.989449817666692, 27.960946195733833, 28.930949031167522, 29.899273187317604, 30.8668778143375, + 31.833784374656478, 32.79934054945358, 33.76417613239033, 34.72835378202123, 36.655138434811384, + 38.58092497567562, 40.505149978319906, 42.42975228000241, 44.3541084391474, 46.28103336724773, + 48.20682587603185, 53.02938377768521, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real fe53_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 1.3028814913777444e-06, 6.080080186165502e-06, 2.0411360986187104e-05, + 5.384917717601842e-05, 0.00099773035779373, 0.004491618246634796, 0.011583129716232713, 0.02260939259680282, + 0.037536053829818145, 0.056184239286028684, 0.07836255359576534, 0.10393433162264984, 0.16508072986206487, + 0.2398955676994077, 0.3292351155694239, 0.43390673907557786, 0.5541592859186848, 0.8375884382355113, + 1.1702617153949575, 1.5314789170422551, 1.9148718175400503, 2.3096301674258988, 2.710963118995276, + 3.1172712956557644, 3.5276299008713385, 3.940516484932567, 4.3560258571931225, 5.396199347095736, + 6.440909082065217, 7.48572142648158, 8.52762990087134, 9.564666064252089, 10.597695185925513, + 11.626340367375043, 12.650307523131936, 13.669316880566113, 14.683947130751513, 15.69460519893357, + 16.700703717145018, 17.7041505168398, 18.70329137811866, 19.699837725867244, 20.693726948923647, + 21.684845361644413, 22.67394199863409, 23.65991620006985, 24.64542226934909, 25.62838893005031, + 26.60959440922522, 27.589949601325706, 28.569373909615045, 29.547774705387823, 30.525044807036846, + 31.50105926221775, 32.47712125471966, 33.45331834004704, 34.428134794028786, 36.37839790094814, + 38.32837960343874, 40.27875360095283, 42.230448921378276, 44.1846914308176, 46.13987908640124, + 48.096910013008056, 52.99956548822598, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real fe54_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 4.038750882690593e-05, 0.0006153933644858295, 0.0031795285189803882, 0.009608097244673557, + 0.021489478918632662, 0.039963481298721557, 0.06578505049986659, 0.09933285917375559, 0.18904568529064877, + 0.30450216050560097, 0.4386136969546961, 0.5858349639065905, 0.7435112541834851, 1.089905111439398, + 1.4727564493172123, 1.8864907251724818, 2.320146286111054, 2.760422483423212, 3.204119982655925, + 3.6503075231319366, 4.093421685162235, 4.539076098792776, 4.982271233039568, 6.089905111439398, + 7.190331698170292, 8.287801729930226, 9.378397900948137, 10.462397997898956, 11.539076098792776, + 12.61066016308988, 13.675778341674086, 14.734799829588846, 15.789580712164426, 16.838219221907625, + 17.88252453795488, 18.922206277439017, 19.957607287060096, 20.989449817666692, 22.01703333929878, + 23.041392685158225, 24.06445798922692, 25.08278537031645, 26.100370545117563, 27.113943352306837, + 28.127104798364808, 29.136720567156406, 30.146128035678238, 31.155336037465062, 32.16136800223497, + 33.164352855784436, 34.17026171539496, 35.17318626841227, 36.17609125905568, 38.17897694729317, + 40.18184358794477, 42.18184358794477, 44.18184358794477, 46.1846914308176, 48.1846914308176, + 50.18752072083646, 55.204119982655925, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real fe55_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 1.3028814913777444e-06, + 1.5634319932414176e-05, 7.599488497457784e-05, 0.0002370600756061832, 0.0005564089438241259, 0.0010813488014597976, + 0.0018431377713960377, 0.009434322601068017, 0.022947317188587973, 0.04207202183227031, 0.06669370834774807, + 0.09644559083435453, 0.13073538555922604, 0.1689268514992448, 0.210470482925873, 0.30216484315823844, + 0.40437472924396634, 0.5173772341350337, 0.6421575367181118, 0.7795497407641858, 1.089905111439398, + 1.4471580313422192, 1.8312296938670634, 2.2355284469075487, 2.649334858712142, 3.0718820073061255, + 3.496929648073215, 3.926856708949692, 4.359835482339888, 4.79309160017658, 5.8819549713396, + 6.973589623427257, 8.064457989226918, 9.14921911265538, 10.232996110392154, 11.307496037913213, + 12.378397900948137, 13.444044795918076, 14.503790683057181, 15.558708570533165, 16.608526033577196, + 17.65417654187796, 18.69635638873333, 19.73399928653839, 20.768638101247614, 21.800029359244135, + 22.82865989653532, 23.854913022307855, 24.878521795501207, 25.899820502427097, 26.91960102378411, + 27.937517892017347, 28.954242509439325, 29.96941591235398, 30.983626287124533, 31.99694924849538, + 33.00860017176192, 34.02118929906994, 35.03342375548695, 36.04532297878666, 38.064457989226916, + 40.086359830674745, 42.10720996964787, 44.127104798364805, 46.15228834438306, 48.17609125905568, + 50.20139712432045, 55.28103336724773, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real fe56_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 1.7371744532199383e-06, 9.988658214691801e-06, 3.951899976600419e-05, + 0.00011724368292883856, 0.0030902761496993327, 0.0156878675130911, 0.04089651650139037, 0.07635858866725904, + 0.11828391003740016, 0.16392102383975418, 0.21196213905930564, 0.2621108778253895, 0.36964919324674056, + 0.4887648498436591, 0.6206486780522652, 0.76578080127876, 0.924731337394998, 1.2855573090077739, + 1.6972293427597176, 2.143014800254095, 2.606381365110605, 3.0718820073061255, 3.5403294747908736, + 4.004321373782642, 4.468347330412158, 4.928395852256714, 5.38738982633873, 6.5276299008713385, + 7.660865478003869, 8.788168371141168, 9.909556029241175, 11.02530586526477, 12.136720567156408, + 13.2405492482826, 14.340444114840118, 15.432969290874405, 16.52244423350632, 17.606381365110604, + 18.686636269262294, 19.76192783842053, 20.833147111912787, 21.90036712865647, 22.96473092105363, + 24.02530586526477, 25.08278537031645, 26.139879086401237, 27.193124598354462, 28.243038048686294, + 29.292256071356476, 30.338456493604603, 31.383815365980432, 32.428134794028786, 33.46982201597816, + 34.51188336097887, 35.552668216112195, 36.59217675739587, 37.631443769013174, 39.70842090013471, + 41.78390357927273, 43.85913829729453, 45.93449845124357, 48.00860017176192, 50.086359830674745, + 52.164352855784436, 57.37106786227174, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real co55_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 8.685880952436747e-07, 1.4331481434642371e-05, 9.336327741651445e-05, + 0.00038114325769492564, 0.001151090732337307, 0.0028275866787247843, 0.0059861278100218065, 0.019727612600003865, + 0.049238961363648255, 0.10167663281566902, 0.18228879723157643, 0.29243817096179087, 0.5865873046717549, + 0.9449759084120479, 1.3324384599156054, 1.7363965022766423, 2.1492191126553797, 2.56702636615906, + 2.991226075692495, 3.419955748489758, 3.851869600729766, 4.2878017299302265, 5.382017042574868, + 6.482873583608754, 7.5820633629117085, 8.677606952720494, 9.767155866082181, 10.85003325768977, + 11.927370363039023, 12.998695158311655, 14.064457989226918, 15.127104798364808, 16.181843587944773, + 17.232996110392154, 18.281033367247726, 19.32428245529769, 20.3654879848909, 21.401400540781545, + 22.436162647040756, 23.468347330412158, 24.4983105537896, 25.525044807036846, 26.550228353055093, + 27.57403126772772, 28.59659709562646, 29.6170003411209, 30.636487896353366, 31.65609820201283, + 32.673941998634085, 33.69108149212297, 34.70757017609794, 35.72427586960079, 37.75587485567249, + 39.786751422145564, 41.818225893613956, 43.850033257689766, 45.88309335857569, 47.91750550955255, + 49.954242509439325, 55.05690485133647, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real co56_pf_array[npts_1] = { + 0.0, 1.7371744532199383e-06, 3.4307908925770636e-05, 0.0007363730997827178, 0.003397192878964486, + 0.008467734331585224, 0.01550645173957485, 0.0238164702394971, 0.03279759856010612, 0.04203693696495622, + 0.05128645751287552, 0.09519865223967466, 0.13622861655702886, 0.176714169466867, 0.21729965897649603, + 0.2578772011708393, 0.2983265845453606, 0.3387098245578885, 0.3792523836931725, 0.46216521358362883, + 0.5500314690476197, 0.6456769741905006, 0.7513340033440492, 0.8684365267163909, 1.1367205671564067, + 1.4517864355242902, 1.7986506454452689, 2.1702617153949575, 2.5599066250361124, 2.9614210940664485, + 3.3729120029701067, 3.7902851640332416, 4.214843848047698, 4.6414741105041, 5.723455672035186, + 6.814913181275074, 7.9084850188786495, 9.0, 10.089905111439398, 11.173186268412275, + 12.250420002308894, 13.32633586092875, 14.394451680826217, 15.459392487759231, 16.521138083704038, + 17.577491799837226, 18.630427875025024, 19.680335513414562, 20.727541257028555, 21.77232170672292, + 22.81358098856819, 23.853089529851864, 24.890979596989688, 25.926856708949693, 26.960946195733833, + 27.99387691494121, 29.02530586526477, 30.056904851336473, 31.08635983067475, 32.11727129565576, + 33.14612803567824, 34.17318626841227, 35.20139712432045, 36.230448921378276, 38.28555730900777, + 40.3424226808222, 42.39967372148104, 44.45939248775923, 46.52113808370404, 48.5854607295085, + 50.651278013998144, 55.831229693867066, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real co57_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 4.342942647204277e-07, 4.994099386680048e-05, 0.0005963110461953748, 0.0027783956198411766, 0.008035647971175024, + 0.017613403025029208, 0.03234391616743567, 0.05264970241280307, 0.07864673504318612, 0.14731854080928636, + 0.23700682147881122, 0.34629017327562855, 0.47392017252998775, 0.6185154181425263, 0.9503648543761231, + 1.3263358609287514, 1.7299742856995557, 2.1492191126553797, 2.57978359661681, 3.0170333392987803, + 3.456366033129043, 3.900913067737669, 4.348304863048161, 4.795880017344075, 5.922206277439017, + 7.05307844348342, 8.178976947293169, 9.30319605742049, 10.423245873936807, 11.537819095073274, + 12.64640372622307, 13.751279103983343, 14.850646235183067, 15.94546858513182, 17.037426497940622, + 18.12057393120585, 19.204119982655925, 20.28330122870355, 21.357934847000454, 22.431363764158988, + 23.50105926221775, 24.568201724066995, 25.632457292184725, 26.69635638873333, 27.757396028793025, + 28.81690383937566, 29.87563993700417, 30.93247376467715, 31.989004615698537, 33.04532297878666, + 34.10037054511756, 35.15228834438306, 36.20682587603185, 37.26007138798507, 39.3654879848909, + 41.47275644931721, 43.578639209968074, 45.686636269262294, 47.79657433321043, 49.90794852161227, + 52.02118929906994, 57.31806333496276, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ni56_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 4.342942647204277e-07, 7.817230319428646e-06, 6.42708273977769e-05, + 0.0002904458650804842, 0.0009123622824012837, 0.0022498876258026487, 0.0046944487518873, 0.014735532704563181, + 0.03529042138996706, 0.07190703372466718, 0.13162956968664008, 0.22190042758492473, 0.5092025223311029, + 0.9132839017604184, 1.374748346010104, 1.8555191556678001, 2.3404441148401185, 2.8221680793680175, + 3.3031960574204886, 3.783903579272735, 4.26245108973043, 4.7419390777291985, 5.9344984512435675, + 7.117271295655764, 8.292256071356476, 9.456366033129044, 10.608526033577194, 11.750508394851346, + 12.88309335857569, 14.008600171761918, 15.123851640967086, 16.232996110392154, 17.33645973384853, + 18.432969290874407, 19.525044807036846, 20.612783856719737, 21.695481676490196, 22.773786444981194, + 23.8481891169914, 24.919078092376076, 25.987219229908003, 27.053078443483418, 28.113943352306837, + 29.17609125905568, 30.232996110392154, 31.287801729930226, 32.3424226808222, 33.39619934709574, + 34.44715803134222, 35.49692964807321, 36.54530711646582, 37.594392550375424, 39.68752896121463, + 41.77959649125783, 43.86981820797933, 45.959518376973, 48.04921802267018, 50.13987908640124, + 52.230448921378276, 57.462397997898954, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ni57_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 4.342942647204277e-07, 1.7371744532199383e-06, 9.554373504133797e-06, 3.257086475060328e-05, + 8.771862606148251e-05, 0.0017410663385697559, 0.007809206274475302, 0.01921477477459369, 0.03493231633712192, + 0.05345799700199783, 0.07364137994668778, 0.0948950837519807, 0.11713833477999397, 0.16608656859343765, + 0.22565890312281184, 0.3025878355093501, 0.4025382106894563, 0.5279492540555757, 0.8463371121298052, + 1.2253092817258628, 1.631443769013172, 2.05307844348342, 2.484299839346786, 2.9237619608287004, + 3.369215857410143, 3.8188854145940097, 4.27415784926368, 4.731588765186738, 5.884795363948981, + 7.041392685158225, 8.195899652409233, 9.344392273685111, 10.482873583608754, 11.613841821876068, + 12.736396502276643, 13.851258348719075, 14.959041392321094, 16.060697840353612, 17.15836249209525, + 18.247973266361807, 19.332438459915604, 20.414973347970818, 21.492760389026838, 22.565847818673518, + 23.636487896353366, 24.7041505168398, 25.768638101247614, 26.831229693867062, 27.89209460269048, + 28.950851458888547, 30.008600171761916, 31.06445798922692, 32.11727129565576, 33.17026171539496, + 34.222716471147585, 35.27415784926368, 36.32633586092875, 37.376576957056514, 39.478566495593846, + 41.578639209968074, 43.67851837904011, 45.77959649125783, 47.88252453795488, 49.98721922990801, + 52.093421685162234, 57.372912002970104, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ni58_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 2.822822391636452e-05, 0.0004722555358597003, 0.0025858928325085315, 0.008151594991554035, + 0.018820703394680185, 0.03585661791649524, 0.060127596252288286, 0.09212527438468374, 0.17939292292561174, + 0.29475734836761314, 0.43276876399762537, 0.5886922364625494, 0.7597527315231631, 1.1398790864012365, + 1.5670263661590604, 2.0211892990699383, 2.4913616938342726, 2.968015713993642, 3.4471580313422194, + 3.9253120914996495, 4.4048337166199385, 4.884795363948981, 5.363611979892144, 6.561101383649056, + 7.754348335711019, 8.94101424370557, 10.12057393120585, 11.290034611362518, 12.45178643552429, + 13.60530504614111, 14.752048447819439, 15.89209460269048, 17.02530586526477, 18.155336037465062, + 19.276461804173245, 20.394451680826215, 21.50650503240487, 22.6159500516564, 23.72098574415374, + 24.822168079368016, 25.920123326290724, 27.01703333929878, 28.10720996964787, 29.198657086954423, + 30.285557309007775, 31.371067862271737, 32.456366033129044, 33.539076098792776, 34.620136054973756, + 35.70070371714502, 36.78031731214015, 37.85853719756964, 38.936513742478894, 41.0899051114394, + 43.243038048686294, 45.39619934709574, 47.549003262025785, 49.70156798505593, 51.8561244442423, + 54.01283722470517, 59.41161970596323, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real cu59_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 2.605759074128604e-06, 1.650287675964334e-05, 6.340236609775624e-05, 0.00017585365720844043, 0.000390689249910088, + 0.0007428764320814314, 0.005397605476010478, 0.015802627271542913, 0.03197570643412326, 0.05338618387681151, + 0.07956831941607957, 0.11034623515591226, 0.1458282690543422, 0.18630242506533595, 0.2835775511211497, + 0.4040800579842662, 0.5475464254977157, 0.71148885462942, 0.8921585172262729, 1.2855573090077739, + 1.7075701760979363, 2.143014800254095, 2.5888317255942073, 3.037426497940624, 3.4913616938342726, + 3.9479236198317262, 4.4048337166199385, 4.865103974641128, 5.324282455297693, 6.480006942957151, + 7.6344772701607315, 8.788168371141168, 9.939019776448667, 11.086359830674748, 12.227886704613674, + 13.36735592102602, 14.501059262217751, 15.630427875025024, 16.75587485567249, 17.877946951629188, + 18.99563519459755, 20.110589710299248, 21.22271647114758, 22.33041377334919, 23.436162647040756, + 24.540329474790873, 25.6414741105041, 26.741151598851786, 27.838849090737256, 28.934498451243567, + 30.029383777685208, 31.123851640967086, 32.2148438480477, 33.30749603791321, 34.39967372148104, + 35.489958479424836, 36.58092497567562, 37.67117284271508, 38.76042248342321, 40.940516484932566, + 43.12057393120585, 45.303196057420486, 47.48572142648158, 49.67117284271508, 51.85913829729453, + 54.04921802267018, 59.54032947479087, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real zn60_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 8.685880952436747e-07, 5.211502513843472e-06, + 1.8674261228107377e-05, 0.0009166960915506938, 0.006364623716448546, 0.020197147995473213, 0.043233346133400956, + 0.07391108301493142, 0.10997790066148228, 0.14954178751803532, 0.19143452549394308, 0.2810122204570727, + 0.3812506749896455, 0.4993433592273684, 0.6430235987933117, 0.8169781794613935, 1.2479732663618066, + 1.7512791039833422, 2.2764618041732443, 2.8055008581584002, 3.3283796034387376, 3.845098040014257, + 4.354108439147401, 4.859138297294531, 5.357934847000454, 5.854913022307856, 7.08278537031645, + 8.301029995663981, 9.509202522331103, 10.710117365111817, 11.90471554527868, 13.093421685162236, + 14.278753600952829, 15.457881896733992, 16.63144376901317, 17.800717078282386, 18.965671971220107, + 20.127104798364808, 21.28330122870355, 22.436162647040756, 23.5854607295085, 24.73158876518674, + 25.8750612633917, 27.01703333929878, 28.152288344383056, 29.29003461136252, 30.423245873936807, + 31.55509444857832, 32.68574173860226, 33.814913181275074, 34.94250410616808, 36.06818586174616, + 37.19589965240923, 38.320146286111054, 39.444044795918074, 40.568201724066995, 42.814913181275074, + 45.06069784035361, 47.30749603791321, 49.552668216112195, 51.80071707828238, 54.04921802267018, + 56.30102999566398, 61.93851972517649, + }; + + + + // interpolation routine + + template + AMREX_GPU_HOST_DEVICE AMREX_INLINE + void interpolate_pf(const Real t9, const Real (&temp_array)[npts], const Real (&pf_array)[npts], + Real& pf, Real& dpf_dT) { + + if (t9 >= temp_array[0] && t9 < temp_array[npts-1]) { + + // find the largest temperature element <= t9 using a binary search + + int left = 0; + int right = npts; + + while (left < right) { + int mid = (left + right) / 2; + if (temp_array[mid] > t9) { + right = mid; + } else { + left = mid + 1; + } + } + + const int idx = right - 1; + + // now we have temp_array[idx] <= t9 < temp_array[idx+1] + + // construct the slope -- this is (log10(pf_{i+1}) - log10(pf_i)) / (T_{i+1} - T_i) + + Real slope = (pf_array[idx+1] - pf_array[idx]) / (temp_array[idx+1] - temp_array[idx]); + + // find the PF + + Real log10_pf = pf_array[idx] + slope * (t9 - temp_array[idx]); + pf = std::pow(10.0_rt, log10_pf); + + // find the derivative (with respect to T, not T9) + + Real dpf_dT9 = pf * M_LN10 * slope; + dpf_dT = dpf_dT9 / 1.e9_rt; + + } else { + + // T < the smallest T or >= the largest T in the partition function table + pf = 1.0; + dpf_dT = 0.0; + + } + + } + +} + +// main interface + +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactors, + Real& pf, Real& dpf_dT) { + + // inuc is the 1-based index for the species + + switch (inuc) { + + case O16: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::o16_pf_array, pf, dpf_dT); + break; + + case F18: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::f18_pf_array, pf, dpf_dT); + break; + + case Ne20: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ne20_pf_array, pf, dpf_dT); + break; + + case Ne21: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ne21_pf_array, pf, dpf_dT); + break; + + case Na22: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::na22_pf_array, pf, dpf_dT); + break; + + case Na23: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::na23_pf_array, pf, dpf_dT); + break; + + case Mg24: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::mg24_pf_array, pf, dpf_dT); + break; + + case Al27: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::al27_pf_array, pf, dpf_dT); + break; + + case Si28: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::si28_pf_array, pf, dpf_dT); + break; + + case P31: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::p31_pf_array, pf, dpf_dT); + break; + + case S32: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::s32_pf_array, pf, dpf_dT); + break; + + case Cl35: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::cl35_pf_array, pf, dpf_dT); + break; + + case Ar36: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ar36_pf_array, pf, dpf_dT); + break; + + case K39: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::k39_pf_array, pf, dpf_dT); + break; + + case Ca40: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ca40_pf_array, pf, dpf_dT); + break; + + case Sc43: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::sc43_pf_array, pf, dpf_dT); + break; + + case Ti44: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ti44_pf_array, pf, dpf_dT); + break; + + case V47: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::v47_pf_array, pf, dpf_dT); + break; + + case Cr48: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::cr48_pf_array, pf, dpf_dT); + break; + + case Mn51: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::mn51_pf_array, pf, dpf_dT); + break; + + case Mn55: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::mn55_pf_array, pf, dpf_dT); + break; + + case Fe52: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::fe52_pf_array, pf, dpf_dT); + break; + + case Fe53: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::fe53_pf_array, pf, dpf_dT); + break; + + case Fe54: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::fe54_pf_array, pf, dpf_dT); + break; + + case Fe55: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::fe55_pf_array, pf, dpf_dT); + break; + + case Fe56: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::fe56_pf_array, pf, dpf_dT); + break; + + case Co55: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::co55_pf_array, pf, dpf_dT); + break; + + case Co56: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::co56_pf_array, pf, dpf_dT); + break; + + case Co57: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::co57_pf_array, pf, dpf_dT); + break; + + case Ni56: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ni56_pf_array, pf, dpf_dT); + break; + + case Ni57: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ni57_pf_array, pf, dpf_dT); + break; + + case Ni58: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ni58_pf_array, pf, dpf_dT); + break; + + case Cu59: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::cu59_pf_array, pf, dpf_dT); + break; + + case Zn60: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::zn60_pf_array, pf, dpf_dT); + break; + + + default: + + pf = 1.0_rt; + dpf_dT = 0.0_rt; + + } + +} + +// spins + +AMREX_GPU_HOST_DEVICE AMREX_INLINE +constexpr Real get_spin_state(const int inuc) { + + Real spin = -1.0; + + switch (inuc) { + + case He4: + case C12: + case O16: + case Ne20: + case Mg24: + case Si28: + case S32: + case Ar36: + case Ca40: + case Ti44: + case Cr48: + case Fe52: + case Fe54: + case Fe56: + case Ni56: + case Ni58: + case Zn60: + spin = 1; + break; + + case N: + case H1: + case N13: + case P31: + spin = 2; + break; + + case N14: + case F18: + spin = 3; + break; + + case Ne21: + case Na23: + case Fe55: + case Ni57: + case Cu59: + case Cl35: + case K39: + case V47: + spin = 4; + break; + + case Al27: + case Mn51: + case Mn55: + spin = 6; + break; + + case Na22: + spin = 7; + break; + + case Fe53: + case Co55: + case Co57: + case Sc43: + spin = 8; + break; + + case Co56: + spin = 9; + break; + + + } + + return spin; + +} + + +#endif diff --git a/networks/He-C-Fe-group/pynucastro.net b/networks/He-C-Fe-group/pynucastro.net new file mode 100644 index 0000000000..70dad9af7b --- /dev/null +++ b/networks/He-C-Fe-group/pynucastro.net @@ -0,0 +1,40 @@ +neutron n 1.0 0.0 +hydrogen-1 h1 1.0 1.0 +helium-4 he4 4.0 2.0 +carbon-12 c12 12.0 6.0 +nitrogen-13 n13 13.0 7.0 +nitrogen-14 n14 14.0 7.0 +oxygen-16 o16 16.0 8.0 +fluorine-18 f18 18.0 9.0 +neon-20 ne20 20.0 10.0 +neon-21 ne21 21.0 10.0 +sodium-22 na22 22.0 11.0 +sodium-23 na23 23.0 11.0 +magnesium-24 mg24 24.0 12.0 +aluminum-27 al27 27.0 13.0 +silicon-28 si28 28.0 14.0 +phosphorus-31 p31 31.0 15.0 +sulfur-32 s32 32.0 16.0 +argon-36 ar36 36.0 18.0 +calcium-40 ca40 40.0 20.0 +titanium-44 ti44 44.0 22.0 +chromium-48 cr48 48.0 24.0 +manganese-51 mn51 51.0 25.0 +manganese-55 mn55 55.0 25.0 +iron-52 fe52 52.0 26.0 +iron-53 fe53 53.0 26.0 +iron-54 fe54 54.0 26.0 +iron-55 fe55 55.0 26.0 +iron-56 fe56 56.0 26.0 +cobalt-55 co55 55.0 27.0 +cobalt-56 co56 56.0 27.0 +cobalt-57 co57 57.0 27.0 +nickel-56 ni56 56.0 28.0 +nickel-57 ni57 57.0 28.0 +nickel-58 ni58 58.0 28.0 +copper-59 cu59 59.0 29.0 +zinc-60 zn60 60.0 30.0 +__extra_chlorine-35 cl35 35.0 17.0 +__extra_potassium-39 k39 39.0 19.0 +__extra_scandium-43 sc43 43.0 21.0 +__extra_vanadium-47 v47 47.0 23.0 diff --git a/networks/He-C-Fe-group/reaclib_rates.H b/networks/He-C-Fe-group/reaclib_rates.H new file mode 100644 index 0000000000..b8a5a86910 --- /dev/null +++ b/networks/He-C-Fe-group/reaclib_rates.H @@ -0,0 +1,9303 @@ +#ifndef REACLIB_RATES_H +#define REACLIB_RATES_H + +#include +#include + +#include +#include +#include + +using namespace Rates; +using namespace Species; + +struct rate_t { + Array1D screened_rates; + Array1D add_energy_rate; +}; + +struct rate_derivs_t { + Array1D screened_rates; + Array1D dscreened_rates_dT; + Array1D add_energy_rate; +}; + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_c12_to_n13(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 + p --> n13 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ls09n + ln_set_rate = 17.1482 + -13.692 * tfactors.T913i + -0.230881 * tfactors.T913 + + 4.44362 * tfactors.T9 + -3.15898 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -13.692 * tfactors.T943i + (1.0/3.0) * -0.230881 * tfactors.T923i + + 4.44362 + (5.0/3.0) * -3.15898 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // ls09r + ln_set_rate = 17.5428 + -3.77849 * tfactors.T9i + -5.10735 * tfactors.T913i + -2.24111 * tfactors.T913 + + 0.148883 * tfactors.T9 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.77849 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.10735 * tfactors.T943i + (1.0/3.0) * -2.24111 * tfactors.T923i + + 0.148883 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_c12_to_o16(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 + he4 --> o16 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // nac2 + ln_set_rate = 254.634 + -1.84097 * tfactors.T9i + 103.411 * tfactors.T913i + -420.567 * tfactors.T913 + + 64.0874 * tfactors.T9 + -12.4624 * tfactors.T953 + 137.303 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.84097 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 103.411 * tfactors.T943i + (1.0/3.0) * -420.567 * tfactors.T923i + + 64.0874 + (5.0/3.0) * -12.4624 * tfactors.T923 + 137.303 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nac2 + ln_set_rate = 69.6526 + -1.39254 * tfactors.T9i + 58.9128 * tfactors.T913i + -148.273 * tfactors.T913 + + 9.08324 * tfactors.T9 + -0.541041 * tfactors.T953 + 70.3554 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.39254 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 58.9128 * tfactors.T943i + (1.0/3.0) * -148.273 * tfactors.T923i + + 9.08324 + (5.0/3.0) * -0.541041 * tfactors.T923 + 70.3554 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_n14_to_f18(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // n14 + he4 --> f18 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10n + ln_set_rate = 21.5339 + -36.2504 * tfactors.T913i + + -5.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -36.2504 * tfactors.T943i + + (5.0/3.0) * -5.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 13.8995 + -10.9656 * tfactors.T9i + -5.6227 * tfactors.T913i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 10.9656 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.6227 * tfactors.T943i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 0.196838 + -5.16034 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.16034 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_o16_to_ne20(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + he4 --> ne20 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // co10r + ln_set_rate = 9.50848 + -12.7643 * tfactors.T9i + -3.65925 * tfactors.T913 + + 0.714224 * tfactors.T9 + -0.00107508 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.7643 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -3.65925 * tfactors.T923i + + 0.714224 + (5.0/3.0) * -0.00107508 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // co10r + ln_set_rate = 3.88571 + -10.3585 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 10.3585 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // co10n + ln_set_rate = 23.903 + -39.7262 * tfactors.T913i + -0.210799 * tfactors.T913 + + 0.442879 * tfactors.T9 + -0.0797753 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.7262 * tfactors.T943i + (1.0/3.0) * -0.210799 * tfactors.T923i + + 0.442879 + (5.0/3.0) * -0.0797753 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_f18_to_na22(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // f18 + he4 --> na22 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // rpsmr + ln_set_rate = 35.3786 + -1.82957 * tfactors.T9i + 18.8956 * tfactors.T913i + -65.6134 * tfactors.T913 + + 1.71114 * tfactors.T9 + -0.0260999 * tfactors.T953 + 37.8396 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.82957 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 18.8956 * tfactors.T943i + (1.0/3.0) * -65.6134 * tfactors.T923i + + 1.71114 + (5.0/3.0) * -0.0260999 * tfactors.T923 + 37.8396 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ne20_to_mg24(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ne20 + he4 --> mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -38.7055 + -2.50605 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.50605 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 24.5058 + -46.2525 * tfactors.T913i + 5.58901 * tfactors.T913 + + 7.61843 * tfactors.T9 + -3.683 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -46.2525 * tfactors.T943i + (1.0/3.0) * 5.58901 * tfactors.T923i + + 7.61843 + (5.0/3.0) * -3.683 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -8.79827 + -12.7809 * tfactors.T9i + 16.9229 * tfactors.T913 + + -2.57325 * tfactors.T9 + 0.208997 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.7809 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 16.9229 * tfactors.T923i + + -2.57325 + (5.0/3.0) * 0.208997 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 1.98307 + -9.22026 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 9.22026 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_ne21_to_na22(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ne21 + p --> na22 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -47.6554 + -0.19618 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.19618 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 19.0696 + -19.2096 * tfactors.T913i + + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -19.2096 * tfactors.T943i + + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -39.4862 + -4.21385 * tfactors.T9i + 21.1176 * tfactors.T913i + 34.0411 * tfactors.T913 + + -4.45593 * tfactors.T9 + 0.328613 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.21385 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.1176 * tfactors.T943i + (1.0/3.0) * 34.0411 * tfactors.T923i + + -4.45593 + (5.0/3.0) * 0.328613 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 1.75704 + -1.39957 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.39957 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_na23_to_mg24(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // na23 + p --> mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10n + ln_set_rate = 18.9075 + -20.6428 * tfactors.T913i + 1.52954 * tfactors.T913 + + 2.7487 * tfactors.T9 + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -20.6428 * tfactors.T943i + (1.0/3.0) * 1.52954 * tfactors.T923i + + 2.7487 + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 9.0594 + -3.28029 * tfactors.T9i + -0.360588 * tfactors.T913 + + 1.4187 * tfactors.T9 + -0.184061 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.28029 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.360588 * tfactors.T923i + + 1.4187 + (5.0/3.0) * -0.184061 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -5.02585 + -1.61219 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.61219 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_mg24_to_si28(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mg24 + he4 --> si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // st08r + ln_set_rate = -50.5494 + -12.8332 * tfactors.T9i + 21.3721 * tfactors.T913i + 37.7649 * tfactors.T913 + + -4.10635 * tfactors.T9 + 0.249618 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.8332 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.3721 * tfactors.T943i + (1.0/3.0) * 37.7649 * tfactors.T923i + + -4.10635 + (5.0/3.0) * 0.249618 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // st08r + ln_set_rate = 8.03977 + -15.629 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 15.629 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_al27_to_si28(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // al27 + p --> si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -13.6664 + -1.90396 * tfactors.T9i + 23.8634 * tfactors.T913 + + -3.70135 * tfactors.T9 + 0.28964 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.90396 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 23.8634 * tfactors.T923i + + -3.70135 + (5.0/3.0) * 0.28964 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 86.0234 + -0.387313 * tfactors.T9i + -26.8327 * tfactors.T913i + -116.137 * tfactors.T913 + + 0.00950567 * tfactors.T9 + 0.00999755 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.387313 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -26.8327 * tfactors.T943i + (1.0/3.0) * -116.137 * tfactors.T923i + + 0.00950567 + (5.0/3.0) * 0.00999755 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 21.1065 + -23.2205 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -23.2205 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_si28_to_s32(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // si28 + he4 --> s32 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 47.9212 + -59.4896 * tfactors.T913i + 4.47205 * tfactors.T913 + + -4.78989 * tfactors.T9 + 0.557201 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -59.4896 * tfactors.T943i + (1.0/3.0) * 4.47205 * tfactors.T923i + + -4.78989 + (5.0/3.0) * 0.557201 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_p31_to_s32(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // p31 + p --> s32 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = 0.821556 + -3.77704 * tfactors.T9i + 8.09341 * tfactors.T913 + + -0.615971 * tfactors.T9 + 0.031159 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.77704 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 8.09341 * tfactors.T923i + + -0.615971 + (5.0/3.0) * 0.031159 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -2.66839 + -2.25958 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.25958 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 19.2596 + -25.3278 * tfactors.T913i + 6.4931 * tfactors.T913 + + -9.27513 * tfactors.T9 + -0.610439 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -25.3278 * tfactors.T943i + (1.0/3.0) * 6.4931 * tfactors.T923i + + -9.27513 + (5.0/3.0) * -0.610439 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_cr48_to_fe52(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cr48 + he4 --> fe52 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 65.1754 + -86.7459 * tfactors.T913i + -9.79373 * tfactors.T913 + + -0.772169 * tfactors.T9 + 0.155883 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * -9.79373 * tfactors.T923i + + -0.772169 + (5.0/3.0) * 0.155883 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_mn51_to_fe52(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn51 + p --> fe52 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.2596 + -36.1825 * tfactors.T913i + 0.873042 * tfactors.T913 + + -2.89731 * tfactors.T9 + 0.364394 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -36.1825 * tfactors.T943i + (1.0/3.0) * 0.873042 * tfactors.T923i + + -2.89731 + (5.0/3.0) * 0.364394 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_mn51_to_co55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn51 + he4 --> co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 65.9219 + -89.274 * tfactors.T913i + -10.4373 * tfactors.T913 + + 1.00492 * tfactors.T9 + -0.125548 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -10.4373 * tfactors.T923i + + 1.00492 + (5.0/3.0) * -0.125548 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe52_to_ni56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe52 + he4 --> ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 66.6417 + -91.6819 * tfactors.T913i + -9.51885 * tfactors.T913 + + -0.533014 * tfactors.T9 + 0.0892607 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -9.51885 * tfactors.T923i + + -0.533014 + (5.0/3.0) * 0.0892607 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co55_to_ni56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + p --> ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 37.3736 + -38.1053 * tfactors.T913i + -0.210947 * tfactors.T913 + + -2.68377 * tfactors.T9 + 0.355814 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1053 * tfactors.T943i + (1.0/3.0) * -0.210947 * tfactors.T923i + + -2.68377 + (5.0/3.0) * 0.355814 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_co55_to_cu59(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + he4 --> cu59 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 65.2921 + -94.1404 * tfactors.T913i + -2.62786 * tfactors.T913 + + -2.12066 * tfactors.T9 + 0.237999 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * -2.62786 * tfactors.T923i + + -2.12066 + (5.0/3.0) * 0.237999 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ni56_to_zn60(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 + he4 --> zn60 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 61.0733 + -96.4898 * tfactors.T913i + 6.47209 * tfactors.T913 + + -5.2029 * tfactors.T9 + 0.533391 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -96.4898 * tfactors.T943i + (1.0/3.0) * 6.47209 * tfactors.T923i + + -5.2029 + (5.0/3.0) * 0.533391 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_cu59_to_zn60(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cu59 + p --> zn60 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 37.226 + -39.9808 * tfactors.T913i + 1.17311 * tfactors.T913 + + -2.90486 * tfactors.T9 + 0.339644 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 1.17311 * tfactors.T923i + + -2.90486 + (5.0/3.0) * 0.339644 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_c12_to_p_na23(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 + c12 --> p + na23 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 60.9649 + -84.165 * tfactors.T913i + -1.4191 * tfactors.T913 + + -0.114619 * tfactors.T9 + -0.070307 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -84.165 * tfactors.T943i + (1.0/3.0) * -1.4191 * tfactors.T923i + + -0.114619 + (5.0/3.0) * -0.070307 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_c12_to_he4_ne20(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 + c12 --> he4 + ne20 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 61.2863 + -84.165 * tfactors.T913i + -1.56627 * tfactors.T913 + + -0.0736084 * tfactors.T9 + -0.072797 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -84.165 * tfactors.T943i + (1.0/3.0) * -1.56627 * tfactors.T923i + + -0.0736084 + (5.0/3.0) * -0.072797 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_n13_to_p_o16(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // n13 + he4 --> p + o16 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88n + ln_set_rate = 40.4644 + -35.829 * tfactors.T913i + -0.530275 * tfactors.T913 + + -0.982462 * tfactors.T9 + 0.0808059 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -35.829 * tfactors.T943i + (1.0/3.0) * -0.530275 * tfactors.T923i + + -0.982462 + (5.0/3.0) * 0.0808059 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_o16_to_p_al27(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + c12 --> p + al27 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 68.5253 + 0.205134 * tfactors.T9i + -119.242 * tfactors.T913i + 13.3667 * tfactors.T913 + + 0.295425 * tfactors.T9 + -0.267288 * tfactors.T953 + -9.91729 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.205134 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -119.242 * tfactors.T943i + (1.0/3.0) * 13.3667 * tfactors.T923i + + 0.295425 + (5.0/3.0) * -0.267288 * tfactors.T923 + -9.91729 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_o16_to_he4_mg24(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + c12 --> he4 + mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 48.5341 + 0.37204 * tfactors.T9i + -133.413 * tfactors.T913i + 50.1572 * tfactors.T913 + + -3.15987 * tfactors.T9 + 0.0178251 * tfactors.T953 + -23.7027 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.37204 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -133.413 * tfactors.T943i + (1.0/3.0) * 50.1572 * tfactors.T923i + + -3.15987 + (5.0/3.0) * 0.0178251 * tfactors.T923 + -23.7027 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_o16_o16_to_p_p31(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + o16 --> p + p31 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 85.2628 + 0.223453 * tfactors.T9i + -145.844 * tfactors.T913i + 8.72612 * tfactors.T913 + + -0.554035 * tfactors.T9 + -0.137562 * tfactors.T953 + -6.88807 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.223453 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -145.844 * tfactors.T943i + (1.0/3.0) * 8.72612 * tfactors.T923i + + -0.554035 + (5.0/3.0) * -0.137562 * tfactors.T923 + -6.88807 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_o16_o16_to_he4_si28(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + o16 --> he4 + si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 97.2435 + -0.268514 * tfactors.T9i + -119.324 * tfactors.T913i + -32.2497 * tfactors.T913 + + 1.46214 * tfactors.T9 + -0.200893 * tfactors.T953 + 13.2148 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.268514 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -119.324 * tfactors.T943i + (1.0/3.0) * -32.2497 * tfactors.T923i + + 1.46214 + (5.0/3.0) * -0.200893 * tfactors.T923 + 13.2148 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_f18_to_p_ne21(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // f18 + he4 --> p + ne21 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // rpsmr + ln_set_rate = 49.7863 + -1.84559 * tfactors.T9i + 21.4461 * tfactors.T913i + -73.252 * tfactors.T913 + + 2.42329 * tfactors.T9 + -0.077278 * tfactors.T953 + 40.7604 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.84559 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.4461 * tfactors.T943i + (1.0/3.0) * -73.252 * tfactors.T923i + + 2.42329 + (5.0/3.0) * -0.077278 * tfactors.T923 + 40.7604 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_na23_to_he4_ne20(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // na23 + p --> he4 + ne20 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -6.58736 + -2.31577 * tfactors.T9i + 19.7297 * tfactors.T913 + + -2.20987 * tfactors.T9 + 0.153374 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.31577 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 19.7297 * tfactors.T923i + + -2.20987 + (5.0/3.0) * 0.153374 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 0.0178295 + -1.86103 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.86103 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 18.9756 + -20.0024 * tfactors.T913i + 11.5988 * tfactors.T913 + + -1.37398 * tfactors.T9 + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -20.0024 * tfactors.T943i + (1.0/3.0) * 11.5988 * tfactors.T923i + + -1.37398 + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_al27_to_he4_mg24(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // al27 + p --> he4 + mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -7.02789 + -4.2425 * tfactors.T9i + 18.0416 * tfactors.T913 + + -1.54137 * tfactors.T9 + 0.0847506 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.2425 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0416 * tfactors.T923i + + -1.54137 + (5.0/3.0) * 0.0847506 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -26.8683 + -0.963012 * tfactors.T9i + 5.18642 * tfactors.T913i + -34.7936 * tfactors.T913 + + 168.225 * tfactors.T9 + -115.825 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.963012 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 5.18642 * tfactors.T943i + (1.0/3.0) * -34.7936 * tfactors.T923i + + 168.225 + (5.0/3.0) * -115.825 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 29.4576 + -26.4162 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -26.4162 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_p31_to_he4_si28(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // p31 + p --> he4 + si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -10.893 + -3.42575 * tfactors.T9i + 21.521 * tfactors.T913 + + -1.90355 * tfactors.T9 + 0.092724 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.42575 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 21.521 * tfactors.T923i + + -1.90355 + (5.0/3.0) * 0.092724 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -12.919 + -1.87716 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.87716 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 60.8829 + -31.932 * tfactors.T913i + -77.0334 * tfactors.T913 + + -43.6847 * tfactors.T9 + -4.28955 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -31.932 * tfactors.T943i + (1.0/3.0) * -77.0334 * tfactors.T923i + + -43.6847 + (5.0/3.0) * -4.28955 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_cr48_to_p_mn51(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cr48 + he4 --> p + mn51 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 59.2276 + -86.7459 * tfactors.T913i + 1.05653 * tfactors.T913 + + -1.15757 * tfactors.T9 + 0.0877546 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * 1.05653 * tfactors.T923i + + -1.15757 + (5.0/3.0) * 0.0877546 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe52_to_p_co55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe52 + he4 --> p + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 62.2207 + -91.6819 * tfactors.T913i + -0.329235 * tfactors.T913 + + -0.780924 * tfactors.T9 + 0.0425179 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -0.329235 * tfactors.T923i + + -0.780924 + (5.0/3.0) * 0.0425179 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_cu59_to_he4_ni56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cu59 + p --> he4 + ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.7688 + -39.9808 * tfactors.T913i + 13.6773 * tfactors.T913 + + -3.76429 * tfactors.T9 + 0.438096 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 13.6773 * tfactors.T923i + + -3.76429 + (5.0/3.0) * 0.438096 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_he4_he4_to_c12(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // he4 + he4 + he4 --> c12 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // fy05r + ln_set_rate = -24.3505 + -4.12656 * tfactors.T9i + -13.49 * tfactors.T913i + 21.4259 * tfactors.T913 + + -1.34769 * tfactors.T9 + 0.0879816 * tfactors.T953 + -13.1653 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.12656 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -13.49 * tfactors.T943i + (1.0/3.0) * 21.4259 * tfactors.T923i + + -1.34769 + (5.0/3.0) * 0.0879816 * tfactors.T923 + -13.1653 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // fy05r + ln_set_rate = -11.7884 + -1.02446 * tfactors.T9i + -23.57 * tfactors.T913i + 20.4886 * tfactors.T913 + + -12.9882 * tfactors.T9 + -20.0 * tfactors.T953 + -2.16667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.02446 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -23.57 * tfactors.T943i + (1.0/3.0) * 20.4886 * tfactors.T923i + + -12.9882 + (5.0/3.0) * -20.0 * tfactors.T923 + -2.16667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // fy05n + ln_set_rate = -0.971052 + -37.06 * tfactors.T913i + 29.3493 * tfactors.T913 + + -115.507 * tfactors.T9 + -10.0 * tfactors.T953 + -1.33333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.06 * tfactors.T943i + (1.0/3.0) * 29.3493 * tfactors.T923i + + -115.507 + (5.0/3.0) * -10.0 * tfactors.T923 + -1.33333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_c12_to_mg24_modified(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 + c12 --> mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = -12.8056 + -30.1498 * tfactors.T9i + 11.4826 * tfactors.T913 + + 1.82849 * tfactors.T9 + -0.34844 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 30.1498 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 11.4826 * tfactors.T923i + + 1.82849 + (5.0/3.0) * -0.34844 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_o16_o16_to_s32_modified(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + o16 --> s32 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 77.5491 + -0.373641 * tfactors.T9i + -120.83 * tfactors.T913i + -7.72334 * tfactors.T913 + + -2.27939 * tfactors.T9 + 0.167655 * tfactors.T953 + 7.62001 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.373641 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -120.83 * tfactors.T943i + (1.0/3.0) * -7.72334 * tfactors.T923i + + -2.27939 + (5.0/3.0) * 0.167655 * tfactors.T923 + 7.62001 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_o16_to_si28_modified(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + c12 --> si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = -132.213 + -1.46479 * tfactors.T9i + -293.089 * tfactors.T913i + 414.404 * tfactors.T913 + + -28.0562 * tfactors.T9 + 1.61807 * tfactors.T953 + -178.28 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.46479 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -293.089 * tfactors.T943i + (1.0/3.0) * 414.404 * tfactors.T923i + + -28.0562 + (5.0/3.0) * 1.61807 * tfactors.T923 + -178.28 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_to_p_weak_wc12(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // n --> p + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // wc12w + ln_set_rate = -6.78161; + amrex::ignore_unused(tfactors); + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.0; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_mn55_to_fe56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn55 + p --> fe56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.1888 + -36.1995 * tfactors.T913i + 1.15346 * tfactors.T913 + + -1.94437 * tfactors.T9 + 0.218429 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -36.1995 * tfactors.T943i + (1.0/3.0) * 1.15346 * tfactors.T923i + + -1.94437 + (5.0/3.0) * 0.218429 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_fe52_to_fe53(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe52 + n --> fe53 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 15.8885 + -0.344319 * tfactors.T913 + + 0.178277 * tfactors.T9 + -0.0334326 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -0.344319 * tfactors.T923i + + 0.178277 + (5.0/3.0) * -0.0334326 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_fe53_to_fe54(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe53 + n --> fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 16.4534 + -1.10421 * tfactors.T913 + + 0.379905 * tfactors.T9 + -0.0581878 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.10421 * tfactors.T923i + + 0.379905 + (5.0/3.0) * -0.0581878 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe53_to_ni57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe53 + he4 --> ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 69.0636 + -91.7231 * tfactors.T913i + -10.1816 * tfactors.T913 + + -0.0406303 * tfactors.T9 + 0.0345056 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * -10.1816 * tfactors.T923i + + -0.0406303 + (5.0/3.0) * 0.0345056 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_fe54_to_fe55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + n --> fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ks03 + ln_set_rate = -0.80864 + 0.0591716 * tfactors.T9i + -8.66617 * tfactors.T913i + 26.4472 * tfactors.T913 + + -1.9222 * tfactors.T9 + 0.0986404 * tfactors.T953 + -9.78317 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.0591716 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -8.66617 * tfactors.T943i + (1.0/3.0) * 26.4472 * tfactors.T923i + + -1.9222 + (5.0/3.0) * 0.0986404 * tfactors.T923 + -9.78317 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe54_to_co55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + p --> co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.2304 + -37.1544 * tfactors.T913i + 0.950364 * tfactors.T913 + + -1.77529 * tfactors.T9 + 0.198562 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.1544 * tfactors.T943i + (1.0/3.0) * 0.950364 * tfactors.T923i + + -1.77529 + (5.0/3.0) * 0.198562 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe54_to_ni58(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + he4 --> ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 60.2478 + -91.7628 * tfactors.T913i + 4.23027 * tfactors.T913 + + -3.31305 * tfactors.T9 + 0.271293 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.7628 * tfactors.T943i + (1.0/3.0) * 4.23027 * tfactors.T923i + + -3.31305 + (5.0/3.0) * 0.271293 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_fe55_to_fe56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 + n --> fe56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ks03 + ln_set_rate = 21.7202 + -0.0955677 * tfactors.T9i + 8.06062 * tfactors.T913i + -14.4809 * tfactors.T913 + + 0.94252 * tfactors.T9 + -0.0776007 * tfactors.T953 + 6.47093 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.0955677 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 8.06062 * tfactors.T943i + (1.0/3.0) * -14.4809 * tfactors.T923i + + 0.94252 + (5.0/3.0) * -0.0776007 * tfactors.T923 + 6.47093 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe55_to_co56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 + p --> co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 35.7333 + -37.1585 * tfactors.T913i + 1.66198 * tfactors.T913 + + -1.60842 * tfactors.T9 + 0.148916 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.1585 * tfactors.T943i + (1.0/3.0) * 1.66198 * tfactors.T923i + + -1.60842 + (5.0/3.0) * 0.148916 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe56_to_co57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe56 + p --> co57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.0665 + -37.1625 * tfactors.T913i + 1.06776 * tfactors.T913 + + -1.31689 * tfactors.T9 + 0.122089 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.1625 * tfactors.T943i + (1.0/3.0) * 1.06776 * tfactors.T923i + + -1.31689 + (5.0/3.0) * 0.122089 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_co55_to_co56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + n --> co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 17.065 + -1.86357 * tfactors.T913 + + 0.616591 * tfactors.T9 + -0.0839313 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.86357 * tfactors.T923i + + 0.616591 + (5.0/3.0) * -0.0839313 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_co56_to_co57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + n --> co57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 17.3552 + -1.37855 * tfactors.T913 + + 0.299896 * tfactors.T9 + -0.04382 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.37855 * tfactors.T923i + + 0.299896 + (5.0/3.0) * -0.04382 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co56_to_ni57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + p --> ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 35.5937 + -38.1094 * tfactors.T913i + 2.57091 * tfactors.T913 + + -2.07795 * tfactors.T9 + 0.20757 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1094 * tfactors.T943i + (1.0/3.0) * 2.57091 * tfactors.T923i + + -2.07795 + (5.0/3.0) * 0.20757 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co57_to_ni58(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co57 + p --> ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.0159 + -38.1133 * tfactors.T913i + 1.77414 * tfactors.T913 + + -1.48268 * tfactors.T9 + 0.121073 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 1.77414 * tfactors.T923i + + -1.48268 + (5.0/3.0) * 0.121073 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni56_to_ni57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 + n --> ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 16.0765 + -1.19665 * tfactors.T913 + + 0.507179 * tfactors.T9 + -0.074604 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.19665 * tfactors.T923i + + 0.507179 + (5.0/3.0) * -0.074604 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni57_to_ni58(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 + n --> ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 17.2731 + -1.90814 * tfactors.T913 + + 0.493188 * tfactors.T9 + -0.0684633 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.90814 * tfactors.T923i + + 0.493188 + (5.0/3.0) * -0.0684633 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_ni58_to_cu59(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 + p --> cu59 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // si13n + ln_set_rate = 36.6662 + -39.0526 * tfactors.T913i + 1.0436 * tfactors.T913 + + -2.10834 * tfactors.T9 + 0.239559 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.0526 * tfactors.T943i + (1.0/3.0) * 1.0436 * tfactors.T923i + + -2.10834 + (5.0/3.0) * 0.239559 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_mn51_to_p_fe54(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn51 + he4 --> p + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 62.2777 + -89.274 * tfactors.T913i + -0.862452 * tfactors.T913 + + -0.635672 * tfactors.T9 + 0.0196464 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -0.862452 * tfactors.T923i + + -0.635672 + (5.0/3.0) * 0.0196464 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe53_to_p_co56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe53 + he4 --> p + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 54.8614 + -91.7231 * tfactors.T913i + 10.052 * tfactors.T913 + + -3.86332 * tfactors.T9 + 0.391105 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * 10.052 * tfactors.T923i + + -3.86332 + (5.0/3.0) * 0.391105 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_fe55_to_p_mn55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 + n --> p + mn55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 4.70639 + 7.03052 * tfactors.T913 + + 0.260509 * tfactors.T9 + -0.0813397 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 7.03052 * tfactors.T923i + + 0.260509 + (5.0/3.0) * -0.0813397 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_co55_to_p_fe55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + n --> p + fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.7398 + -1.62382 * tfactors.T913 + + 0.58115 * tfactors.T9 + -0.0537057 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.62382 * tfactors.T923i + + 0.58115 + (5.0/3.0) * -0.0537057 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_co55_to_p_ni58(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + he4 --> p + ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 60.2281 + -94.1404 * tfactors.T913i + 3.39179 * tfactors.T913 + + -1.71062 * tfactors.T9 + 0.133003 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * 3.39179 * tfactors.T923i + + -1.71062 + (5.0/3.0) * 0.133003 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_co56_to_p_fe56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + n --> p + fe56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.4539 + -1.13331 * tfactors.T913 + + 0.347185 * tfactors.T9 + -0.0328879 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.13331 * tfactors.T923i + + 0.347185 + (5.0/3.0) * -0.0328879 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co57_to_he4_fe54(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co57 + p --> he4 + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -2.1962 + -38.1133 * tfactors.T913i + 29.3541 * tfactors.T913 + + -4.75966 * tfactors.T9 + 0.40418 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 29.3541 * tfactors.T923i + + -4.75966 + (5.0/3.0) * 0.40418 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni56_to_p_co56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 + n --> p + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 15.5693 + 1.76846 * tfactors.T913 + + 0.197992 * tfactors.T9 + -0.017494 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 1.76846 * tfactors.T923i + + 0.197992 + (5.0/3.0) * -0.017494 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni56_to_he4_fe53(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 + n --> he4 + fe53 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -7.84393 + 6.43259 * tfactors.T913 + + 2.29591 * tfactors.T9 + -0.254724 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 6.43259 * tfactors.T923i + + 2.29591 + (5.0/3.0) * -0.254724 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni57_to_p_co57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 + n --> p + co57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 19.9939 + -1.13177 * tfactors.T913 + + 0.56875 * tfactors.T9 + -0.0579913 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.13177 * tfactors.T923i + + 0.56875 + (5.0/3.0) * -0.0579913 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni57_to_he4_fe54(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 + n --> he4 + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 14.5327 + 0.48562 * tfactors.T913 + + -0.0249302 * tfactors.T9 + 0.0509605 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 0.48562 * tfactors.T923i + + -0.0249302 + (5.0/3.0) * 0.0509605 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni58_to_he4_fe55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 + n --> he4 + fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -2.03901 + 3.44996 * tfactors.T913 + + 2.98226 * tfactors.T9 + -0.387699 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 3.44996 * tfactors.T923i + + 2.98226 + (5.0/3.0) * -0.387699 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_cu59_to_he4_co56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cu59 + n --> he4 + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 11.0108 + -1.00882 * tfactors.T913 + + 1.88993 * tfactors.T9 + -0.202319 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.00882 * tfactors.T923i + + 1.88993 + (5.0/3.0) * -0.202319 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_zn60_to_he4_ni57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // zn60 + n --> he4 + ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 12.4241 + 5.43552 * tfactors.T913 + + -1.25169 * tfactors.T9 + 0.148383 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 5.43552 * tfactors.T923i + + -1.25169 + (5.0/3.0) * 0.148383 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_s32_to_ar36_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // s32 + he4 --> ar36 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 48.901 + -65.3709 * tfactors.T913i + 5.68294 * tfactors.T913 + + -5.00388 * tfactors.T9 + 0.571407 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -65.3709 * tfactors.T943i + (1.0/3.0) * 5.68294 * tfactors.T923i + + -5.00388 + (5.0/3.0) * 0.571407 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_cl35_to_ar36_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cl35 + p --> ar36 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -9.03294 + -2.00996 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.00996 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -42.5249 + -0.564651 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.564651 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 35.6868 + -27.8971 * tfactors.T913i + -16.2304 * tfactors.T913 + + 35.255 * tfactors.T9 + -25.8411 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -27.8971 * tfactors.T943i + (1.0/3.0) * -16.2304 * tfactors.T923i + + 35.255 + (5.0/3.0) * -25.8411 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -7.84699 + -3.65092 * tfactors.T9i + 18.0179 * tfactors.T913 + + -2.86304 * tfactors.T9 + 0.250854 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.65092 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0179 * tfactors.T923i + + -2.86304 + (5.0/3.0) * 0.250854 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_cl35_to_he4_s32_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cl35 + p --> he4 + s32 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = 2.29121 + -6.00976 * tfactors.T9i + 5.33756 * tfactors.T913 + + 1.64418 * tfactors.T9 + -0.246167 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.00976 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 5.33756 * tfactors.T923i + + 1.64418 + (5.0/3.0) * -0.246167 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -1.01202 + -3.93495 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.93495 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -57.5294 + -0.532931 * tfactors.T9i + 25.5338 * tfactors.T913 + + 6.45824 * tfactors.T9 + -0.950294 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.532931 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 25.5338 * tfactors.T923i + + 6.45824 + (5.0/3.0) * -0.950294 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 32.12 + -30.9147 * tfactors.T913i + -1.2345 * tfactors.T913 + + 22.5118 * tfactors.T9 + -33.0589 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -30.9147 * tfactors.T943i + (1.0/3.0) * -1.2345 * tfactors.T923i + + 22.5118 + (5.0/3.0) * -33.0589 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ar36_to_ca40_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ar36 + he4 --> ca40 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 52.3486 + -71.0046 * tfactors.T913i + 4.0656 * tfactors.T913 + + -5.26509 * tfactors.T9 + 0.683546 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -71.0046 * tfactors.T943i + (1.0/3.0) * 4.0656 * tfactors.T923i + + -5.26509 + (5.0/3.0) * 0.683546 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_k39_to_ca40_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // k39 + p --> ca40 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // lo18r + ln_set_rate = 2761.38 + -5.22234 * tfactors.T9i + 802.18 * tfactors.T913i + -4010.27 * tfactors.T913 + + 1136.19 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.22234 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 802.18 * tfactors.T943i + (1.0/3.0) * -4010.27 * tfactors.T923i + + 1136.19 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // lo18r + ln_set_rate = 588.099 + -12.5647 * tfactors.T9i + 641.844 * tfactors.T913i + -1248.49 * tfactors.T913 + + 564.926 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.5647 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 641.844 * tfactors.T943i + (1.0/3.0) * -1248.49 * tfactors.T923i + + 564.926 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // lo18r + ln_set_rate = 102.252 + -1.66508 * tfactors.T9i + 41.1723 * tfactors.T913i + -149.299 * tfactors.T913 + + 10.5229 * tfactors.T9 + -0.68208 * tfactors.T953 + 59.2367 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.66508 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 41.1723 * tfactors.T943i + (1.0/3.0) * -149.299 * tfactors.T923i + + 10.5229 + (5.0/3.0) * -0.68208 * tfactors.T923 + 59.2367 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_k39_to_he4_ar36_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // k39 + p --> he4 + ar36 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.5166 + -30.0732 * tfactors.T913i + 7.03263 * tfactors.T913 + + -1.10085 * tfactors.T9 + 0.133768 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -30.0732 * tfactors.T943i + (1.0/3.0) * 7.03263 * tfactors.T923i + + -1.10085 + (5.0/3.0) * 0.133768 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ca40_to_ti44_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ca40 + he4 --> ti44 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // chw0 + ln_set_rate = 53.75 + -76.4273 * tfactors.T913i + 3.87451 * tfactors.T913 + + -3.61477 * tfactors.T9 + 0.367451 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -76.4273 * tfactors.T943i + (1.0/3.0) * 3.87451 * tfactors.T923i + + -3.61477 + (5.0/3.0) * 0.367451 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_sc43_to_ti44_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // sc43 + p --> ti44 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.8432 + -32.1734 * tfactors.T913i + -1.77078 * tfactors.T913 + + -2.21706 * tfactors.T9 + 0.298499 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * -1.77078 * tfactors.T923i + + -2.21706 + (5.0/3.0) * 0.298499 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_sc43_to_he4_ca40_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // sc43 + p --> he4 + ca40 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 34.8559 + -32.1734 * tfactors.T913i + 0.0296879 * tfactors.T913 + + -0.95232 * tfactors.T9 + 0.129022 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * 0.0296879 * tfactors.T923i + + -0.95232 + (5.0/3.0) * 0.129022 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ti44_to_cr48_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ti44 + he4 --> cr48 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 64.7958 + -81.667 * tfactors.T913i + -10.6333 * tfactors.T913 + + -0.672613 * tfactors.T9 + 0.161209 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -81.667 * tfactors.T943i + (1.0/3.0) * -10.6333 * tfactors.T923i + + -0.672613 + (5.0/3.0) * 0.161209 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ti44_to_p_v47_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ti44 + he4 --> p + v47 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // chw0r + ln_set_rate = -76.5154 + -10.7931 * tfactors.T9i + 70.2835 * tfactors.T913 + + -7.99061 * tfactors.T9 + 0.486213 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 10.7931 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 70.2835 * tfactors.T923i + + -7.99061 + (5.0/3.0) * 0.486213 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_v47_to_cr48_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // v47 + p --> cr48 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // nfisn + ln_set_rate = 42.6798 + -6.0593 * tfactors.T9i + -34.0548 * tfactors.T913i + -3.41973 * tfactors.T913 + + 1.16501 * tfactors.T9 + -0.105543 * tfactors.T953 + -7.70886 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.0593 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -34.0548 * tfactors.T943i + (1.0/3.0) * -3.41973 * tfactors.T923i + + 1.16501 + (5.0/3.0) * -0.105543 * tfactors.T923 + -7.70886 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 511.463 + -5.29491 * tfactors.T9i + 317.171 * tfactors.T913i + -911.679 * tfactors.T913 + + 94.4245 * tfactors.T9 + -10.1973 * tfactors.T953 + 330.727 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.29491 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 317.171 * tfactors.T943i + (1.0/3.0) * -911.679 * tfactors.T923i + + 94.4245 + (5.0/3.0) * -10.1973 * tfactors.T923 + 330.727 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 23.8315 + 0.246665 * tfactors.T9i + -45.9868 * tfactors.T913i + 13.6822 * tfactors.T913 + + -0.376902 * tfactors.T9 + -0.0194875 * tfactors.T953 + -8.42325 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.246665 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -45.9868 * tfactors.T943i + (1.0/3.0) * 13.6822 * tfactors.T923i + + -0.376902 + (5.0/3.0) * -0.0194875 * tfactors.T923 + -8.42325 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 40.5626 + -0.514414 * tfactors.T9i + -110.655 * tfactors.T913i + 83.0232 * tfactors.T913 + + -19.7762 * tfactors.T9 + 3.03961 * tfactors.T953 + -49.4742 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.514414 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -110.655 * tfactors.T943i + (1.0/3.0) * 83.0232 * tfactors.T923i + + -19.7762 + (5.0/3.0) * 3.03961 * tfactors.T923 + -49.4742 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n13_to_p_c12_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // n13 --> p + c12 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ls09c + ln_set_rate = 40.04074558314484 + -22.547578710551672 * tfactors.T9i + -13.692 * tfactors.T913i + -0.230881 * tfactors.T913 + + 4.44362 * tfactors.T9 + -3.15898 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 22.547578710551672 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -13.692 * tfactors.T943i + (1.0/3.0) * -0.230881 * tfactors.T923i + + 4.44362 + (5.0/3.0) * -3.15898 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // ls09c + ln_set_rate = 40.43534558314484 + -26.326068710551674 * tfactors.T9i + -5.10735 * tfactors.T913i + -2.24111 * tfactors.T913 + + 0.148883 * tfactors.T9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 26.326068710551674 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.10735 * tfactors.T943i + (1.0/3.0) * -2.24111 * tfactors.T923i + + 0.148883; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real c12_pf, dc12_pf_dT; + // setting c12 partition function to 1.0 by default, independent of T + c12_pf = 1.0_rt; + dc12_pf_dT = 0.0_rt; + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real n13_pf, dn13_pf_dT; + // setting n13 partition function to 1.0 by default, independent of T + n13_pf = 1.0_rt; + dn13_pf_dT = 0.0_rt; + + Real z_r = p_pf * c12_pf; + Real z_p = n13_pf; + + Real dz_r_dT = c12_pf * dp_pf_dT + p_pf * dc12_pf_dT; + Real dz_p_dT = dn13_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_o16_to_he4_c12_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 --> he4 + c12 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // nac2 + ln_set_rate = 279.2945280776573 + -84.95160042649215 * tfactors.T9i + 103.411 * tfactors.T913i + -420.567 * tfactors.T913 + + 64.0874 * tfactors.T9 + -12.4624 * tfactors.T953 + 138.803 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 84.95160042649215 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 103.411 * tfactors.T943i + (1.0/3.0) * -420.567 * tfactors.T923i + + 64.0874 + (5.0/3.0) * -12.4624 * tfactors.T923 + 138.803 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nac2 + ln_set_rate = 94.31312807765731 + -84.50317042649215 * tfactors.T9i + 58.9128 * tfactors.T913i + -148.273 * tfactors.T913 + + 9.08324 * tfactors.T9 + -0.541041 * tfactors.T953 + 71.8554 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 84.50317042649215 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 58.9128 * tfactors.T943i + (1.0/3.0) * -148.273 * tfactors.T923i + + 9.08324 + (5.0/3.0) * -0.541041 * tfactors.T923 + 71.8554 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real c12_pf, dc12_pf_dT; + // setting c12 partition function to 1.0 by default, independent of T + c12_pf = 1.0_rt; + dc12_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real o16_pf, do16_pf_dT; + // interpolating o16 partition function + get_partition_function(O16, tfactors, o16_pf, do16_pf_dT); + + Real z_r = he4_pf * c12_pf; + Real z_p = o16_pf; + + Real dz_r_dT = c12_pf * dhe4_pf_dT + he4_pf * dc12_pf_dT; + Real dz_p_dT = do16_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_f18_to_he4_n14_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // f18 --> he4 + n14 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 46.248979543913606 + -51.22930570025806 * tfactors.T9i + -36.2504 * tfactors.T913i + + -5.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 51.22930570025806 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -36.2504 * tfactors.T943i + + (5.0/3.0) * -5.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 38.61457954391361 + -62.19490570025806 * tfactors.T9i + -5.6227 * tfactors.T913i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 62.19490570025806 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.6227 * tfactors.T943i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 24.91191754391361 + -56.38964570025806 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 56.38964570025806 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real f18_pf, df18_pf_dT; + // interpolating f18 partition function + get_partition_function(F18, tfactors, f18_pf, df18_pf_dT); + + Real n14_pf, dn14_pf_dT; + // setting n14 partition function to 1.0 by default, independent of T + n14_pf = 1.0_rt; + dn14_pf_dT = 0.0_rt; + + Real z_r = he4_pf * n14_pf; + Real z_p = f18_pf; + + Real dz_r_dT = n14_pf * dhe4_pf_dT + he4_pf * dn14_pf_dT; + Real dz_p_dT = df18_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ne20_to_he4_o16_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ne20 --> he4 + o16 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // co10c + ln_set_rate = 34.26581585936365 + -67.65193003813836 * tfactors.T9i + -3.65925 * tfactors.T913 + + 0.714224 * tfactors.T9 + -0.00107508 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 67.65193003813836 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -3.65925 * tfactors.T923i + + 0.714224 + (5.0/3.0) * -0.00107508 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // co10c + ln_set_rate = 28.64304585936365 + -65.24613003813835 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 65.24613003813835 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // co10c + ln_set_rate = 48.66033585936365 + -54.887630038138354 * tfactors.T9i + -39.7262 * tfactors.T913i + -0.210799 * tfactors.T913 + + 0.442879 * tfactors.T9 + -0.0797753 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 54.887630038138354 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.7262 * tfactors.T943i + (1.0/3.0) * -0.210799 * tfactors.T923i + + 0.442879 + (5.0/3.0) * -0.0797753 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real o16_pf, do16_pf_dT; + // interpolating o16 partition function + get_partition_function(O16, tfactors, o16_pf, do16_pf_dT); + + Real ne20_pf, dne20_pf_dT; + // interpolating ne20 partition function + get_partition_function(Ne20, tfactors, ne20_pf, dne20_pf_dT); + + Real z_r = he4_pf * o16_pf; + Real z_p = ne20_pf; + + Real dz_r_dT = o16_pf * dhe4_pf_dT + he4_pf * do16_pf_dT; + Real dz_p_dT = dne20_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_na22_to_p_ne21_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // na22 --> p + ne21 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = -24.579038986172677 + -78.40599033331655 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 78.40599033331655 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 42.145961013827325 + -78.20981033331655 * tfactors.T9i + -19.2096 * tfactors.T913i + + -1.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 78.20981033331655 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -19.2096 * tfactors.T943i + + (5.0/3.0) * -1.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -16.409838986172673 + -82.42366033331655 * tfactors.T9i + 21.1176 * tfactors.T913i + 34.0411 * tfactors.T913 + + -4.45593 * tfactors.T9 + 0.328613 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 82.42366033331655 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.1176 * tfactors.T943i + (1.0/3.0) * 34.0411 * tfactors.T923i + + -4.45593 + (5.0/3.0) * 0.328613 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 24.833401013827324 + -79.60938033331655 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 79.60938033331655 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ne21_pf, dne21_pf_dT; + // interpolating ne21 partition function + get_partition_function(Ne21, tfactors, ne21_pf, dne21_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real na22_pf, dna22_pf_dT; + // interpolating na22 partition function + get_partition_function(Na22, tfactors, na22_pf, dna22_pf_dT); + + Real z_r = p_pf * ne21_pf; + Real z_p = na22_pf; + + Real dz_r_dT = ne21_pf * dp_pf_dT + p_pf * dne21_pf_dT; + Real dz_p_dT = dna22_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_na22_to_he4_f18_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // na22 --> he4 + f18 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // rpsmr + ln_set_rate = 59.32234728275454 + -100.23588367240258 * tfactors.T9i + 18.8956 * tfactors.T913i + -65.6134 * tfactors.T913 + + 1.71114 * tfactors.T9 + -0.0260999 * tfactors.T953 + 39.3396 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 100.23588367240258 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 18.8956 * tfactors.T943i + (1.0/3.0) * -65.6134 * tfactors.T923i + + 1.71114 + (5.0/3.0) * -0.0260999 * tfactors.T923 + 39.3396 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real f18_pf, df18_pf_dT; + // interpolating f18 partition function + get_partition_function(F18, tfactors, f18_pf, df18_pf_dT); + + Real na22_pf, dna22_pf_dT; + // interpolating na22 partition function + get_partition_function(Na22, tfactors, na22_pf, dna22_pf_dT); + + Real z_r = he4_pf * f18_pf; + Real z_p = na22_pf; + + Real dz_r_dT = f18_pf * dhe4_pf_dT + he4_pf * df18_pf_dT; + Real dz_p_dT = dna22_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_mg24_to_p_na23_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mg24 --> p + na23 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 43.93571176470678 + -135.6881490421346 * tfactors.T9i + -20.6428 * tfactors.T913i + 1.52954 * tfactors.T913 + + 2.7487 * tfactors.T9 + -1.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 135.6881490421346 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -20.6428 * tfactors.T943i + (1.0/3.0) * 1.52954 * tfactors.T923i + + 2.7487 + (5.0/3.0) * -1.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 34.08761176470678 + -138.9684390421346 * tfactors.T9i + -0.360588 * tfactors.T913 + + 1.4187 * tfactors.T9 + -0.184061 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 138.9684390421346 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.360588 * tfactors.T923i + + 1.4187 + (5.0/3.0) * -0.184061 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 20.002361764706784 + -137.3003390421346 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 137.3003390421346 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real na23_pf, dna23_pf_dT; + // interpolating na23 partition function + get_partition_function(Na23, tfactors, na23_pf, dna23_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real mg24_pf, dmg24_pf_dT; + // interpolating mg24 partition function + get_partition_function(Mg24, tfactors, mg24_pf, dmg24_pf_dT); + + Real z_r = p_pf * na23_pf; + Real z_p = mg24_pf; + + Real dz_r_dT = na23_pf * dp_pf_dT + p_pf * dna23_pf_dT; + Real dz_p_dT = dmg24_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_mg24_to_he4_ne20_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mg24 --> he4 + ne20 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = -13.886931148855957 + -110.62012330714883 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 110.62012330714883 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 49.324368851144044 + -108.11407330714883 * tfactors.T9i + -46.2525 * tfactors.T913i + 5.58901 * tfactors.T913 + + 7.61843 * tfactors.T9 + -3.683 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 108.11407330714883 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -46.2525 * tfactors.T943i + (1.0/3.0) * 5.58901 * tfactors.T923i + + 7.61843 + (5.0/3.0) * -3.683 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 16.02029885114404 + -120.89497330714883 * tfactors.T9i + 16.9229 * tfactors.T913 + + -2.57325 * tfactors.T9 + 0.208997 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 120.89497330714883 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 16.9229 * tfactors.T923i + + -2.57325 + (5.0/3.0) * 0.208997 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 26.801638851144045 + -117.33433330714882 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 117.33433330714882 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real mg24_pf, dmg24_pf_dT; + // interpolating mg24 partition function + get_partition_function(Mg24, tfactors, mg24_pf, dmg24_pf_dT); + + Real ne20_pf, dne20_pf_dT; + // interpolating ne20 partition function + get_partition_function(Ne20, tfactors, ne20_pf, dne20_pf_dT); + + Real z_r = he4_pf * ne20_pf; + Real z_p = mg24_pf; + + Real dz_r_dT = ne20_pf * dhe4_pf_dT + he4_pf * dne20_pf_dT; + Real dz_p_dT = dmg24_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_si28_to_p_al27_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // si28 --> p + al27 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 11.776564828186824 + -136.3434628922348 * tfactors.T9i + 23.8634 * tfactors.T913 + + -3.70135 * tfactors.T9 + 0.28964 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 136.3434628922348 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 23.8634 * tfactors.T923i + + -3.70135 + (5.0/3.0) * 0.28964 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 111.46636482818681 + -134.8268158922348 * tfactors.T9i + -26.8327 * tfactors.T913i + -116.137 * tfactors.T913 + + 0.00950567 * tfactors.T9 + 0.00999755 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 134.8268158922348 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -26.8327 * tfactors.T943i + (1.0/3.0) * -116.137 * tfactors.T923i + + 0.00950567 + (5.0/3.0) * 0.00999755 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 46.54946482818683 + -134.4395028922348 * tfactors.T9i + -23.2205 * tfactors.T913i + + -2.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 134.4395028922348 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -23.2205 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real al27_pf, dal27_pf_dT; + // interpolating al27 partition function + get_partition_function(Al27, tfactors, al27_pf, dal27_pf_dT); + + Real si28_pf, dsi28_pf_dT; + // interpolating si28 partition function + get_partition_function(Si28, tfactors, si28_pf, dsi28_pf_dT); + + Real z_r = p_pf * al27_pf; + Real z_p = si28_pf; + + Real dz_r_dT = al27_pf * dp_pf_dT + p_pf * dal27_pf_dT; + Real dz_p_dT = dsi28_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_si28_to_he4_mg24_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // si28 --> he4 + mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // st08r + ln_set_rate = -25.688574833405916 + -128.69270892750794 * tfactors.T9i + 21.3721 * tfactors.T913i + 37.7649 * tfactors.T913 + + -4.10635 * tfactors.T9 + 0.249618 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 128.69270892750794 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.3721 * tfactors.T943i + (1.0/3.0) * 37.7649 * tfactors.T923i + + -4.10635 + (5.0/3.0) * 0.249618 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // st08r + ln_set_rate = 32.90059516659409 + -131.48850892750792 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 131.48850892750792 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real mg24_pf, dmg24_pf_dT; + // interpolating mg24 partition function + get_partition_function(Mg24, tfactors, mg24_pf, dmg24_pf_dT); + + Real si28_pf, dsi28_pf_dT; + // interpolating si28 partition function + get_partition_function(Si28, tfactors, si28_pf, dsi28_pf_dT); + + Real z_r = he4_pf * mg24_pf; + Real z_p = si28_pf; + + Real dz_r_dT = mg24_pf * dhe4_pf_dT + he4_pf * dmg24_pf_dT; + Real dz_p_dT = dsi28_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_s32_to_p_p31_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // s32 --> p + p31 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 25.172836958303158 + -106.63693563716609 * tfactors.T9i + 8.09341 * tfactors.T913 + + -0.615971 * tfactors.T9 + 0.031159 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 106.63693563716609 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 8.09341 * tfactors.T923i + + -0.615971 + (5.0/3.0) * 0.031159 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 21.682890958303158 + -105.11947563716609 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 105.11947563716609 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 43.610880958303156 + -102.85989563716609 * tfactors.T9i + -25.3278 * tfactors.T913i + 6.4931 * tfactors.T913 + + -9.27513 * tfactors.T9 + -0.610439 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 102.85989563716609 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -25.3278 * tfactors.T943i + (1.0/3.0) * 6.4931 * tfactors.T923i + + -9.27513 + (5.0/3.0) * -0.610439 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real s32_pf, ds32_pf_dT; + // interpolating s32 partition function + get_partition_function(S32, tfactors, s32_pf, ds32_pf_dT); + + Real p31_pf, dp31_pf_dT; + // interpolating p31 partition function + get_partition_function(P31, tfactors, p31_pf, dp31_pf_dT); + + Real z_r = p_pf * p31_pf; + Real z_p = s32_pf; + + Real dz_r_dT = p31_pf * dp_pf_dT + p_pf * dp31_pf_dT; + Real dz_p_dT = ds32_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_s32_to_he4_si28_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // s32 --> he4 + si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 72.81295409739818 + -80.62610309662641 * tfactors.T9i + -59.4896 * tfactors.T913i + 4.47205 * tfactors.T913 + + -4.78989 * tfactors.T9 + 0.557201 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 80.62610309662641 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -59.4896 * tfactors.T943i + (1.0/3.0) * 4.47205 * tfactors.T923i + + -4.78989 + (5.0/3.0) * 0.557201 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real s32_pf, ds32_pf_dT; + // interpolating s32 partition function + get_partition_function(S32, tfactors, s32_pf, ds32_pf_dT); + + Real si28_pf, dsi28_pf_dT; + // interpolating si28 partition function + get_partition_function(Si28, tfactors, si28_pf, dsi28_pf_dT); + + Real z_r = he4_pf * si28_pf; + Real z_p = s32_pf; + + Real dz_r_dT = si28_pf * dhe4_pf_dT + he4_pf * dsi28_pf_dT; + Real dz_p_dT = ds32_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe52_to_p_mn51_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe52 --> p + mn51 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 61.72798916565748 + -85.6326403498911 * tfactors.T9i + -36.1825 * tfactors.T913i + 0.873042 * tfactors.T913 + + -2.89731 * tfactors.T9 + 0.364394 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 85.6326403498911 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -36.1825 * tfactors.T943i + (1.0/3.0) * 0.873042 * tfactors.T923i + + -2.89731 + (5.0/3.0) * 0.364394 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real mn51_pf, dmn51_pf_dT; + // interpolating mn51 partition function + get_partition_function(Mn51, tfactors, mn51_pf, dmn51_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real fe52_pf, dfe52_pf_dT; + // interpolating fe52 partition function + get_partition_function(Fe52, tfactors, fe52_pf, dfe52_pf_dT); + + Real z_r = p_pf * mn51_pf; + Real z_p = fe52_pf; + + Real dz_r_dT = mn51_pf * dp_pf_dT + p_pf * dmn51_pf_dT; + Real dz_p_dT = dfe52_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe52_to_he4_cr48_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe52 --> he4 + cr48 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 90.14738712482466 + -92.10912191363732 * tfactors.T9i + -86.7459 * tfactors.T913i + -9.79373 * tfactors.T913 + + -0.772169 * tfactors.T9 + 0.155883 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 92.10912191363732 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * -9.79373 * tfactors.T923i + + -0.772169 + (5.0/3.0) * 0.155883 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cr48_pf, dcr48_pf_dT; + // interpolating cr48 partition function + get_partition_function(Cr48, tfactors, cr48_pf, dcr48_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe52_pf, dfe52_pf_dT; + // interpolating fe52 partition function + get_partition_function(Fe52, tfactors, fe52_pf, dfe52_pf_dT); + + Real z_r = he4_pf * cr48_pf; + Real z_p = fe52_pf; + + Real dz_r_dT = cr48_pf * dhe4_pf_dT + he4_pf * dcr48_pf_dT; + Real dz_p_dT = dfe52_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co55_to_he4_mn51_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 --> he4 + mn51 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 90.61300778512097 + -95.28620688500884 * tfactors.T9i + -89.274 * tfactors.T913i + -10.4373 * tfactors.T913 + + 1.00492 * tfactors.T9 + -0.125548 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 95.28620688500884 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -10.4373 * tfactors.T923i + + 1.00492 + (5.0/3.0) * -0.125548 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real mn51_pf, dmn51_pf_dT; + // interpolating mn51 partition function + get_partition_function(Mn51, tfactors, mn51_pf, dmn51_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real z_r = he4_pf * mn51_pf; + Real z_p = co55_pf; + + Real dz_r_dT = mn51_pf * dhe4_pf_dT + he4_pf * dmn51_pf_dT; + Real dz_p_dT = dco55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni56_to_p_co55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 --> p + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 63.131770608640906 + -83.14741674893808 * tfactors.T9i + -38.1053 * tfactors.T913i + -0.210947 * tfactors.T913 + + -2.68377 * tfactors.T9 + 0.355814 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 83.14741674893808 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1053 * tfactors.T943i + (1.0/3.0) * -0.210947 * tfactors.T923i + + -2.68377 + (5.0/3.0) * 0.355814 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real z_r = p_pf * co55_pf; + Real z_p = ni56_pf; + + Real dz_r_dT = co55_pf * dp_pf_dT + p_pf * dco55_pf_dT; + Real dz_p_dT = dni56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni56_to_he4_fe52_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 --> he4 + fe52 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 91.62258922810439 + -92.801099329237 * tfactors.T9i + -91.6819 * tfactors.T913i + -9.51885 * tfactors.T913 + + -0.533014 * tfactors.T9 + 0.0892607 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 92.801099329237 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -9.51885 * tfactors.T923i + + -0.533014 + (5.0/3.0) * 0.0892607 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe52_pf, dfe52_pf_dT; + // interpolating fe52 partition function + get_partition_function(Fe52, tfactors, fe52_pf, dfe52_pf_dT); + + Real z_r = he4_pf * fe52_pf; + Real z_p = ni56_pf; + + Real dz_r_dT = fe52_pf * dhe4_pf_dT + he4_pf * dfe52_pf_dT; + Real dz_p_dT = dni56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_cu59_to_he4_co55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cu59 --> he4 + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 90.97199197888506 + -55.17460977128912 * tfactors.T9i + -94.1404 * tfactors.T913i + -2.62786 * tfactors.T913 + + -2.12066 * tfactors.T9 + 0.237999 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 55.17460977128912 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * -2.62786 * tfactors.T923i + + -2.12066 + (5.0/3.0) * 0.237999 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cu59_pf, dcu59_pf_dT; + // interpolating cu59 partition function + get_partition_function(Cu59, tfactors, cu59_pf, dcu59_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real z_r = he4_pf * co55_pf; + Real z_p = cu59_pf; + + Real dz_r_dT = co55_pf * dhe4_pf_dT + he4_pf * dco55_pf_dT; + Real dz_p_dT = dcu59_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_zn60_to_p_cu59_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // zn60 --> p + cu59 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 62.2928405088604 + -59.40944656945774 * tfactors.T9i + -39.9808 * tfactors.T913i + 1.17311 * tfactors.T913 + + -2.90486 * tfactors.T9 + 0.339644 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 59.40944656945774 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 1.17311 * tfactors.T923i + + -2.90486 + (5.0/3.0) * 0.339644 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cu59_pf, dcu59_pf_dT; + // interpolating cu59 partition function + get_partition_function(Cu59, tfactors, cu59_pf, dcu59_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real zn60_pf, dzn60_pf_dT; + // interpolating zn60 partition function + get_partition_function(Zn60, tfactors, zn60_pf, dzn60_pf_dT); + + Real z_r = p_pf * cu59_pf; + Real z_p = zn60_pf; + + Real dz_r_dT = cu59_pf * dp_pf_dT + p_pf * dcu59_pf_dT; + Real dz_p_dT = dzn60_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_zn60_to_he4_ni56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // zn60 --> he4 + ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 86.06186187910455 + -31.43675563699001 * tfactors.T9i + -96.4898 * tfactors.T913i + 6.47209 * tfactors.T913 + + -5.2029 * tfactors.T9 + 0.533391 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 31.43675563699001 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -96.4898 * tfactors.T943i + (1.0/3.0) * 6.47209 * tfactors.T923i + + -5.2029 + (5.0/3.0) * 0.533391 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real zn60_pf, dzn60_pf_dT; + // interpolating zn60 partition function + get_partition_function(Zn60, tfactors, zn60_pf, dzn60_pf_dT); + + Real z_r = he4_pf * ni56_pf; + Real z_p = zn60_pf; + + Real dz_r_dT = ni56_pf * dhe4_pf_dT + he4_pf * dni56_pf_dT; + Real dz_p_dT = dzn60_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_to_he4_he4_he4_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 --> he4 + he4 + he4 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // fy05c + ln_set_rate = 22.39392447043974 + -88.54942933569913 * tfactors.T9i + -13.49 * tfactors.T913i + 21.4259 * tfactors.T913 + + -1.34769 * tfactors.T9 + 0.0879816 * tfactors.T953 + -10.1653 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 88.54942933569913 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -13.49 * tfactors.T943i + (1.0/3.0) * 21.4259 * tfactors.T923i + + -1.34769 + (5.0/3.0) * 0.0879816 * tfactors.T923 + -10.1653 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // fy05c + ln_set_rate = 34.95602447043974 + -85.44732933569914 * tfactors.T9i + -23.57 * tfactors.T913i + 20.4886 * tfactors.T913 + + -12.9882 * tfactors.T9 + -20.0 * tfactors.T953 + 0.8333300000000001 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 85.44732933569914 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -23.57 * tfactors.T943i + (1.0/3.0) * 20.4886 * tfactors.T923i + + -12.9882 + (5.0/3.0) * -20.0 * tfactors.T923 + 0.8333300000000001 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // fy05c + ln_set_rate = 45.77337247043974 + -84.42286933569913 * tfactors.T9i + -37.06 * tfactors.T913i + 29.3493 * tfactors.T913 + + -115.507 * tfactors.T9 + -10.0 * tfactors.T953 + 1.66667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 84.42286933569913 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.06 * tfactors.T943i + (1.0/3.0) * 29.3493 * tfactors.T923i + + -115.507 + (5.0/3.0) * -10.0 * tfactors.T923 + 1.66667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real c12_pf, dc12_pf_dT; + // setting c12 partition function to 1.0 by default, independent of T + c12_pf = 1.0_rt; + dc12_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real z_r = he4_pf * he4_pf * he4_pf; + Real z_p = c12_pf; + + Real dz_r_dT = dhe4_pf_dT + dhe4_pf_dT + dhe4_pf_dT; + Real dz_p_dT = dc12_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_o16_to_he4_n13_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + p --> he4 + n13 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88n + ln_set_rate = 42.232382494512464 + -60.55237555926846 * tfactors.T9i + -35.829 * tfactors.T913i + -0.530275 * tfactors.T913 + + -0.982462 * tfactors.T9 + 0.0808059 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 60.55237555926846 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -35.829 * tfactors.T943i + (1.0/3.0) * -0.530275 * tfactors.T923i + + -0.982462 + (5.0/3.0) * 0.0808059 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real o16_pf, do16_pf_dT; + // interpolating o16 partition function + get_partition_function(O16, tfactors, o16_pf, do16_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real n13_pf, dn13_pf_dT; + // setting n13 partition function to 1.0 by default, independent of T + n13_pf = 1.0_rt; + dn13_pf_dT = 0.0_rt; + + Real z_r = he4_pf * n13_pf; + Real z_p = p_pf * o16_pf; + + Real dz_r_dT = n13_pf * dhe4_pf_dT + he4_pf * dn13_pf_dT; + Real dz_p_dT = o16_pf * dp_pf_dT + p_pf * do16_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ne20_to_p_na23_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ne20 + he4 --> p + na23 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = -6.377717086437262 + -29.88961364462334 * tfactors.T9i + 19.7297 * tfactors.T913 + + -2.20987 * tfactors.T9 + 0.153374 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 29.88961364462334 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 19.7297 * tfactors.T923i + + -2.20987 + (5.0/3.0) * 0.153374 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 0.227472413562738 + -29.434873644623337 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 29.434873644623337 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 19.18524291356274 + -27.573843644623338 * tfactors.T9i + -20.0024 * tfactors.T913i + 11.5988 * tfactors.T913 + + -1.37398 * tfactors.T9 + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 27.573843644623338 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -20.0024 * tfactors.T943i + (1.0/3.0) * 11.5988 * tfactors.T923i + + -1.37398 + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real na23_pf, dna23_pf_dT; + // interpolating na23 partition function + get_partition_function(Na23, tfactors, na23_pf, dna23_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ne20_pf, dne20_pf_dT; + // interpolating ne20 partition function + get_partition_function(Ne20, tfactors, ne20_pf, dne20_pf_dT); + + Real z_r = p_pf * na23_pf; + Real z_p = he4_pf * ne20_pf; + + Real dz_r_dT = na23_pf * dp_pf_dT + p_pf * dna23_pf_dT; + Real dz_p_dT = ne20_pf * dhe4_pf_dT + he4_pf * dne20_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_ne21_to_he4_f18_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ne21 + p --> he4 + f18 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // rpsmr + ln_set_rate = 50.65368626892722 + -22.049056049959066 * tfactors.T9i + 21.4461 * tfactors.T913i + -73.252 * tfactors.T913 + + 2.42329 * tfactors.T9 + -0.077278 * tfactors.T953 + 40.7604 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 22.049056049959066 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.4461 * tfactors.T943i + (1.0/3.0) * -73.252 * tfactors.T923i + + 2.42329 + (5.0/3.0) * -0.077278 * tfactors.T923 + 40.7604 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ne21_pf, dne21_pf_dT; + // interpolating ne21 partition function + get_partition_function(Ne21, tfactors, ne21_pf, dne21_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real f18_pf, df18_pf_dT; + // interpolating f18 partition function + get_partition_function(F18, tfactors, f18_pf, df18_pf_dT); + + Real z_r = he4_pf * f18_pf; + Real z_p = p_pf * ne21_pf; + + Real dz_r_dT = f18_pf * dhe4_pf_dT + he4_pf * df18_pf_dT; + Real dz_p_dT = ne21_pf * dp_pf_dT + p_pf * dne21_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_mg24_to_p_al27_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mg24 + he4 --> p + al27 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = -6.445750338407262 + -22.82086933218981 * tfactors.T9i + 18.0416 * tfactors.T913 + + -1.54137 * tfactors.T9 + 0.0847506 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 22.82086933218981 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0416 * tfactors.T923i + + -1.54137 + (5.0/3.0) * 0.0847506 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -26.286160338407264 + -19.54138133218981 * tfactors.T9i + 5.18642 * tfactors.T913i + -34.7936 * tfactors.T913 + + 168.225 * tfactors.T9 + -115.825 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 19.54138133218981 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 5.18642 * tfactors.T943i + (1.0/3.0) * -34.7936 * tfactors.T923i + + 168.225 + (5.0/3.0) * -115.825 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 30.039739661592737 + -18.578369332189812 * tfactors.T9i + -26.4162 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 18.578369332189812 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -26.4162 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real al27_pf, dal27_pf_dT; + // interpolating al27 partition function + get_partition_function(Al27, tfactors, al27_pf, dal27_pf_dT); + + Real mg24_pf, dmg24_pf_dT; + // interpolating mg24 partition function + get_partition_function(Mg24, tfactors, mg24_pf, dmg24_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real z_r = p_pf * al27_pf; + Real z_p = he4_pf * mg24_pf; + + Real dz_r_dT = al27_pf * dp_pf_dT + p_pf * dal27_pf_dT; + Real dz_p_dT = mg24_pf * dhe4_pf_dT + he4_pf * dmg24_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_si28_to_p_p31_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // si28 + he4 --> p + p31 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = -11.433473139095032 + -25.65965858572089 * tfactors.T9i + 21.521 * tfactors.T913 + + -1.90355 * tfactors.T9 + 0.092724 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 25.65965858572089 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 21.521 * tfactors.T923i + + -1.90355 + (5.0/3.0) * 0.092724 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -13.459473139095032 + -24.11106858572089 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 24.11106858572089 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 60.342426860904965 + -22.23390858572089 * tfactors.T9i + -31.932 * tfactors.T913i + -77.0334 * tfactors.T913 + + -43.6847 * tfactors.T9 + -4.28955 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 22.23390858572089 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -31.932 * tfactors.T943i + (1.0/3.0) * -77.0334 * tfactors.T923i + + -43.6847 + (5.0/3.0) * -4.28955 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real p31_pf, dp31_pf_dT; + // interpolating p31 partition function + get_partition_function(P31, tfactors, p31_pf, dp31_pf_dT); + + Real si28_pf, dsi28_pf_dT; + // interpolating si28 partition function + get_partition_function(Si28, tfactors, si28_pf, dsi28_pf_dT); + + Real z_r = p_pf * p31_pf; + Real z_p = he4_pf * si28_pf; + + Real dz_r_dT = p31_pf * dp_pf_dT + p_pf * dp31_pf_dT; + Real dz_p_dT = si28_pf * dhe4_pf_dT + he4_pf * dsi28_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_mn51_to_he4_cr48_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn51 + p --> he4 + cr48 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 58.73119795916719 + -6.476551190854941 * tfactors.T9i + -86.7459 * tfactors.T913i + 1.05653 * tfactors.T913 + + -1.15757 * tfactors.T9 + 0.0877546 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.476551190854941 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * 1.05653 * tfactors.T923i + + -1.15757 + (5.0/3.0) * 0.0877546 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real cr48_pf, dcr48_pf_dT; + // interpolating cr48 partition function + get_partition_function(Cr48, tfactors, cr48_pf, dcr48_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real mn51_pf, dmn51_pf_dT; + // interpolating mn51 partition function + get_partition_function(Mn51, tfactors, mn51_pf, dmn51_pf_dT); + + Real z_r = he4_pf * cr48_pf; + Real z_p = p_pf * mn51_pf; + + Real dz_r_dT = cr48_pf * dhe4_pf_dT + he4_pf * dcr48_pf_dT; + Real dz_p_dT = mn51_pf * dp_pf_dT + p_pf * dmn51_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co55_to_he4_fe52_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + p --> he4 + fe52 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 61.443418619463486 + -9.65364776674457 * tfactors.T9i + -91.6819 * tfactors.T913i + -0.329235 * tfactors.T913 + + -0.780924 * tfactors.T9 + 0.0425179 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 9.65364776674457 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -0.329235 * tfactors.T923i + + -0.780924 + (5.0/3.0) * 0.0425179 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real fe52_pf, dfe52_pf_dT; + // interpolating fe52 partition function + get_partition_function(Fe52, tfactors, fe52_pf, dfe52_pf_dT); + + Real z_r = he4_pf * fe52_pf; + Real z_p = p_pf * co55_pf; + + Real dz_r_dT = fe52_pf * dhe4_pf_dT + he4_pf * dfe52_pf_dT; + Real dz_p_dT = co55_pf * dp_pf_dT + p_pf * dco55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ni56_to_p_cu59_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 + he4 --> p + cu59 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.847078629755856 + -27.97280697764895 * tfactors.T9i + -39.9808 * tfactors.T913i + 13.6773 * tfactors.T913 + + -3.76429 * tfactors.T9 + 0.438096 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 27.97280697764895 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 13.6773 * tfactors.T923i + + -3.76429 + (5.0/3.0) * 0.438096 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cu59_pf, dcu59_pf_dT; + // interpolating cu59 partition function + get_partition_function(Cu59, tfactors, cu59_pf, dcu59_pf_dT); + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real z_r = p_pf * cu59_pf; + Real z_p = he4_pf * ni56_pf; + + Real dz_r_dT = cu59_pf * dp_pf_dT + p_pf * dcu59_pf_dT; + Real dz_p_dT = ni56_pf * dhe4_pf_dT + he4_pf * dni56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe53_to_n_fe52_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe53 --> n + fe52 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 37.48624299107921 + -123.99427613085159 * tfactors.T9i + -0.344319 * tfactors.T913 + + 0.178277 * tfactors.T9 + -0.0334326 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 123.99427613085159 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.344319 * tfactors.T923i + + 0.178277 + (5.0/3.0) * -0.0334326 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real fe52_pf, dfe52_pf_dT; + // interpolating fe52 partition function + get_partition_function(Fe52, tfactors, fe52_pf, dfe52_pf_dT); + + Real fe53_pf, dfe53_pf_dT; + // interpolating fe53 partition function + get_partition_function(Fe53, tfactors, fe53_pf, dfe53_pf_dT); + + Real z_r = n_pf * fe52_pf; + Real z_p = fe53_pf; + + Real dz_r_dT = fe52_pf * dn_pf_dT + n_pf * dfe52_pf_dT; + Real dz_p_dT = dfe53_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe54_to_n_fe53_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 --> n + fe53 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 42.210560167376684 + -155.25104569177333 * tfactors.T9i + -1.10421 * tfactors.T913 + + 0.379905 * tfactors.T9 + -0.0581878 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 155.25104569177333 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.10421 * tfactors.T923i + + 0.379905 + (5.0/3.0) * -0.0581878 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real fe53_pf, dfe53_pf_dT; + // interpolating fe53 partition function + get_partition_function(Fe53, tfactors, fe53_pf, dfe53_pf_dT); + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = n_pf * fe53_pf; + Real z_p = fe54_pf; + + Real dz_r_dT = fe53_pf * dn_pf_dT + n_pf * dfe53_pf_dT; + Real dz_p_dT = dfe54_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe55_to_n_fe54_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 --> n + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ks03 + ln_set_rate = 21.483298756092896 + -107.84311925142697 * tfactors.T9i + -8.66617 * tfactors.T913i + 26.4472 * tfactors.T913 + + -1.9222 * tfactors.T9 + 0.0986404 * tfactors.T953 + -8.28317 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 107.84311925142697 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -8.66617 * tfactors.T943i + (1.0/3.0) * 26.4472 * tfactors.T923i + + -1.9222 + (5.0/3.0) * 0.0986404 * tfactors.T923 + -8.28317 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = n_pf * fe54_pf; + Real z_p = fe55_pf; + + Real dz_r_dT = fe54_pf * dn_pf_dT + n_pf * dfe54_pf_dT; + Real dz_p_dT = dfe55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe56_to_n_fe55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe56 --> n + fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ks03 + ln_set_rate = 46.785223428080954 + -130.0232339465001 * tfactors.T9i + 8.06062 * tfactors.T913i + -14.4809 * tfactors.T913 + + 0.94252 * tfactors.T9 + -0.0776007 * tfactors.T953 + 7.97093 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 130.0232339465001 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 8.06062 * tfactors.T943i + (1.0/3.0) * -14.4809 * tfactors.T923i + + 0.94252 + (5.0/3.0) * -0.0776007 * tfactors.T923 + 7.97093 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real fe56_pf, dfe56_pf_dT; + // interpolating fe56 partition function + get_partition_function(Fe56, tfactors, fe56_pf, dfe56_pf_dT); + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real z_r = n_pf * fe55_pf; + Real z_p = fe56_pf; + + Real dz_r_dT = fe55_pf * dn_pf_dT + n_pf * dfe55_pf_dT; + Real dz_p_dT = dfe56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe56_to_p_mn55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe56 --> p + mn55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 61.659288536189116 + -118.17693119642051 * tfactors.T9i + -36.1995 * tfactors.T913i + 1.15346 * tfactors.T913 + + -1.94437 * tfactors.T9 + 0.218429 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 118.17693119642051 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -36.1995 * tfactors.T943i + (1.0/3.0) * 1.15346 * tfactors.T923i + + -1.94437 + (5.0/3.0) * 0.218429 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real fe56_pf, dfe56_pf_dT; + // interpolating fe56 partition function + get_partition_function(Fe56, tfactors, fe56_pf, dfe56_pf_dT); + + Real mn55_pf, dmn55_pf_dT; + // interpolating mn55 partition function + get_partition_function(Mn55, tfactors, mn55_pf, dmn55_pf_dT); + + Real z_r = p_pf * mn55_pf; + Real z_p = fe56_pf; + + Real dz_r_dT = mn55_pf * dp_pf_dT + p_pf * dmn55_pf_dT; + Real dz_p_dT = dfe56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co55_to_p_fe54_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 --> p + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 57.82919157553295 + -58.76609208478817 * tfactors.T9i + -37.1544 * tfactors.T913i + 0.950364 * tfactors.T913 + + -1.77529 * tfactors.T9 + 0.198562 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 58.76609208478817 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.1544 * tfactors.T943i + (1.0/3.0) * 0.950364 * tfactors.T923i + + -1.77529 + (5.0/3.0) * 0.198562 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = p_pf * fe54_pf; + Real z_p = co55_pf; + + Real dz_r_dT = fe54_pf * dp_pf_dT + p_pf * dfe54_pf_dT; + Real dz_p_dT = dco55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co56_to_n_co55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 --> n + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 40.62594603130468 + -117.00951667337291 * tfactors.T9i + -1.86357 * tfactors.T913 + + 0.616591 * tfactors.T9 + -0.0839313 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 117.00951667337291 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.86357 * tfactors.T923i + + 0.616591 + (5.0/3.0) * -0.0839313 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = n_pf * co55_pf; + Real z_p = co56_pf; + + Real dz_r_dT = co55_pf * dn_pf_dT + n_pf * dco55_pf_dT; + Real dz_p_dT = dco56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co56_to_p_fe55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 --> p + fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 58.601098850744734 + -67.87436231336505 * tfactors.T9i + -37.1585 * tfactors.T913i + 1.66198 * tfactors.T913 + + -1.60842 * tfactors.T9 + 0.148916 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 67.87436231336505 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.1585 * tfactors.T943i + (1.0/3.0) * 1.66198 * tfactors.T923i + + -1.60842 + (5.0/3.0) * 0.148916 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = p_pf * fe55_pf; + Real z_p = co56_pf; + + Real dz_r_dT = fe55_pf * dp_pf_dT + p_pf * dfe55_pf_dT; + Real dz_p_dT = dco56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co57_to_n_co56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co57 --> n + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 41.15219049522237 + -132.01531905660212 * tfactors.T9i + -1.37855 * tfactors.T913 + + 0.299896 * tfactors.T9 + -0.04382 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 132.01531905660212 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.37855 * tfactors.T923i + + 0.299896 + (5.0/3.0) * -0.04382 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real co57_pf, dco57_pf_dT; + // interpolating co57 partition function + get_partition_function(Co57, tfactors, co57_pf, dco57_pf_dT); + + Real z_r = n_pf * co56_pf; + Real z_p = co57_pf; + + Real dz_r_dT = co56_pf * dn_pf_dT + n_pf * dco56_pf_dT; + Real dz_p_dT = dco57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co57_to_p_fe56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co57 --> p + fe56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 57.66626591788614 + -69.94994642462048 * tfactors.T9i + -37.1625 * tfactors.T913i + 1.06776 * tfactors.T913 + + -1.31689 * tfactors.T9 + 0.122089 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 69.94994642462048 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.1625 * tfactors.T943i + (1.0/3.0) * 1.06776 * tfactors.T923i + + -1.31689 + (5.0/3.0) * 0.122089 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real fe56_pf, dfe56_pf_dT; + // interpolating fe56 partition function + get_partition_function(Fe56, tfactors, fe56_pf, dfe56_pf_dT); + + Real co57_pf, dco57_pf_dT; + // interpolating co57 partition function + get_partition_function(Co57, tfactors, co57_pf, dco57_pf_dT); + + Real z_r = p_pf * fe56_pf; + Real z_p = co57_pf; + + Real dz_r_dT = fe56_pf * dp_pf_dT + p_pf * dfe56_pf_dT; + Real dz_p_dT = dco57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni57_to_n_ni56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 --> n + ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 38.36941309844609 + -118.94166894064354 * tfactors.T9i + -1.19665 * tfactors.T913 + + 0.507179 * tfactors.T9 + -0.074604 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 118.94166894064354 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.19665 * tfactors.T923i + + 0.507179 + (5.0/3.0) * -0.074604 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real z_r = n_pf * ni56_pf; + Real z_p = ni57_pf; + + Real dz_r_dT = ni56_pf * dn_pf_dT + n_pf * dni56_pf_dT; + Real dz_p_dT = dni57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni57_to_p_co56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 --> p + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 60.08383767578231 + -85.07956901620872 * tfactors.T9i + -38.1094 * tfactors.T913i + 2.57091 * tfactors.T913 + + -2.07795 * tfactors.T9 + 0.20757 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 85.07956901620872 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1094 * tfactors.T943i + (1.0/3.0) * 2.57091 * tfactors.T923i + + -2.07795 + (5.0/3.0) * 0.20757 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = p_pf * co56_pf; + Real z_p = ni57_pf; + + Real dz_r_dT = co56_pf * dp_pf_dT + p_pf * dco56_pf_dT; + Real dz_p_dT = dni57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni57_to_he4_fe53_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 --> he4 + fe53 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 94.73965933547126 + -87.74826004866655 * tfactors.T9i + -91.7231 * tfactors.T913i + -10.1816 * tfactors.T913 + + -0.0406303 * tfactors.T9 + 0.0345056 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 87.74826004866655 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * -10.1816 * tfactors.T923i + + -0.0406303 + (5.0/3.0) * 0.0345056 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe53_pf, dfe53_pf_dT; + // interpolating fe53 partition function + get_partition_function(Fe53, tfactors, fe53_pf, dfe53_pf_dT); + + Real z_r = he4_pf * fe53_pf; + Real z_p = ni57_pf; + + Real dz_r_dT = fe53_pf * dhe4_pf_dT + he4_pf * dfe53_pf_dT; + Real dz_p_dT = dni57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni58_to_n_ni57_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 --> n + ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 42.339063572267165 + -141.77239789336582 * tfactors.T9i + -1.90814 * tfactors.T913 + + 0.493188 * tfactors.T9 + -0.0684633 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 141.77239789336582 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.90814 * tfactors.T923i + + 0.493188 + (5.0/3.0) * -0.0684633 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real z_r = n_pf * ni57_pf; + Real z_p = ni58_pf; + + Real dz_r_dT = ni57_pf * dn_pf_dT + n_pf * dni57_pf_dT; + Real dz_p_dT = dni58_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni58_to_p_co57_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 --> p + co57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 61.775010752827114 + -94.83746016924091 * tfactors.T9i + -38.1133 * tfactors.T913i + 1.77414 * tfactors.T913 + + -1.48268 * tfactors.T9 + 0.121073 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 94.83746016924091 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 1.77414 * tfactors.T923i + + -1.48268 + (5.0/3.0) * 0.121073 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real co57_pf, dco57_pf_dT; + // interpolating co57 partition function + get_partition_function(Co57, tfactors, co57_pf, dco57_pf_dT); + + Real z_r = p_pf * co57_pf; + Real z_p = ni58_pf; + + Real dz_r_dT = co57_pf * dp_pf_dT + p_pf * dco57_pf_dT; + Real dz_p_dT = dni58_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni58_to_he4_fe54_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 --> he4 + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 85.23266274036175 + -74.27065665689001 * tfactors.T9i + -91.7628 * tfactors.T913i + 4.23027 * tfactors.T913 + + -3.31305 * tfactors.T9 + 0.271293 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 74.27065665689001 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.7628 * tfactors.T943i + (1.0/3.0) * 4.23027 * tfactors.T923i + + -3.31305 + (5.0/3.0) * 0.271293 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = he4_pf * fe54_pf; + Real z_p = ni58_pf; + + Real dz_r_dT = fe54_pf * dhe4_pf_dT + he4_pf * dfe54_pf_dT; + Real dz_p_dT = dni58_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_cu59_to_p_ni58_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cu59 --> p + ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // si13n + ln_set_rate = 58.96002081405625 + -39.670045199187285 * tfactors.T9i + -39.0526 * tfactors.T913i + 1.0436 * tfactors.T913 + + -2.10834 * tfactors.T9 + 0.239559 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 39.670045199187285 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.0526 * tfactors.T943i + (1.0/3.0) * 1.0436 * tfactors.T923i + + -2.10834 + (5.0/3.0) * 0.239559 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cu59_pf, dcu59_pf_dT; + // interpolating cu59 partition function + get_partition_function(Cu59, tfactors, cu59_pf, dcu59_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real z_r = p_pf * ni58_pf; + Real z_p = cu59_pf; + + Real dz_r_dT = ni58_pf * dp_pf_dT + p_pf * dni58_pf_dT; + Real dz_p_dT = dcu59_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_mn55_to_n_fe55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn55 + p --> n + fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 4.300924891891836 + -11.761875387476456 * tfactors.T9i + 7.03052 * tfactors.T913 + + 0.260509 * tfactors.T9 + -0.0813397 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 11.761875387476456 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 7.03052 * tfactors.T923i + + 0.260509 + (5.0/3.0) * -0.0813397 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real mn55_pf, dmn55_pf_dT; + // interpolating mn55 partition function + get_partition_function(Mn55, tfactors, mn55_pf, dmn55_pf_dT); + + Real z_r = n_pf * fe55_pf; + Real z_p = p_pf * mn55_pf; + + Real dz_r_dT = fe55_pf * dn_pf_dT + n_pf * dfe55_pf_dT; + Real dz_p_dT = mn55_pf * dp_pf_dT + p_pf * dmn55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe53_to_n_ni56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe53 + he4 --> n + ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -11.227076237025186 + -31.193524937158223 * tfactors.T9i + 6.43259 * tfactors.T913 + + 2.29591 * tfactors.T9 + -0.254724 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 31.193524937158223 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 6.43259 * tfactors.T923i + + 2.29591 + (5.0/3.0) * -0.254724 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe53_pf, dfe53_pf_dT; + // interpolating fe53 partition function + get_partition_function(Fe53, tfactors, fe53_pf, dfe53_pf_dT); + + Real z_r = n_pf * ni56_pf; + Real z_p = he4_pf * fe53_pf; + + Real dz_r_dT = ni56_pf * dn_pf_dT + n_pf * dni56_pf_dT; + Real dz_p_dT = fe53_pf * dhe4_pf_dT + he4_pf * dfe53_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe54_to_he4_mn51_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + p --> he4 + mn51 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 65.37001620958803 + -36.52011480022066 * tfactors.T9i + -89.274 * tfactors.T913i + -0.862452 * tfactors.T913 + + -0.635672 * tfactors.T9 + 0.0196464 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 36.52011480022066 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -0.862452 * tfactors.T923i + + -0.635672 + (5.0/3.0) * 0.0196464 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real mn51_pf, dmn51_pf_dT; + // interpolating mn51 partition function + get_partition_function(Mn51, tfactors, mn51_pf, dmn51_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = he4_pf * mn51_pf; + Real z_p = p_pf * fe54_pf; + + Real dz_r_dT = mn51_pf * dhe4_pf_dT + he4_pf * dmn51_pf_dT; + Real dz_p_dT = fe54_pf * dp_pf_dT + p_pf * dfe54_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe54_to_n_ni57_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + he4 --> n + ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 14.613800831905415 + -67.50220541720067 * tfactors.T9i + 0.48562 * tfactors.T913 + + -0.0249302 * tfactors.T9 + 0.0509605 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 67.50220541720067 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 0.48562 * tfactors.T923i + + -0.0249302 + (5.0/3.0) * 0.0509605 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = n_pf * ni57_pf; + Real z_p = he4_pf * fe54_pf; + + Real dz_r_dT = ni57_pf * dn_pf_dT + n_pf * dni57_pf_dT; + Real dz_p_dT = fe54_pf * dhe4_pf_dT + he4_pf * dfe54_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe54_to_p_co57_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + he4 --> p + co57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -1.4219519875346407 + -20.56680351235092 * tfactors.T9i + -38.1133 * tfactors.T913i + 29.3541 * tfactors.T913 + + -4.75966 * tfactors.T9 + 0.40418 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 20.56680351235092 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 29.3541 * tfactors.T923i + + -4.75966 + (5.0/3.0) * 0.40418 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co57_pf, dco57_pf_dT; + // interpolating co57 partition function + get_partition_function(Co57, tfactors, co57_pf, dco57_pf_dT); + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = p_pf * co57_pf; + Real z_p = he4_pf * fe54_pf; + + Real dz_r_dT = co57_pf * dp_pf_dT + p_pf * dco57_pf_dT; + Real dz_p_dT = fe54_pf * dhe4_pf_dT + he4_pf * dfe54_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe55_to_n_co55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 + p --> n + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 21.432947180559943 + -49.13538645037029 * tfactors.T9i + -1.62382 * tfactors.T913 + + 0.58115 * tfactors.T9 + -0.0537057 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 49.13538645037029 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.62382 * tfactors.T923i + + 0.58115 + (5.0/3.0) * -0.0537057 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real z_r = n_pf * co55_pf; + Real z_p = p_pf * fe55_pf; + + Real dz_r_dT = co55_pf * dn_pf_dT + n_pf * dco55_pf_dT; + Real dz_p_dT = fe55_pf * dp_pf_dT + p_pf * dfe55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe55_to_n_ni58_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 + he4 --> n + ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -4.731933984268859 + -33.63082187826845 * tfactors.T9i + 3.44996 * tfactors.T913 + + 2.98226 * tfactors.T9 + -0.387699 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 33.63082187826845 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 3.44996 * tfactors.T923i + + 2.98226 + (5.0/3.0) * -0.387699 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real z_r = n_pf * ni58_pf; + Real z_p = he4_pf * fe55_pf; + + Real dz_r_dT = ni58_pf * dn_pf_dT + n_pf * dni58_pf_dT; + Real dz_p_dT = fe55_pf * dhe4_pf_dT + he4_pf * dfe55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe56_to_n_co56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe56 + p --> n + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 22.65112457733622 + -62.065024496438 * tfactors.T9i + -1.13331 * tfactors.T913 + + 0.347185 * tfactors.T9 + -0.0328879 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 62.065024496438 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.13331 * tfactors.T923i + + 0.347185 + (5.0/3.0) * -0.0328879 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real fe56_pf, dfe56_pf_dT; + // interpolating fe56 partition function + get_partition_function(Fe56, tfactors, fe56_pf, dfe56_pf_dT); + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = n_pf * co56_pf; + Real z_p = p_pf * fe56_pf; + + Real dz_r_dT = co56_pf * dn_pf_dT + n_pf * dco56_pf_dT; + Real dz_p_dT = fe56_pf * dp_pf_dT + p_pf * dfe56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co56_to_n_ni56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + p --> n + ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 13.37207542266378 + -33.86221596961605 * tfactors.T9i + 1.76846 * tfactors.T913 + + 0.197992 * tfactors.T9 + -0.017494 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 33.86221596961605 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 1.76846 * tfactors.T923i + + 0.197992 + (5.0/3.0) * -0.017494 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = n_pf * ni56_pf; + Real z_p = p_pf * co56_pf; + + Real dz_r_dT = ni56_pf * dn_pf_dT + n_pf * dni56_pf_dT; + Real dz_p_dT = co56_pf * dp_pf_dT + p_pf * dco56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co56_to_he4_fe53_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + p --> he4 + fe53 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 56.04732165968897 + -2.6687374505303194 * tfactors.T9i + -91.7231 * tfactors.T913i + 10.052 * tfactors.T913 + + -3.86332 * tfactors.T9 + 0.391105 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.6687374505303194 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * 10.052 * tfactors.T923i + + -3.86332 + (5.0/3.0) * 0.391105 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe53_pf, dfe53_pf_dT; + // interpolating fe53 partition function + get_partition_function(Fe53, tfactors, fe53_pf, dfe53_pf_dT); + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = he4_pf * fe53_pf; + Real z_p = p_pf * co56_pf; + + Real dz_r_dT = fe53_pf * dhe4_pf_dT + he4_pf * dfe53_pf_dT; + Real dz_p_dT = co56_pf * dp_pf_dT + p_pf * dco56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_co56_to_n_cu59_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + he4 --> n + cu59 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 8.891854052419635 + -61.835022947265 * tfactors.T9i + -1.00882 * tfactors.T913 + + 1.88993 * tfactors.T9 + -0.202319 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 61.835022947265 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.00882 * tfactors.T923i + + 1.88993 + (5.0/3.0) * -0.202319 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real cu59_pf, dcu59_pf_dT; + // interpolating cu59 partition function + get_partition_function(Cu59, tfactors, cu59_pf, dcu59_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = n_pf * cu59_pf; + Real z_p = he4_pf * co56_pf; + + Real dz_r_dT = cu59_pf * dn_pf_dT + n_pf * dcu59_pf_dT; + Real dz_p_dT = co56_pf * dhe4_pf_dT + he4_pf * dco56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co57_to_n_ni57_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co57 + p --> n + ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 19.300752819440056 + -46.935401904849755 * tfactors.T9i + -1.13177 * tfactors.T913 + + 0.56875 * tfactors.T9 + -0.0579913 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 46.935401904849755 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.13177 * tfactors.T923i + + 0.56875 + (5.0/3.0) * -0.0579913 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real co57_pf, dco57_pf_dT; + // interpolating co57 partition function + get_partition_function(Co57, tfactors, co57_pf, dco57_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real z_r = n_pf * ni57_pf; + Real z_p = p_pf * co57_pf; + + Real dz_r_dT = ni57_pf * dn_pf_dT + n_pf * dni57_pf_dT; + Real dz_p_dT = co57_pf * dp_pf_dT + p_pf * dco57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ni57_to_n_zn60_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 + he4 --> n + zn60 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 9.728451219341542 + -87.50502934883477 * tfactors.T9i + 5.43552 * tfactors.T913 + + -1.25169 * tfactors.T9 + 0.148383 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 87.50502934883477 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 5.43552 * tfactors.T923i + + -1.25169 + (5.0/3.0) * 0.148383 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real zn60_pf, dzn60_pf_dT; + // interpolating zn60 partition function + get_partition_function(Zn60, tfactors, zn60_pf, dzn60_pf_dT); + + Real z_r = n_pf * zn60_pf; + Real z_p = he4_pf * ni57_pf; + + Real dz_r_dT = zn60_pf * dn_pf_dT + n_pf * dzn60_pf_dT; + Real dz_p_dT = ni57_pf * dhe4_pf_dT + he4_pf * dni57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_ni58_to_he4_co55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 + p --> he4 + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 63.614171164828804 + -15.504564572101842 * tfactors.T9i + -94.1404 * tfactors.T913i + 3.39179 * tfactors.T913 + + -1.71062 * tfactors.T9 + 0.133003 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 15.504564572101842 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * 3.39179 * tfactors.T923i + + -1.71062 + (5.0/3.0) * 0.133003 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real z_r = he4_pf * co55_pf; + Real z_p = p_pf * ni58_pf; + + Real dz_r_dT = co55_pf * dhe4_pf_dT + he4_pf * dco55_pf_dT; + Real dz_p_dT = ni58_pf * dp_pf_dT + p_pf * dni58_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_s32_to_p_cl35_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // s32 + he4 --> p + cl35 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 2.425628238034531 + -27.66622776398283 * tfactors.T9i + 5.33756 * tfactors.T913 + + 1.64418 * tfactors.T9 + -0.246167 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 27.66622776398283 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 5.33756 * tfactors.T923i + + 1.64418 + (5.0/3.0) * -0.246167 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -0.877601761965469 + -25.59141776398283 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 25.59141776398283 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -57.39498176196547 + -22.18939876398283 * tfactors.T9i + 25.5338 * tfactors.T913 + + 6.45824 * tfactors.T9 + -0.950294 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 22.18939876398283 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 25.5338 * tfactors.T923i + + 6.45824 + (5.0/3.0) * -0.950294 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 32.25441823803453 + -21.65646776398283 * tfactors.T9i + -30.9147 * tfactors.T913i + -1.2345 * tfactors.T913 + + 22.5118 * tfactors.T9 + -33.0589 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 21.65646776398283 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -30.9147 * tfactors.T943i + (1.0/3.0) * -1.2345 * tfactors.T923i + + 22.5118 + (5.0/3.0) * -33.0589 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real cl35_pf, dcl35_pf_dT; + // interpolating cl35 partition function + get_partition_function(Cl35, tfactors, cl35_pf, dcl35_pf_dT); + + Real s32_pf, ds32_pf_dT; + // interpolating s32 partition function + get_partition_function(S32, tfactors, s32_pf, ds32_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real z_r = p_pf * cl35_pf; + Real z_p = he4_pf * s32_pf; + + Real dz_r_dT = cl35_pf * dp_pf_dT + p_pf * dcl35_pf_dT; + Real dz_p_dT = s32_pf * dhe4_pf_dT + he4_pf * ds32_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ar36_to_he4_s32_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ar36 --> he4 + s32 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 73.81637663285039 + -77.06281976216322 * tfactors.T9i + -65.3709 * tfactors.T913i + 5.68294 * tfactors.T913 + + -5.00388 * tfactors.T9 + 0.571407 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 77.06281976216322 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -65.3709 * tfactors.T943i + (1.0/3.0) * 5.68294 * tfactors.T923i + + -5.00388 + (5.0/3.0) * 0.571407 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real s32_pf, ds32_pf_dT; + // interpolating s32 partition function + get_partition_function(S32, tfactors, s32_pf, ds32_pf_dT); + + Real ar36_pf, dar36_pf_dT; + // interpolating ar36 partition function + get_partition_function(Ar36, tfactors, ar36_pf, dar36_pf_dT); + + Real z_r = he4_pf * s32_pf; + Real z_p = ar36_pf; + + Real dz_r_dT = s32_pf * dhe4_pf_dT + he4_pf * ds32_pf_dT; + Real dz_p_dT = dar36_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ar36_to_p_cl35_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ar36 --> p + cl35 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 16.01685487088493 + -100.72924752614605 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 100.72924752614605 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -17.47510512911507 + -99.28393852614604 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 99.28393852614604 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 60.73659487088493 + -98.71928752614605 * tfactors.T9i + -27.8971 * tfactors.T913i + -16.2304 * tfactors.T913 + + 35.255 * tfactors.T9 + -25.8411 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 98.71928752614605 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -27.8971 * tfactors.T943i + (1.0/3.0) * -16.2304 * tfactors.T923i + + 35.255 + (5.0/3.0) * -25.8411 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 17.202804870884933 + -102.37020752614605 * tfactors.T9i + 18.0179 * tfactors.T913 + + -2.86304 * tfactors.T9 + 0.250854 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 102.37020752614605 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0179 * tfactors.T923i + + -2.86304 + (5.0/3.0) * 0.250854 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real cl35_pf, dcl35_pf_dT; + // interpolating cl35 partition function + get_partition_function(Cl35, tfactors, cl35_pf, dcl35_pf_dT); + + Real ar36_pf, dar36_pf_dT; + // interpolating ar36 partition function + get_partition_function(Ar36, tfactors, ar36_pf, dar36_pf_dT); + + Real z_r = p_pf * cl35_pf; + Real z_p = ar36_pf; + + Real dz_r_dT = cl35_pf * dp_pf_dT + p_pf * dcl35_pf_dT; + Real dz_p_dT = dar36_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ar36_to_p_k39_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ar36 + he4 --> p + k39 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.636664061510302 + -14.953349961318928 * tfactors.T9i + -30.0732 * tfactors.T913i + 7.03263 * tfactors.T913 + + -1.10085 * tfactors.T9 + 0.133768 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 14.953349961318928 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -30.0732 * tfactors.T943i + (1.0/3.0) * 7.03263 * tfactors.T923i + + -1.10085 + (5.0/3.0) * 0.133768 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real k39_pf, dk39_pf_dT; + // interpolating k39 partition function + get_partition_function(K39, tfactors, k39_pf, dk39_pf_dT); + + Real ar36_pf, dar36_pf_dT; + // interpolating ar36 partition function + get_partition_function(Ar36, tfactors, ar36_pf, dar36_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real z_r = p_pf * k39_pf; + Real z_p = he4_pf * ar36_pf; + + Real dz_r_dT = k39_pf * dp_pf_dT + p_pf * dk39_pf_dT; + Real dz_p_dT = ar36_pf * dhe4_pf_dT + he4_pf * dar36_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ca40_to_he4_ar36_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ca40 --> he4 + ar36 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 77.28261041284823 + -81.69174599574632 * tfactors.T9i + -71.0046 * tfactors.T913i + 4.0656 * tfactors.T913 + + -5.26509 * tfactors.T9 + 0.683546 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 81.69174599574632 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -71.0046 * tfactors.T943i + (1.0/3.0) * 4.0656 * tfactors.T923i + + -5.26509 + (5.0/3.0) * 0.683546 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ca40_pf, dca40_pf_dT; + // interpolating ca40 partition function + get_partition_function(Ca40, tfactors, ca40_pf, dca40_pf_dT); + + Real ar36_pf, dar36_pf_dT; + // interpolating ar36 partition function + get_partition_function(Ar36, tfactors, ar36_pf, dar36_pf_dT); + + Real z_r = he4_pf * ar36_pf; + Real z_p = ca40_pf; + + Real dz_r_dT = ar36_pf * dhe4_pf_dT + he4_pf * dar36_pf_dT; + Real dz_p_dT = dca40_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ca40_to_p_k39_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ca40 --> p + k39 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // lo18r + ln_set_rate = 2786.4340744743586 + -101.86662364079672 * tfactors.T9i + 802.18 * tfactors.T913i + -4010.27 * tfactors.T913 + + 1137.69 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 101.86662364079672 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 802.18 * tfactors.T943i + (1.0/3.0) * -4010.27 * tfactors.T923i + + 1137.69 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // lo18r + ln_set_rate = 613.1530744743586 + -109.20898364079672 * tfactors.T9i + 641.844 * tfactors.T913i + -1248.49 * tfactors.T913 + + 566.426 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 109.20898364079672 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 641.844 * tfactors.T943i + (1.0/3.0) * -1248.49 * tfactors.T923i + + 566.426 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // lo18r + ln_set_rate = 127.30607447435852 + -98.30936364079672 * tfactors.T9i + 41.1723 * tfactors.T913i + -149.299 * tfactors.T913 + + 10.5229 * tfactors.T9 + -0.68208 * tfactors.T953 + 60.7367 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 98.30936364079672 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 41.1723 * tfactors.T943i + (1.0/3.0) * -149.299 * tfactors.T923i + + 10.5229 + (5.0/3.0) * -0.68208 * tfactors.T923 + 60.7367 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ca40_pf, dca40_pf_dT; + // interpolating ca40 partition function + get_partition_function(Ca40, tfactors, ca40_pf, dca40_pf_dT); + + Real k39_pf, dk39_pf_dT; + // interpolating k39 partition function + get_partition_function(K39, tfactors, k39_pf, dk39_pf_dT); + + Real z_r = p_pf * k39_pf; + Real z_p = ca40_pf; + + Real dz_r_dT = k39_pf * dp_pf_dT + p_pf * dk39_pf_dT; + Real dz_p_dT = dca40_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ca40_to_p_sc43_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ca40 + he4 --> p + sc43 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 35.65752817292938 + -40.87575463203665 * tfactors.T9i + -32.1734 * tfactors.T913i + 0.0296879 * tfactors.T913 + + -0.95232 * tfactors.T9 + 0.129022 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 40.87575463203665 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * 0.0296879 * tfactors.T923i + + -0.95232 + (5.0/3.0) * 0.129022 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ca40_pf, dca40_pf_dT; + // interpolating ca40 partition function + get_partition_function(Ca40, tfactors, ca40_pf, dca40_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real sc43_pf, dsc43_pf_dT; + // interpolating sc43 partition function + get_partition_function(Sc43, tfactors, sc43_pf, dsc43_pf_dT); + + Real z_r = p_pf * sc43_pf; + Real z_p = he4_pf * ca40_pf; + + Real dz_r_dT = sc43_pf * dp_pf_dT + p_pf * dsc43_pf_dT; + Real dz_p_dT = ca40_pf * dhe4_pf_dT + he4_pf * dca40_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ti44_to_he4_ca40_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ti44 --> he4 + ca40 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // chw0 + ln_set_rate = 78.69908591662849 + -59.4975248620018 * tfactors.T9i + -76.4273 * tfactors.T913i + 3.87451 * tfactors.T913 + + -3.61477 * tfactors.T9 + 0.367451 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 59.4975248620018 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -76.4273 * tfactors.T943i + (1.0/3.0) * 3.87451 * tfactors.T923i + + -3.61477 + (5.0/3.0) * 0.367451 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ca40_pf, dca40_pf_dT; + // interpolating ca40 partition function + get_partition_function(Ca40, tfactors, ca40_pf, dca40_pf_dT); + + Real ti44_pf, dti44_pf_dT; + // interpolating ti44 partition function + get_partition_function(Ti44, tfactors, ti44_pf, dti44_pf_dT); + + Real z_r = he4_pf * ca40_pf; + Real z_p = ti44_pf; + + Real dz_r_dT = ca40_pf * dhe4_pf_dT + he4_pf * dca40_pf_dT; + Real dz_p_dT = dti44_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ti44_to_p_sc43_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ti44 --> p + sc43 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 62.59391408955788 + -100.37327949403844 * tfactors.T9i + -32.1734 * tfactors.T913i + -1.77078 * tfactors.T913 + + -2.21706 * tfactors.T9 + 0.298499 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 100.37327949403844 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * -1.77078 * tfactors.T923i + + -2.21706 + (5.0/3.0) * 0.298499 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ti44_pf, dti44_pf_dT; + // interpolating ti44 partition function + get_partition_function(Ti44, tfactors, ti44_pf, dti44_pf_dT); + + Real sc43_pf, dsc43_pf_dT; + // interpolating sc43 partition function + get_partition_function(Sc43, tfactors, sc43_pf, dsc43_pf_dT); + + Real z_r = p_pf * sc43_pf; + Real z_p = ti44_pf; + + Real dz_r_dT = sc43_pf * dp_pf_dT + p_pf * dsc43_pf_dT; + Real dz_p_dT = dti44_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_cr48_to_he4_ti44_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cr48 --> he4 + ti44 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 89.75733412085052 + -89.3041938384302 * tfactors.T9i + -81.667 * tfactors.T913i + -10.6333 * tfactors.T913 + + -0.672613 * tfactors.T9 + 0.161209 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 89.3041938384302 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -81.667 * tfactors.T943i + (1.0/3.0) * -10.6333 * tfactors.T923i + + -0.672613 + (5.0/3.0) * 0.161209 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cr48_pf, dcr48_pf_dT; + // interpolating cr48 partition function + get_partition_function(Cr48, tfactors, cr48_pf, dcr48_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ti44_pf, dti44_pf_dT; + // interpolating ti44 partition function + get_partition_function(Ti44, tfactors, ti44_pf, dti44_pf_dT); + + Real z_r = he4_pf * ti44_pf; + Real z_p = cr48_pf; + + Real dz_r_dT = ti44_pf * dhe4_pf_dT + he4_pf * dti44_pf_dT; + Real dz_p_dT = dcr48_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_cr48_to_p_v47_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cr48 --> p + v47 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // nfisn + ln_set_rate = 67.74027107253823 + -100.12633621113824 * tfactors.T9i + -34.0548 * tfactors.T913i + -3.41973 * tfactors.T913 + + 1.16501 * tfactors.T9 + -0.105543 * tfactors.T953 + -6.20886 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 100.12633621113824 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -34.0548 * tfactors.T943i + (1.0/3.0) * -3.41973 * tfactors.T923i + + 1.16501 + (5.0/3.0) * -0.105543 * tfactors.T923 + -6.20886 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 536.5234710725382 + -99.36194621113825 * tfactors.T9i + 317.171 * tfactors.T913i + -911.679 * tfactors.T913 + + 94.4245 * tfactors.T9 + -10.1973 * tfactors.T953 + 332.227 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 99.36194621113825 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 317.171 * tfactors.T943i + (1.0/3.0) * -911.679 * tfactors.T923i + + 94.4245 + (5.0/3.0) * -10.1973 * tfactors.T923 + 332.227 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 48.891971072538226 + -93.82037121113825 * tfactors.T9i + -45.9868 * tfactors.T913i + 13.6822 * tfactors.T913 + + -0.376902 * tfactors.T9 + -0.0194875 * tfactors.T953 + -6.9232499999999995 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 93.82037121113825 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -45.9868 * tfactors.T943i + (1.0/3.0) * 13.6822 * tfactors.T923i + + -0.376902 + (5.0/3.0) * -0.0194875 * tfactors.T923 + -6.9232499999999995 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 65.62307107253824 + -94.58145021113825 * tfactors.T9i + -110.655 * tfactors.T913i + 83.0232 * tfactors.T913 + + -19.7762 * tfactors.T9 + 3.03961 * tfactors.T953 + -47.9742 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 94.58145021113825 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -110.655 * tfactors.T943i + (1.0/3.0) * 83.0232 * tfactors.T923i + + -19.7762 + (5.0/3.0) * 3.03961 * tfactors.T923 + -47.9742 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cr48_pf, dcr48_pf_dT; + // interpolating cr48 partition function + get_partition_function(Cr48, tfactors, cr48_pf, dcr48_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real v47_pf, dv47_pf_dT; + // interpolating v47 partition function + get_partition_function(V47, tfactors, v47_pf, dv47_pf_dT); + + Real z_r = p_pf * v47_pf; + Real z_p = cr48_pf; + + Real dz_r_dT = v47_pf * dp_pf_dT + p_pf * dv47_pf_dT; + Real dz_p_dT = dcr48_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_v47_to_he4_ti44_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // v47 + p --> he4 + ti44 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // chw0r + ln_set_rate = -76.61433695168769 + -6.029445311023438 * tfactors.T9i + 70.2835 * tfactors.T913 + + -7.99061 * tfactors.T9 + 0.486213 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.029445311023438 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 70.2835 * tfactors.T923i + + -7.99061 + (5.0/3.0) * 0.486213 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real v47_pf, dv47_pf_dT; + // interpolating v47 partition function + get_partition_function(V47, tfactors, v47_pf, dv47_pf_dT); + + Real ti44_pf, dti44_pf_dT; + // interpolating ti44 partition function + get_partition_function(Ti44, tfactors, ti44_pf, dti44_pf_dT); + + Real z_r = he4_pf * ti44_pf; + Real z_p = p_pf * v47_pf; + + Real dz_r_dT = ti44_pf * dhe4_pf_dT + he4_pf * dti44_pf_dT; + Real dz_p_dT = v47_pf * dp_pf_dT + p_pf * dv47_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_s32_he4_to_ar36_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ag = rate_eval.screened_rates(k_he4_s32_to_ar36_removed); + Real r_ap = rate_eval.screened_rates(k_he4_s32_to_p_cl35_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_cl35_to_ar36_removed); + Real r_pa = rate_eval.screened_rates(k_p_cl35_to_he4_s32_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ag + r_ap * r_pg * dd; + if constexpr (std::is_same::value) { + Real drdT_ag = rate_eval.dscreened_rates_dT(k_he4_s32_to_ar36_removed); + Real drdT_ap = rate_eval.dscreened_rates_dT(k_he4_s32_to_p_cl35_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_cl35_to_ar36_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_cl35_to_he4_s32_removed); + drate_dT = drdT_ag + drdT_ap * r_pg * dd + r_ap * drdT_pg * dd - r_ap * r_pg * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ar36_to_s32_he4_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ga = rate_eval.screened_rates(k_ar36_to_he4_s32_derived_removed); + Real r_pa = rate_eval.screened_rates(k_p_cl35_to_he4_s32_removed); + Real r_gp = rate_eval.screened_rates(k_ar36_to_p_cl35_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_cl35_to_ar36_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ga + r_gp * r_pa * dd; + if constexpr (std::is_same::value) { + Real drdT_ga = rate_eval.dscreened_rates_dT(k_ar36_to_he4_s32_derived_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_cl35_to_he4_s32_removed); + Real drdT_gp = rate_eval.dscreened_rates_dT(k_ar36_to_p_cl35_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_cl35_to_ar36_removed); + drate_dT = drdT_ga + drdT_gp * r_pa * dd + r_gp * drdT_pa * dd - r_gp * r_pa * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ar36_he4_to_ca40_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ag = rate_eval.screened_rates(k_he4_ar36_to_ca40_removed); + Real r_ap = rate_eval.screened_rates(k_he4_ar36_to_p_k39_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_k39_to_ca40_removed); + Real r_pa = rate_eval.screened_rates(k_p_k39_to_he4_ar36_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ag + r_ap * r_pg * dd; + if constexpr (std::is_same::value) { + Real drdT_ag = rate_eval.dscreened_rates_dT(k_he4_ar36_to_ca40_removed); + Real drdT_ap = rate_eval.dscreened_rates_dT(k_he4_ar36_to_p_k39_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_k39_to_ca40_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_k39_to_he4_ar36_removed); + drate_dT = drdT_ag + drdT_ap * r_pg * dd + r_ap * drdT_pg * dd - r_ap * r_pg * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ca40_to_ar36_he4_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ga = rate_eval.screened_rates(k_ca40_to_he4_ar36_derived_removed); + Real r_pa = rate_eval.screened_rates(k_p_k39_to_he4_ar36_removed); + Real r_gp = rate_eval.screened_rates(k_ca40_to_p_k39_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_k39_to_ca40_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ga + r_gp * r_pa * dd; + if constexpr (std::is_same::value) { + Real drdT_ga = rate_eval.dscreened_rates_dT(k_ca40_to_he4_ar36_derived_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_k39_to_he4_ar36_removed); + Real drdT_gp = rate_eval.dscreened_rates_dT(k_ca40_to_p_k39_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_k39_to_ca40_removed); + drate_dT = drdT_ga + drdT_gp * r_pa * dd + r_gp * drdT_pa * dd - r_gp * r_pa * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ca40_he4_to_ti44_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ag = rate_eval.screened_rates(k_he4_ca40_to_ti44_removed); + Real r_ap = rate_eval.screened_rates(k_he4_ca40_to_p_sc43_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_sc43_to_ti44_removed); + Real r_pa = rate_eval.screened_rates(k_p_sc43_to_he4_ca40_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ag + r_ap * r_pg * dd; + if constexpr (std::is_same::value) { + Real drdT_ag = rate_eval.dscreened_rates_dT(k_he4_ca40_to_ti44_removed); + Real drdT_ap = rate_eval.dscreened_rates_dT(k_he4_ca40_to_p_sc43_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_sc43_to_ti44_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_sc43_to_he4_ca40_removed); + drate_dT = drdT_ag + drdT_ap * r_pg * dd + r_ap * drdT_pg * dd - r_ap * r_pg * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ti44_to_ca40_he4_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ga = rate_eval.screened_rates(k_ti44_to_he4_ca40_derived_removed); + Real r_pa = rate_eval.screened_rates(k_p_sc43_to_he4_ca40_removed); + Real r_gp = rate_eval.screened_rates(k_ti44_to_p_sc43_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_sc43_to_ti44_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ga + r_gp * r_pa * dd; + if constexpr (std::is_same::value) { + Real drdT_ga = rate_eval.dscreened_rates_dT(k_ti44_to_he4_ca40_derived_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_sc43_to_he4_ca40_removed); + Real drdT_gp = rate_eval.dscreened_rates_dT(k_ti44_to_p_sc43_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_sc43_to_ti44_removed); + drate_dT = drdT_ga + drdT_gp * r_pa * dd + r_gp * drdT_pa * dd - r_gp * r_pa * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ti44_he4_to_cr48_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ag = rate_eval.screened_rates(k_he4_ti44_to_cr48_removed); + Real r_ap = rate_eval.screened_rates(k_he4_ti44_to_p_v47_removed); + Real r_pg = rate_eval.screened_rates(k_p_v47_to_cr48_removed); + Real r_pa = rate_eval.screened_rates(k_p_v47_to_he4_ti44_derived_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ag + r_ap * r_pg * dd; + if constexpr (std::is_same::value) { + Real drdT_ag = rate_eval.dscreened_rates_dT(k_he4_ti44_to_cr48_removed); + Real drdT_ap = rate_eval.dscreened_rates_dT(k_he4_ti44_to_p_v47_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_v47_to_cr48_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_v47_to_he4_ti44_derived_removed); + drate_dT = drdT_ag + drdT_ap * r_pg * dd + r_ap * drdT_pg * dd - r_ap * r_pg * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_cr48_to_ti44_he4_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ga = rate_eval.screened_rates(k_cr48_to_he4_ti44_derived_removed); + Real r_pa = rate_eval.screened_rates(k_p_v47_to_he4_ti44_derived_removed); + Real r_gp = rate_eval.screened_rates(k_cr48_to_p_v47_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_v47_to_cr48_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ga + r_gp * r_pa * dd; + if constexpr (std::is_same::value) { + Real drdT_ga = rate_eval.dscreened_rates_dT(k_cr48_to_he4_ti44_derived_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_v47_to_he4_ti44_derived_removed); + Real drdT_gp = rate_eval.dscreened_rates_dT(k_cr48_to_p_v47_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_v47_to_cr48_removed); + drate_dT = drdT_ga + drdT_gp * r_pa * dd + r_gp * drdT_pa * dd - r_gp * r_pa * dd * dd * (drdT_pg + drdT_pa); + } +} + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void +fill_reaclib_rates(const tf_t& tfactors, T& rate_eval) +{ + + Real rate; + Real drate_dT; + + rate_p_c12_to_n13(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_c12_to_n13) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_c12_to_n13) = drate_dT; + + } + rate_he4_c12_to_o16(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_c12_to_o16) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_c12_to_o16) = drate_dT; + + } + rate_he4_n14_to_f18(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_n14_to_f18) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_n14_to_f18) = drate_dT; + + } + rate_he4_o16_to_ne20(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_o16_to_ne20) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_o16_to_ne20) = drate_dT; + + } + rate_he4_f18_to_na22(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_f18_to_na22) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_f18_to_na22) = drate_dT; + + } + rate_he4_ne20_to_mg24(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ne20_to_mg24) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ne20_to_mg24) = drate_dT; + + } + rate_p_ne21_to_na22(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_ne21_to_na22) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_ne21_to_na22) = drate_dT; + + } + rate_p_na23_to_mg24(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_na23_to_mg24) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_na23_to_mg24) = drate_dT; + + } + rate_he4_mg24_to_si28(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_mg24_to_si28) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_mg24_to_si28) = drate_dT; + + } + rate_p_al27_to_si28(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_al27_to_si28) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_al27_to_si28) = drate_dT; + + } + rate_he4_si28_to_s32(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_si28_to_s32) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_si28_to_s32) = drate_dT; + + } + rate_p_p31_to_s32(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_p31_to_s32) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_p31_to_s32) = drate_dT; + + } + rate_he4_cr48_to_fe52(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_cr48_to_fe52) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_cr48_to_fe52) = drate_dT; + + } + rate_p_mn51_to_fe52(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_mn51_to_fe52) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_mn51_to_fe52) = drate_dT; + + } + rate_he4_mn51_to_co55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_mn51_to_co55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_mn51_to_co55) = drate_dT; + + } + rate_he4_fe52_to_ni56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe52_to_ni56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe52_to_ni56) = drate_dT; + + } + rate_p_co55_to_ni56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co55_to_ni56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co55_to_ni56) = drate_dT; + + } + rate_he4_co55_to_cu59(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_co55_to_cu59) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_co55_to_cu59) = drate_dT; + + } + rate_he4_ni56_to_zn60(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ni56_to_zn60) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ni56_to_zn60) = drate_dT; + + } + rate_p_cu59_to_zn60(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_cu59_to_zn60) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_cu59_to_zn60) = drate_dT; + + } + rate_c12_c12_to_p_na23(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_c12_to_p_na23) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_c12_to_p_na23) = drate_dT; + + } + rate_c12_c12_to_he4_ne20(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_c12_to_he4_ne20) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_c12_to_he4_ne20) = drate_dT; + + } + rate_he4_n13_to_p_o16(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_n13_to_p_o16) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_n13_to_p_o16) = drate_dT; + + } + rate_c12_o16_to_p_al27(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_o16_to_p_al27) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_o16_to_p_al27) = drate_dT; + + } + rate_c12_o16_to_he4_mg24(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_o16_to_he4_mg24) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_o16_to_he4_mg24) = drate_dT; + + } + rate_o16_o16_to_p_p31(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_o16_o16_to_p_p31) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_o16_o16_to_p_p31) = drate_dT; + + } + rate_o16_o16_to_he4_si28(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_o16_o16_to_he4_si28) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_o16_o16_to_he4_si28) = drate_dT; + + } + rate_he4_f18_to_p_ne21(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_f18_to_p_ne21) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_f18_to_p_ne21) = drate_dT; + + } + rate_p_na23_to_he4_ne20(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_na23_to_he4_ne20) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_na23_to_he4_ne20) = drate_dT; + + } + rate_p_al27_to_he4_mg24(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_al27_to_he4_mg24) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_al27_to_he4_mg24) = drate_dT; + + } + rate_p_p31_to_he4_si28(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_p31_to_he4_si28) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_p31_to_he4_si28) = drate_dT; + + } + rate_he4_cr48_to_p_mn51(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_cr48_to_p_mn51) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_cr48_to_p_mn51) = drate_dT; + + } + rate_he4_fe52_to_p_co55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe52_to_p_co55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe52_to_p_co55) = drate_dT; + + } + rate_p_cu59_to_he4_ni56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_cu59_to_he4_ni56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_cu59_to_he4_ni56) = drate_dT; + + } + rate_he4_he4_he4_to_c12(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_he4_he4_to_c12) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_he4_he4_to_c12) = drate_dT; + + } + rate_c12_c12_to_mg24_modified(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_c12_to_mg24_modified) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_c12_to_mg24_modified) = drate_dT; + + } + rate_o16_o16_to_s32_modified(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_o16_o16_to_s32_modified) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_o16_o16_to_s32_modified) = drate_dT; + + } + rate_c12_o16_to_si28_modified(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_o16_to_si28_modified) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_o16_to_si28_modified) = drate_dT; + + } + rate_n_to_p_weak_wc12(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_to_p_weak_wc12) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_to_p_weak_wc12) = drate_dT; + + } + rate_p_mn55_to_fe56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_mn55_to_fe56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_mn55_to_fe56) = drate_dT; + + } + rate_n_fe52_to_fe53(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_fe52_to_fe53) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_fe52_to_fe53) = drate_dT; + + } + rate_n_fe53_to_fe54(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_fe53_to_fe54) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_fe53_to_fe54) = drate_dT; + + } + rate_he4_fe53_to_ni57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe53_to_ni57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe53_to_ni57) = drate_dT; + + } + rate_n_fe54_to_fe55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_fe54_to_fe55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_fe54_to_fe55) = drate_dT; + + } + rate_p_fe54_to_co55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe54_to_co55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe54_to_co55) = drate_dT; + + } + rate_he4_fe54_to_ni58(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe54_to_ni58) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe54_to_ni58) = drate_dT; + + } + rate_n_fe55_to_fe56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_fe55_to_fe56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_fe55_to_fe56) = drate_dT; + + } + rate_p_fe55_to_co56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe55_to_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe55_to_co56) = drate_dT; + + } + rate_p_fe56_to_co57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe56_to_co57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe56_to_co57) = drate_dT; + + } + rate_n_co55_to_co56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_co55_to_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_co55_to_co56) = drate_dT; + + } + rate_n_co56_to_co57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_co56_to_co57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_co56_to_co57) = drate_dT; + + } + rate_p_co56_to_ni57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co56_to_ni57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co56_to_ni57) = drate_dT; + + } + rate_p_co57_to_ni58(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co57_to_ni58) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co57_to_ni58) = drate_dT; + + } + rate_n_ni56_to_ni57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni56_to_ni57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni56_to_ni57) = drate_dT; + + } + rate_n_ni57_to_ni58(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni57_to_ni58) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni57_to_ni58) = drate_dT; + + } + rate_p_ni58_to_cu59(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_ni58_to_cu59) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_ni58_to_cu59) = drate_dT; + + } + rate_he4_mn51_to_p_fe54(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_mn51_to_p_fe54) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_mn51_to_p_fe54) = drate_dT; + + } + rate_he4_fe53_to_p_co56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe53_to_p_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe53_to_p_co56) = drate_dT; + + } + rate_n_fe55_to_p_mn55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_fe55_to_p_mn55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_fe55_to_p_mn55) = drate_dT; + + } + rate_n_co55_to_p_fe55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_co55_to_p_fe55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_co55_to_p_fe55) = drate_dT; + + } + rate_he4_co55_to_p_ni58(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_co55_to_p_ni58) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_co55_to_p_ni58) = drate_dT; + + } + rate_n_co56_to_p_fe56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_co56_to_p_fe56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_co56_to_p_fe56) = drate_dT; + + } + rate_p_co57_to_he4_fe54(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co57_to_he4_fe54) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co57_to_he4_fe54) = drate_dT; + + } + rate_n_ni56_to_p_co56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni56_to_p_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni56_to_p_co56) = drate_dT; + + } + rate_n_ni56_to_he4_fe53(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni56_to_he4_fe53) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni56_to_he4_fe53) = drate_dT; + + } + rate_n_ni57_to_p_co57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni57_to_p_co57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni57_to_p_co57) = drate_dT; + + } + rate_n_ni57_to_he4_fe54(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni57_to_he4_fe54) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni57_to_he4_fe54) = drate_dT; + + } + rate_n_ni58_to_he4_fe55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni58_to_he4_fe55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni58_to_he4_fe55) = drate_dT; + + } + rate_n_cu59_to_he4_co56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_cu59_to_he4_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_cu59_to_he4_co56) = drate_dT; + + } + rate_n_zn60_to_he4_ni57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_zn60_to_he4_ni57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_zn60_to_he4_ni57) = drate_dT; + + } + rate_he4_s32_to_ar36_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_s32_to_ar36_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_s32_to_ar36_removed) = drate_dT; + + } + rate_p_cl35_to_ar36_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_cl35_to_ar36_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_cl35_to_ar36_removed) = drate_dT; + + } + rate_p_cl35_to_he4_s32_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_cl35_to_he4_s32_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_cl35_to_he4_s32_removed) = drate_dT; + + } + rate_he4_ar36_to_ca40_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ar36_to_ca40_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ar36_to_ca40_removed) = drate_dT; + + } + rate_p_k39_to_ca40_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_k39_to_ca40_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_k39_to_ca40_removed) = drate_dT; + + } + rate_p_k39_to_he4_ar36_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_k39_to_he4_ar36_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_k39_to_he4_ar36_removed) = drate_dT; + + } + rate_he4_ca40_to_ti44_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ca40_to_ti44_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ca40_to_ti44_removed) = drate_dT; + + } + rate_p_sc43_to_ti44_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_sc43_to_ti44_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_sc43_to_ti44_removed) = drate_dT; + + } + rate_p_sc43_to_he4_ca40_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_sc43_to_he4_ca40_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_sc43_to_he4_ca40_removed) = drate_dT; + + } + rate_he4_ti44_to_cr48_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ti44_to_cr48_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ti44_to_cr48_removed) = drate_dT; + + } + rate_he4_ti44_to_p_v47_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ti44_to_p_v47_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ti44_to_p_v47_removed) = drate_dT; + + } + rate_p_v47_to_cr48_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_v47_to_cr48_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_v47_to_cr48_removed) = drate_dT; + + } + rate_n13_to_p_c12_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n13_to_p_c12_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n13_to_p_c12_derived) = drate_dT; + + } + rate_o16_to_he4_c12_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_o16_to_he4_c12_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_o16_to_he4_c12_derived) = drate_dT; + + } + rate_f18_to_he4_n14_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_f18_to_he4_n14_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_f18_to_he4_n14_derived) = drate_dT; + + } + rate_ne20_to_he4_o16_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ne20_to_he4_o16_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ne20_to_he4_o16_derived) = drate_dT; + + } + rate_na22_to_p_ne21_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_na22_to_p_ne21_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_na22_to_p_ne21_derived) = drate_dT; + + } + rate_na22_to_he4_f18_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_na22_to_he4_f18_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_na22_to_he4_f18_derived) = drate_dT; + + } + rate_mg24_to_p_na23_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_mg24_to_p_na23_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_mg24_to_p_na23_derived) = drate_dT; + + } + rate_mg24_to_he4_ne20_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_mg24_to_he4_ne20_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_mg24_to_he4_ne20_derived) = drate_dT; + + } + rate_si28_to_p_al27_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_si28_to_p_al27_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_si28_to_p_al27_derived) = drate_dT; + + } + rate_si28_to_he4_mg24_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_si28_to_he4_mg24_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_si28_to_he4_mg24_derived) = drate_dT; + + } + rate_s32_to_p_p31_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_s32_to_p_p31_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_s32_to_p_p31_derived) = drate_dT; + + } + rate_s32_to_he4_si28_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_s32_to_he4_si28_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_s32_to_he4_si28_derived) = drate_dT; + + } + rate_fe52_to_p_mn51_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe52_to_p_mn51_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe52_to_p_mn51_derived) = drate_dT; + + } + rate_fe52_to_he4_cr48_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe52_to_he4_cr48_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe52_to_he4_cr48_derived) = drate_dT; + + } + rate_co55_to_he4_mn51_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co55_to_he4_mn51_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co55_to_he4_mn51_derived) = drate_dT; + + } + rate_ni56_to_p_co55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni56_to_p_co55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni56_to_p_co55_derived) = drate_dT; + + } + rate_ni56_to_he4_fe52_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni56_to_he4_fe52_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni56_to_he4_fe52_derived) = drate_dT; + + } + rate_cu59_to_he4_co55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_cu59_to_he4_co55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_cu59_to_he4_co55_derived) = drate_dT; + + } + rate_zn60_to_p_cu59_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_zn60_to_p_cu59_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_zn60_to_p_cu59_derived) = drate_dT; + + } + rate_zn60_to_he4_ni56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_zn60_to_he4_ni56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_zn60_to_he4_ni56_derived) = drate_dT; + + } + rate_c12_to_he4_he4_he4_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_to_he4_he4_he4_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_to_he4_he4_he4_derived) = drate_dT; + + } + rate_p_o16_to_he4_n13_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_o16_to_he4_n13_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_o16_to_he4_n13_derived) = drate_dT; + + } + rate_he4_ne20_to_p_na23_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ne20_to_p_na23_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ne20_to_p_na23_derived) = drate_dT; + + } + rate_p_ne21_to_he4_f18_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_ne21_to_he4_f18_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_ne21_to_he4_f18_derived) = drate_dT; + + } + rate_he4_mg24_to_p_al27_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_mg24_to_p_al27_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_mg24_to_p_al27_derived) = drate_dT; + + } + rate_he4_si28_to_p_p31_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_si28_to_p_p31_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_si28_to_p_p31_derived) = drate_dT; + + } + rate_p_mn51_to_he4_cr48_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_mn51_to_he4_cr48_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_mn51_to_he4_cr48_derived) = drate_dT; + + } + rate_p_co55_to_he4_fe52_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co55_to_he4_fe52_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co55_to_he4_fe52_derived) = drate_dT; + + } + rate_he4_ni56_to_p_cu59_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ni56_to_p_cu59_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ni56_to_p_cu59_derived) = drate_dT; + + } + rate_fe53_to_n_fe52_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe53_to_n_fe52_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe53_to_n_fe52_derived) = drate_dT; + + } + rate_fe54_to_n_fe53_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe54_to_n_fe53_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe54_to_n_fe53_derived) = drate_dT; + + } + rate_fe55_to_n_fe54_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe55_to_n_fe54_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe55_to_n_fe54_derived) = drate_dT; + + } + rate_fe56_to_n_fe55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe56_to_n_fe55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe56_to_n_fe55_derived) = drate_dT; + + } + rate_fe56_to_p_mn55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe56_to_p_mn55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe56_to_p_mn55_derived) = drate_dT; + + } + rate_co55_to_p_fe54_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co55_to_p_fe54_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co55_to_p_fe54_derived) = drate_dT; + + } + rate_co56_to_n_co55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co56_to_n_co55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co56_to_n_co55_derived) = drate_dT; + + } + rate_co56_to_p_fe55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co56_to_p_fe55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co56_to_p_fe55_derived) = drate_dT; + + } + rate_co57_to_n_co56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co57_to_n_co56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co57_to_n_co56_derived) = drate_dT; + + } + rate_co57_to_p_fe56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co57_to_p_fe56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co57_to_p_fe56_derived) = drate_dT; + + } + rate_ni57_to_n_ni56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni57_to_n_ni56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni57_to_n_ni56_derived) = drate_dT; + + } + rate_ni57_to_p_co56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni57_to_p_co56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni57_to_p_co56_derived) = drate_dT; + + } + rate_ni57_to_he4_fe53_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni57_to_he4_fe53_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni57_to_he4_fe53_derived) = drate_dT; + + } + rate_ni58_to_n_ni57_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni58_to_n_ni57_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni58_to_n_ni57_derived) = drate_dT; + + } + rate_ni58_to_p_co57_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni58_to_p_co57_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni58_to_p_co57_derived) = drate_dT; + + } + rate_ni58_to_he4_fe54_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni58_to_he4_fe54_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni58_to_he4_fe54_derived) = drate_dT; + + } + rate_cu59_to_p_ni58_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_cu59_to_p_ni58_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_cu59_to_p_ni58_derived) = drate_dT; + + } + rate_p_mn55_to_n_fe55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_mn55_to_n_fe55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_mn55_to_n_fe55_derived) = drate_dT; + + } + rate_he4_fe53_to_n_ni56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe53_to_n_ni56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe53_to_n_ni56_derived) = drate_dT; + + } + rate_p_fe54_to_he4_mn51_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe54_to_he4_mn51_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe54_to_he4_mn51_derived) = drate_dT; + + } + rate_he4_fe54_to_n_ni57_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe54_to_n_ni57_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe54_to_n_ni57_derived) = drate_dT; + + } + rate_he4_fe54_to_p_co57_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe54_to_p_co57_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe54_to_p_co57_derived) = drate_dT; + + } + rate_p_fe55_to_n_co55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe55_to_n_co55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe55_to_n_co55_derived) = drate_dT; + + } + rate_he4_fe55_to_n_ni58_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe55_to_n_ni58_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe55_to_n_ni58_derived) = drate_dT; + + } + rate_p_fe56_to_n_co56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe56_to_n_co56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe56_to_n_co56_derived) = drate_dT; + + } + rate_p_co56_to_n_ni56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co56_to_n_ni56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co56_to_n_ni56_derived) = drate_dT; + + } + rate_p_co56_to_he4_fe53_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co56_to_he4_fe53_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co56_to_he4_fe53_derived) = drate_dT; + + } + rate_he4_co56_to_n_cu59_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_co56_to_n_cu59_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_co56_to_n_cu59_derived) = drate_dT; + + } + rate_p_co57_to_n_ni57_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co57_to_n_ni57_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co57_to_n_ni57_derived) = drate_dT; + + } + rate_he4_ni57_to_n_zn60_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ni57_to_n_zn60_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ni57_to_n_zn60_derived) = drate_dT; + + } + rate_p_ni58_to_he4_co55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_ni58_to_he4_co55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_ni58_to_he4_co55_derived) = drate_dT; + + } + rate_he4_s32_to_p_cl35_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_s32_to_p_cl35_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_s32_to_p_cl35_derived_removed) = drate_dT; + + } + rate_ar36_to_he4_s32_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ar36_to_he4_s32_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ar36_to_he4_s32_derived_removed) = drate_dT; + + } + rate_ar36_to_p_cl35_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ar36_to_p_cl35_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ar36_to_p_cl35_derived_removed) = drate_dT; + + } + rate_he4_ar36_to_p_k39_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ar36_to_p_k39_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ar36_to_p_k39_derived_removed) = drate_dT; + + } + rate_ca40_to_he4_ar36_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ca40_to_he4_ar36_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ca40_to_he4_ar36_derived_removed) = drate_dT; + + } + rate_ca40_to_p_k39_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ca40_to_p_k39_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ca40_to_p_k39_derived_removed) = drate_dT; + + } + rate_he4_ca40_to_p_sc43_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ca40_to_p_sc43_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ca40_to_p_sc43_derived_removed) = drate_dT; + + } + rate_ti44_to_he4_ca40_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ti44_to_he4_ca40_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ti44_to_he4_ca40_derived_removed) = drate_dT; + + } + rate_ti44_to_p_sc43_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ti44_to_p_sc43_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ti44_to_p_sc43_derived_removed) = drate_dT; + + } + rate_cr48_to_he4_ti44_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_cr48_to_he4_ti44_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_cr48_to_he4_ti44_derived_removed) = drate_dT; + + } + rate_cr48_to_p_v47_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_cr48_to_p_v47_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_cr48_to_p_v47_derived_removed) = drate_dT; + + } + rate_p_v47_to_he4_ti44_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_v47_to_he4_ti44_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_v47_to_he4_ti44_derived_removed) = drate_dT; + + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void +fill_approx_rates([[maybe_unused]] const tf_t& tfactors, [[maybe_unused]] T& rate_eval) +{ + + [[maybe_unused]] Real rate{}; + [[maybe_unused]] Real drate_dT{}; + + rate_s32_he4_to_ar36_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_s32_he4_to_ar36_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_s32_he4_to_ar36_approx) = drate_dT; + + } + rate_ar36_to_s32_he4_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ar36_to_s32_he4_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ar36_to_s32_he4_approx) = drate_dT; + + } + rate_ar36_he4_to_ca40_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ar36_he4_to_ca40_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ar36_he4_to_ca40_approx) = drate_dT; + + } + rate_ca40_to_ar36_he4_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ca40_to_ar36_he4_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ca40_to_ar36_he4_approx) = drate_dT; + + } + rate_ca40_he4_to_ti44_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ca40_he4_to_ti44_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ca40_he4_to_ti44_approx) = drate_dT; + + } + rate_ti44_to_ca40_he4_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ti44_to_ca40_he4_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ti44_to_ca40_he4_approx) = drate_dT; + + } + rate_ti44_he4_to_cr48_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ti44_he4_to_cr48_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ti44_he4_to_cr48_approx) = drate_dT; + + } + rate_cr48_to_ti44_he4_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_cr48_to_ti44_he4_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_cr48_to_ti44_he4_approx) = drate_dT; + + } + +} + +#endif diff --git a/networks/He-C-Fe-group/table_rates.H b/networks/He-C-Fe-group/table_rates.H new file mode 100644 index 0000000000..a9c6f74c68 --- /dev/null +++ b/networks/He-C-Fe-group/table_rates.H @@ -0,0 +1,440 @@ +#ifndef TABLE_RATES_H +#define TABLE_RATES_H + +#include +#include +#include +#include + +#include + +using namespace amrex; + +void init_tabular(); + +// Table is expected to be in terms of dens*ye and temp (logarithmic, cgs units) +// Table energy units are expected in terms of ergs + +// all tables are expected to have columns: +// Log(rhoY) Log(T) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +// Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +// + +const int num_tables = 10; + +enum TableVars +{ + jtab_mu = 1, + jtab_dq = 2, + jtab_vs = 3, + jtab_rate = 4, + jtab_nuloss = 5, + jtab_gamma = 6, + num_vars = jtab_gamma +}; + + +struct table_t +{ + int ntemp; + int nrhoy; + int nvars; + int nheader; +}; + +// we add a 7th index, k_index_dlogr_dlogt used for computing the derivative +// of Log(rate) with respect of Log(temperature) by using the table +// values. It isn't an index into the table but into the 'entries' +// array. Is important to mention that although we compute dlogr/dlogT is +// the computed quantity in 'entries', we pursue ultimately +// dr/dt as the final desired quantity to be computed for this index. + +const int k_index_dlogr_dlogt = 7; +const int add_vars = 1; // 1 Additional Var in entries + + +namespace rate_tables +{ + extern AMREX_GPU_MANAGED table_t j_co55_fe55_meta; + extern AMREX_GPU_MANAGED Array3D j_co55_fe55_data; + extern AMREX_GPU_MANAGED Array1D j_co55_fe55_rhoy; + extern AMREX_GPU_MANAGED Array1D j_co55_fe55_temp; + + extern AMREX_GPU_MANAGED table_t j_co56_fe56_meta; + extern AMREX_GPU_MANAGED Array3D j_co56_fe56_data; + extern AMREX_GPU_MANAGED Array1D j_co56_fe56_rhoy; + extern AMREX_GPU_MANAGED Array1D j_co56_fe56_temp; + + extern AMREX_GPU_MANAGED table_t j_co56_ni56_meta; + extern AMREX_GPU_MANAGED Array3D j_co56_ni56_data; + extern AMREX_GPU_MANAGED Array1D j_co56_ni56_rhoy; + extern AMREX_GPU_MANAGED Array1D j_co56_ni56_temp; + + extern AMREX_GPU_MANAGED table_t j_co57_ni57_meta; + extern AMREX_GPU_MANAGED Array3D j_co57_ni57_data; + extern AMREX_GPU_MANAGED Array1D j_co57_ni57_rhoy; + extern AMREX_GPU_MANAGED Array1D j_co57_ni57_temp; + + extern AMREX_GPU_MANAGED table_t j_fe55_co55_meta; + extern AMREX_GPU_MANAGED Array3D j_fe55_co55_data; + extern AMREX_GPU_MANAGED Array1D j_fe55_co55_rhoy; + extern AMREX_GPU_MANAGED Array1D j_fe55_co55_temp; + + extern AMREX_GPU_MANAGED table_t j_fe55_mn55_meta; + extern AMREX_GPU_MANAGED Array3D j_fe55_mn55_data; + extern AMREX_GPU_MANAGED Array1D j_fe55_mn55_rhoy; + extern AMREX_GPU_MANAGED Array1D j_fe55_mn55_temp; + + extern AMREX_GPU_MANAGED table_t j_fe56_co56_meta; + extern AMREX_GPU_MANAGED Array3D j_fe56_co56_data; + extern AMREX_GPU_MANAGED Array1D j_fe56_co56_rhoy; + extern AMREX_GPU_MANAGED Array1D j_fe56_co56_temp; + + extern AMREX_GPU_MANAGED table_t j_mn55_fe55_meta; + extern AMREX_GPU_MANAGED Array3D j_mn55_fe55_data; + extern AMREX_GPU_MANAGED Array1D j_mn55_fe55_rhoy; + extern AMREX_GPU_MANAGED Array1D j_mn55_fe55_temp; + + extern AMREX_GPU_MANAGED table_t j_ni56_co56_meta; + extern AMREX_GPU_MANAGED Array3D j_ni56_co56_data; + extern AMREX_GPU_MANAGED Array1D j_ni56_co56_rhoy; + extern AMREX_GPU_MANAGED Array1D j_ni56_co56_temp; + + extern AMREX_GPU_MANAGED table_t j_ni57_co57_meta; + extern AMREX_GPU_MANAGED Array3D j_ni57_co57_data; + extern AMREX_GPU_MANAGED Array1D j_ni57_co57_rhoy; + extern AMREX_GPU_MANAGED Array1D j_ni57_co57_temp; + +} + +template +void init_tab_info(const table_t& tf, const std::string& file, R& log_rhoy_table, T& log_temp_table, D& data) +{ + // This function initializes the selected tabular-rate tables. From the tables we are interested + // on the rate, neutrino-energy-loss and the gamma-energy entries. + + std::ifstream table; + table.open(file); + + std::string line; + + // read and skip over the header + + for (int i = 0; i < tf.nheader; ++i) { + std::getline(table, line); + } + + // now the data -- there are 2 extra columns, for log_temp and log_rhoy + + for (int j = 1; j <= tf.nrhoy; ++j) { + for (int i = 1; i <= tf.ntemp; ++i) { + std::getline(table, line); + std::istringstream sdata(line); + + sdata >> log_rhoy_table(j) >> log_temp_table(i); + + for (int n = 1; n <= tf.nvars; ++n) { + sdata >> data(i, j, n); + } + } + } + table.close(); +} + + +template +AMREX_INLINE AMREX_GPU_HOST_DEVICE +int vector_index_lu(const int vlen, const V& vector, const Real fvar) +{ + + // Returns the greatest index of vector for which vector(index) < fvar. + // Return 1 if fvar < vector(1) + // Return size(vector)-1 if fvar > vector(size(vector)) + // The interval [index, index+1] brackets fvar for fvar within the range of vector. + + int index; + + if (fvar < vector(1)) { + index = 1; + } else if (fvar > vector(vlen)) { + index = vlen - 1; + } else { + int nup = vlen; + int ndn = 1; + for (int i = 1; i <= vlen; ++i) { + int j = ndn + (nup - ndn)/2; + if (fvar < vector(j)) { + nup = j; + } else { + ndn = j; + } + if ((nup - ndn) == 1) { + break; + } + } + index = ndn; + } + return index; +} + + +AMREX_INLINE AMREX_GPU_HOST_DEVICE +Real +evaluate_linear_1d(const Real fhi, const Real flo, const Real xhi, const Real xlo, const Real x) +{ + // This function is a 1-D linear interpolator, that keeps x constant to xlo or xhi, based + // on the side, if x is outside [xlo, xhi] respectively. + + Real xx = Clamp(x, xlo, xhi); + Real f = flo + (fhi - flo) * (xx - xlo) / (xhi - xlo); + + return f; +} + +AMREX_INLINE AMREX_GPU_HOST_DEVICE +Real +evaluate_linear_2d(const Real fip1jp1, const Real fip1j, const Real fijp1, const Real fij, + const Real xhi, const Real xlo, const Real yhi, const Real ylo, + const Real x, const Real y) +{ + // This is the 2-D linear interpolator, as an extension of evaluate_linear_1d. + + Real f; + Real dx = xhi - xlo; + Real dy = yhi - ylo; + + Real E = fij; + Real C = (fijp1 - fij) / dy; + Real B = (fip1j - fij) / dx; + Real A = (fip1jp1 - B * dx - C * dy - E) / (dx * dy); + + Real xx = Clamp(x, xlo, xhi); + Real yy = Clamp(y, ylo, yhi); + + f = A * (xx - xlo) * (yy - ylo) + + B * (xx - xlo) + + C * (yy - ylo) + + E; + + return f; +} + + +template +AMREX_INLINE AMREX_GPU_HOST_DEVICE +Real +evaluate_vars(const table_t& table_meta, const R& log_rhoy_table, const T& log_temp_table, const D& data, + const Real log_rhoy, const Real log_temp, const int component) +{ + // This function evaluates the 2-D interpolator, for several pairs of rho_ye and temperature. + + int jtemp_lo = vector_index_lu(table_meta.ntemp, log_temp_table, log_temp); + int jtemp_hi = jtemp_lo + 1; + + int irhoy_lo = vector_index_lu(table_meta.nrhoy, log_rhoy_table, log_rhoy); + int irhoy_hi = irhoy_lo + 1; + + Real rhoy_lo = log_rhoy_table(irhoy_lo); + Real rhoy_hi = log_rhoy_table(irhoy_hi); + + Real t_lo = log_temp_table(jtemp_lo); + Real t_hi = log_temp_table(jtemp_hi); + + Real fij = data(jtemp_lo, irhoy_lo, component); + Real fip1j = data(jtemp_lo, irhoy_hi, component); + Real fijp1 = data(jtemp_hi, irhoy_lo, component); + Real fip1jp1 = data(jtemp_hi, irhoy_hi, component); + + Real r = evaluate_linear_2d(fip1jp1, fip1j, fijp1, fij, + rhoy_hi, rhoy_lo, t_hi, t_lo, log_rhoy, log_temp); + + return r; +} + + +template +AMREX_INLINE AMREX_GPU_HOST_DEVICE +Real +evaluate_dr_dtemp(const table_t& table_meta, const R& log_rhoy_table, const T& log_temp_table, const D& data, + const Real log_rhoy, const Real log_temp) +{ + // The main objective of this function is compute dlogr_dlogt. + + int irhoy_lo = vector_index_lu(table_meta.nrhoy, log_rhoy_table, log_rhoy); + int irhoy_hi = irhoy_lo + 1; + + int jtemp_lo = vector_index_lu(table_meta.ntemp, log_temp_table, log_temp); + int jtemp_hi = jtemp_lo + 1; + + Real dlogr_dlogt; + + //Now we compute the forward finite difference on the boundary + + if ((jtemp_lo - 1 < 1) || (jtemp_hi + 1 > table_meta.ntemp)) { + + // In this case we are in the boundaries of the table. + // At the boundary, we compute the forward-j finite difference + // to compute dlogr_dlogt_i and dlogr_dlogt_ip1, using the + // following stencil: + // + // + // fijp1-----------fip1jp1 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fij-------------fip1j + // + // with the following result: + // + // dlogr_dlogt_i --------dlogr_dlogt_ip1 + // + // Finally, we perform a 1d-linear interpolation between dlogr_dlogt_ip1 + // and dlogr_dlogt_i to compute dlogr_dlogt + + Real log_rhoy_lo = log_temp_table(irhoy_lo); + Real log_rhoy_hi = log_temp_table(irhoy_hi); + + Real log_temp_lo = log_temp_table(jtemp_lo); + Real log_temp_hi = log_temp_table(jtemp_hi); + + Real fij = data(jtemp_lo, irhoy_lo, jtab_rate); + Real fip1j = data(jtemp_lo, irhoy_hi, jtab_rate); + Real fijp1 = data(jtemp_hi, irhoy_lo, jtab_rate); + Real fip1jp1 = data(jtemp_hi, irhoy_hi, jtab_rate); + + Real dlogr_dlogt_i = (fijp1 - fij) / (log_temp_hi - log_temp_lo); + Real dlogr_dlogt_ip1 = (fip1jp1 - fip1j) / (log_temp_hi - log_temp_lo); + + if ((log_temp < log_temp_lo) || (log_temp > log_temp_hi)) { + dlogr_dlogt = 0.0_rt; + } else { + dlogr_dlogt = evaluate_linear_1d(dlogr_dlogt_ip1, dlogr_dlogt_i, log_rhoy_hi, log_rhoy_lo, log_rhoy); + } + + } else { + + // In this case, we use a bigger stencil to reconstruct the + // temperature derivatives in the j and j+1 temperature positions, + // using the cetral-j finite differences: + // + // fijp2 ------------fip1jp2 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fijp1------------fip1jp1 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fij------------- fip1j + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fijm1------------fip1jm1 + // + // with the following result: + // + // + // dr_dt_ijp1 --------dr_dt_ip1jp1 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // dr_dt_ij-----------dr_dt_ip1j + // + // Finally, we perform a 2d-linear interpolation to + // compute dlogr_dlogt. + + Real log_temp_jm1 = log_temp_table(jtemp_lo-1); + Real log_temp_j = log_temp_table(jtemp_lo); + Real log_temp_jp1 = log_temp_table(jtemp_hi); + Real log_temp_jp2 = log_temp_table(jtemp_hi+1); + + Real log_rhoy_lo = log_rhoy_table(irhoy_lo); + Real log_rhoy_hi = log_rhoy_table(irhoy_hi); + + Real fijm1 = data(jtemp_lo-1, irhoy_lo, jtab_rate); + Real fij = data(jtemp_lo, irhoy_lo, jtab_rate); + Real fijp1 = data(jtemp_hi, irhoy_lo, jtab_rate); + Real fijp2 = data(jtemp_hi+1, irhoy_lo, jtab_rate); + + Real fip1jm1 = data(jtemp_lo-1, irhoy_hi, jtab_rate); + Real fip1j = data(jtemp_lo, irhoy_hi, jtab_rate); + Real fip1jp1 = data(jtemp_hi, irhoy_hi, jtab_rate); + Real fip1jp2 = data(jtemp_hi+1, irhoy_hi, jtab_rate); + + Real dlogr_dlogt_ij = (fijp1 - fijm1)/(log_temp_jp1 - log_temp_jm1); + Real dlogr_dlogt_ijp1 = (fijp2 - fij)/(log_temp_jp2 - log_temp_j); + Real dlogr_dlogt_ip1j = (fip1jp1 - fip1jm1)/(log_temp_jp1 - log_temp_jm1); + Real dlogr_dlogt_ip1jp1 = (fip1jp2 - fip1j)/(log_temp_jp2 - log_temp_j); + + dlogr_dlogt = evaluate_linear_2d(dlogr_dlogt_ip1jp1, dlogr_dlogt_ip1j, dlogr_dlogt_ijp1, dlogr_dlogt_ij, + log_rhoy_hi, log_rhoy_lo, log_temp_jp1, log_temp_j, + log_rhoy, log_temp); + + } + return dlogr_dlogt; +} + + +template +AMREX_INLINE AMREX_GPU_HOST_DEVICE +void +get_entries(const table_t& table_meta, const R& log_rhoy_table, const T& log_temp_table, const D& data, + const Real log_rhoy, const Real log_temp, Array1D& entries) +{ + for (int ivar = 1; ivar <= num_vars; ivar++) { + entries(ivar) = evaluate_vars(table_meta, log_rhoy_table, log_temp_table, data, + log_rhoy, log_temp, ivar); + } + + entries(k_index_dlogr_dlogt) = evaluate_dr_dtemp(table_meta, log_rhoy_table, log_temp_table, data, + log_rhoy, log_temp); +} + +template +AMREX_INLINE AMREX_GPU_HOST_DEVICE +void +tabular_evaluate(const table_t& table_meta, + const R& log_rhoy_table, const T& log_temp_table, const D& data, + const Real rhoy, const Real temp, + Real& rate, Real& drate_dt, Real& edot_nu, Real& edot_gamma) +{ + Array1D entries; + + // Get the table entries at this rhoy, temp + + Real log_rhoy = std::log10(rhoy); + Real log_temp = std::log10(temp); + + get_entries(table_meta, log_rhoy_table, log_temp_table, data, + log_rhoy, log_temp, entries); + + // Fill outputs: rate, d(rate)/d(temperature), and + // (negative) neutrino loss contribution to energy generation + + rate = std::pow(10.0_rt, entries(jtab_rate)); + drate_dt = rate * entries(k_index_dlogr_dlogt) / temp; + edot_nu = -std::pow(10.0_rt, entries(jtab_nuloss)); + edot_gamma = std::pow(10.0_rt, entries(jtab_gamma)); +} + +#endif diff --git a/networks/He-C-Fe-group/table_rates_data.cpp b/networks/He-C-Fe-group/table_rates_data.cpp new file mode 100644 index 0000000000..5ac5e8a541 --- /dev/null +++ b/networks/He-C-Fe-group/table_rates_data.cpp @@ -0,0 +1,153 @@ +#include +#include +#include +#include + +using namespace amrex; + +namespace rate_tables +{ + + AMREX_GPU_MANAGED table_t j_co55_fe55_meta; + AMREX_GPU_MANAGED Array3D j_co55_fe55_data; + AMREX_GPU_MANAGED Array1D j_co55_fe55_rhoy; + AMREX_GPU_MANAGED Array1D j_co55_fe55_temp; + + AMREX_GPU_MANAGED table_t j_co56_fe56_meta; + AMREX_GPU_MANAGED Array3D j_co56_fe56_data; + AMREX_GPU_MANAGED Array1D j_co56_fe56_rhoy; + AMREX_GPU_MANAGED Array1D j_co56_fe56_temp; + + AMREX_GPU_MANAGED table_t j_co56_ni56_meta; + AMREX_GPU_MANAGED Array3D j_co56_ni56_data; + AMREX_GPU_MANAGED Array1D j_co56_ni56_rhoy; + AMREX_GPU_MANAGED Array1D j_co56_ni56_temp; + + AMREX_GPU_MANAGED table_t j_co57_ni57_meta; + AMREX_GPU_MANAGED Array3D j_co57_ni57_data; + AMREX_GPU_MANAGED Array1D j_co57_ni57_rhoy; + AMREX_GPU_MANAGED Array1D j_co57_ni57_temp; + + AMREX_GPU_MANAGED table_t j_fe55_co55_meta; + AMREX_GPU_MANAGED Array3D j_fe55_co55_data; + AMREX_GPU_MANAGED Array1D j_fe55_co55_rhoy; + AMREX_GPU_MANAGED Array1D j_fe55_co55_temp; + + AMREX_GPU_MANAGED table_t j_fe55_mn55_meta; + AMREX_GPU_MANAGED Array3D j_fe55_mn55_data; + AMREX_GPU_MANAGED Array1D j_fe55_mn55_rhoy; + AMREX_GPU_MANAGED Array1D j_fe55_mn55_temp; + + AMREX_GPU_MANAGED table_t j_fe56_co56_meta; + AMREX_GPU_MANAGED Array3D j_fe56_co56_data; + AMREX_GPU_MANAGED Array1D j_fe56_co56_rhoy; + AMREX_GPU_MANAGED Array1D j_fe56_co56_temp; + + AMREX_GPU_MANAGED table_t j_mn55_fe55_meta; + AMREX_GPU_MANAGED Array3D j_mn55_fe55_data; + AMREX_GPU_MANAGED Array1D j_mn55_fe55_rhoy; + AMREX_GPU_MANAGED Array1D j_mn55_fe55_temp; + + AMREX_GPU_MANAGED table_t j_ni56_co56_meta; + AMREX_GPU_MANAGED Array3D j_ni56_co56_data; + AMREX_GPU_MANAGED Array1D j_ni56_co56_rhoy; + AMREX_GPU_MANAGED Array1D j_ni56_co56_temp; + + AMREX_GPU_MANAGED table_t j_ni57_co57_meta; + AMREX_GPU_MANAGED Array3D j_ni57_co57_data; + AMREX_GPU_MANAGED Array1D j_ni57_co57_rhoy; + AMREX_GPU_MANAGED Array1D j_ni57_co57_temp; + + +} + + +void init_tabular() +{ + + amrex::Print() << "reading in network electron-capture / beta-decay tables..." << std::endl; + + using namespace rate_tables; + + j_co55_fe55_meta.ntemp = 13; + j_co55_fe55_meta.nrhoy = 11; + j_co55_fe55_meta.nvars = 6; + j_co55_fe55_meta.nheader = 5; + + init_tab_info(j_co55_fe55_meta, "55co-55fe_electroncapture.dat", j_co55_fe55_rhoy, j_co55_fe55_temp, j_co55_fe55_data); + + + j_co56_fe56_meta.ntemp = 13; + j_co56_fe56_meta.nrhoy = 11; + j_co56_fe56_meta.nvars = 6; + j_co56_fe56_meta.nheader = 5; + + init_tab_info(j_co56_fe56_meta, "56co-56fe_electroncapture.dat", j_co56_fe56_rhoy, j_co56_fe56_temp, j_co56_fe56_data); + + + j_co56_ni56_meta.ntemp = 13; + j_co56_ni56_meta.nrhoy = 11; + j_co56_ni56_meta.nvars = 6; + j_co56_ni56_meta.nheader = 5; + + init_tab_info(j_co56_ni56_meta, "56co-56ni_betadecay.dat", j_co56_ni56_rhoy, j_co56_ni56_temp, j_co56_ni56_data); + + + j_co57_ni57_meta.ntemp = 13; + j_co57_ni57_meta.nrhoy = 11; + j_co57_ni57_meta.nvars = 6; + j_co57_ni57_meta.nheader = 5; + + init_tab_info(j_co57_ni57_meta, "57co-57ni_betadecay.dat", j_co57_ni57_rhoy, j_co57_ni57_temp, j_co57_ni57_data); + + + j_fe55_co55_meta.ntemp = 13; + j_fe55_co55_meta.nrhoy = 11; + j_fe55_co55_meta.nvars = 6; + j_fe55_co55_meta.nheader = 5; + + init_tab_info(j_fe55_co55_meta, "55fe-55co_betadecay.dat", j_fe55_co55_rhoy, j_fe55_co55_temp, j_fe55_co55_data); + + + j_fe55_mn55_meta.ntemp = 13; + j_fe55_mn55_meta.nrhoy = 11; + j_fe55_mn55_meta.nvars = 6; + j_fe55_mn55_meta.nheader = 5; + + init_tab_info(j_fe55_mn55_meta, "55fe-55mn_electroncapture.dat", j_fe55_mn55_rhoy, j_fe55_mn55_temp, j_fe55_mn55_data); + + + j_fe56_co56_meta.ntemp = 13; + j_fe56_co56_meta.nrhoy = 11; + j_fe56_co56_meta.nvars = 6; + j_fe56_co56_meta.nheader = 5; + + init_tab_info(j_fe56_co56_meta, "56fe-56co_betadecay.dat", j_fe56_co56_rhoy, j_fe56_co56_temp, j_fe56_co56_data); + + + j_mn55_fe55_meta.ntemp = 13; + j_mn55_fe55_meta.nrhoy = 11; + j_mn55_fe55_meta.nvars = 6; + j_mn55_fe55_meta.nheader = 5; + + init_tab_info(j_mn55_fe55_meta, "55mn-55fe_betadecay.dat", j_mn55_fe55_rhoy, j_mn55_fe55_temp, j_mn55_fe55_data); + + + j_ni56_co56_meta.ntemp = 13; + j_ni56_co56_meta.nrhoy = 11; + j_ni56_co56_meta.nvars = 6; + j_ni56_co56_meta.nheader = 5; + + init_tab_info(j_ni56_co56_meta, "56ni-56co_electroncapture.dat", j_ni56_co56_rhoy, j_ni56_co56_temp, j_ni56_co56_data); + + + j_ni57_co57_meta.ntemp = 13; + j_ni57_co57_meta.nrhoy = 11; + j_ni57_co57_meta.nvars = 6; + j_ni57_co57_meta.nheader = 5; + + init_tab_info(j_ni57_co57_meta, "57ni-57co_electroncapture.dat", j_ni57_co57_rhoy, j_ni57_co57_temp, j_ni57_co57_data); + + + +} diff --git a/networks/He-C-Fe-group/tfactors.H b/networks/He-C-Fe-group/tfactors.H new file mode 100644 index 0000000000..43a6316db7 --- /dev/null +++ b/networks/He-C-Fe-group/tfactors.H @@ -0,0 +1,34 @@ +#ifndef TFACTORS_H +#define TFACTORS_H + +struct tf_t { + Real T9; + Real T9i; + Real T943i; + Real T923i; + Real T913i; + Real T913; + Real T923; + Real T953; + Real lnT9; +}; + +AMREX_GPU_HOST_DEVICE AMREX_INLINE +tf_t evaluate_tfactors(const Real T) +{ + + tf_t tf; + tf.T9 = T / 1.e9_rt; + tf.T9i = 1.0_rt / tf.T9; + tf.T913 = std::cbrt(tf.T9); + tf.T913i = 1.0_rt / tf.T913; + tf.T923i = tf.T913i * tf.T913i; + tf.T943i = tf.T9i * tf.T913i; + tf.T923 = tf.T913 * tf.T913; + tf.T953 = tf.T9 * tf.T923; + tf.lnT9 = std::log(tf.T9); + + return tf; +} + +#endif \ No newline at end of file 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/ase/ase.py b/networks/ase/ase.py index 81663403ce..273bcbc310 100644 --- a/networks/ase/ase.py +++ b/networks/ase/ase.py @@ -56,14 +56,14 @@ def get_library(): print("removing: ", r) _r = subch.get_rate_by_name(r) subch.remove_rate(_r) - + # additional neutron rates to remove for r in subch.get_rates(): if (r == subch.get_rate_by_name("mg24(n,a)ne21") or r == subch.get_rate_by_name("ne21(a,n)mg24") or r == subch.get_rate_by_name("na22(n,g)na23") or r == subch.get_rate_by_name("na23(g,n)na22") or r == subch.get_rate_by_name("ne21(g,n)ne20") or r == subch.get_rate_by_name("ne20(n,g)ne21")): continue - + if pyna.Nucleus("n") in r.reactants or pyna.Nucleus("n") in r.products: print("removing neutron rates: ", r) subch.remove_rate(r) diff --git a/networks/ignition_chamulak/notes.txt b/networks/ignition_chamulak/notes.txt index d4c78368f9..08b20cda0f 100644 --- a/networks/ignition_chamulak/notes.txt +++ b/networks/ignition_chamulak/notes.txt @@ -38,12 +38,12 @@ Basic idea: --- --- this means that 60% of the time, we will create Ne20 + O16 and - 40% of the time we will create Na23 + C13. + 40% of the time we will create Na23 + C13. So the number of nuclei made from consuming 6 C12 is ~ 1.2 Ne20, 1.2 O16, 0.8 Na23, 0.8 C13. - + Doing this, the ash has an A = 18 and a Z = 8.8 We also note that since we are operating in a high temperature @@ -61,4 +61,4 @@ Basic idea: release per C12 consumed), as a function of density. - + 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/rprox/reaclib/make_rates_module.py b/networks/rprox/reaclib/make_rates_module.py index 12960965d1..48c4cf20b9 100644 --- a/networks/rprox/reaclib/make_rates_module.py +++ b/networks/rprox/reaclib/make_rates_module.py @@ -50,7 +50,7 @@ def modulePreamble(): def tFactorData(): """Add a routine to initialize the tfactors given the temperature. Return this text.""" - + text=""" contains @@ -74,7 +74,7 @@ def tFactorData(): def buildRateRoutine(name,aFactors): """Given a reaction name and the list of aFactors from the ReacLib rate - file, build the appropriate structure for the reaction rate as a + file, build the appropriate structure for the reaction rate as a subroutine. Return this text.""" text= """ subroutine %s(tfactors,rate,dratedt) @@ -142,7 +142,7 @@ def buildRateRoutine(name,aFactors): if not aFactors[start+4] == 0.0: str += " +ct9 &\n" if not aFactors[start+5] == 0.0: - str += " +FIVE3RD*ct953 &\n" + str += " +FIVE3RD*ct953 &\n" if not aFactors[start+6] == 0.0: str += " +(%sd0))" % (aFactors[start+6]) else: @@ -177,7 +177,7 @@ def buildRateRoutine(name,aFactors): return text def numReactantsProducts(chapter): - """Return the number of reactants and products (in particles) for a + """Return the number of reactants and products (in particles) for a reaction of ReacLib Chapter type chapter.""" r,p = 1,1 if chapter in [2,5,9,10]: p+= 1 @@ -190,11 +190,11 @@ def numReactantsProducts(chapter): return r,p def parseRateFile(file): - """Given a ReacLib v 1 rate file, file, parse it and determine an + """Given a ReacLib v 1 rate file, file, parse it and determine an appropriate name and the "a" factors that build the rate. Return the name as a string and the "a" factors as a list.""" - try: + try: fh = open(file,'r') except IOError: print "Couldn't open file %f for reading" % file @@ -207,7 +207,7 @@ def parseRateFile(file): foundLabels = False rateString = "rate" - + aFactors = [] for line in data[numHeaderLines:]: @@ -226,7 +226,7 @@ def parseRateFile(file): for term in range(nterms): start = term*lengthEntry stop = start + lengthEntry - + aFactors.append(float(line[start:stop])) if len(aFactors) % numTerms is not 0: @@ -261,8 +261,8 @@ def weakRate(name,factor): return textParameter, textSubroutine def make_rates_module(rateFiles): - """Build the F90 module containing the subroutines for the reactions - given in the list of ReacLib rate files, rateFiles, along with the helper + """Build the F90 module containing the subroutines for the reactions + given in the list of ReacLib rate files, rateFiles, along with the helper routine to set the common temperature factors. Return all this as a string for easy piping.""" 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/make_table/burn_cell.H b/nse_solver/make_table/burn_cell.H index 4afa1e5373..ffa31b9170 100644 --- a/nse_solver/make_table/burn_cell.H +++ b/nse_solver/make_table/burn_cell.H @@ -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 << " " diff --git a/nse_solver/nse_check.H b/nse_solver/nse_check.H index 1957dfe9e3..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 @@ -81,55 +81,55 @@ void find_max_nucs(int& max_nucs, const int current_nuc_ind) { for (int n = NumSpec-1; n > NSE_INDEX::he4_index; --n) { if ( - (aion[n] == aion[current_nuc_ind]-1 && - (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]-1)) - || - (aion[n] == aion[current_nuc_ind]+3 && - (zion[n] == zion[current_nuc_ind]+1 || zion[n] == zion[current_nuc_ind]+2)) - || - (aion[n] == aion[current_nuc_ind]+4 && zion[n] == zion[current_nuc_ind]+2) - ) { + (aion[n] == aion[current_nuc_ind]-1 && + (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]-1)) + || + (aion[n] == aion[current_nuc_ind]+3 && + (zion[n] == zion[current_nuc_ind]+1 || zion[n] == zion[current_nuc_ind]+2)) + || + (aion[n] == aion[current_nuc_ind]+4 && zion[n] == zion[current_nuc_ind]+2) + ) { ++max_nucs; } if ( - (aion[n] == aion[current_nuc_ind]+3 && - (zion[n] == zion[current_nuc_ind]+1 || zion[n] == zion[current_nuc_ind]+2)) - || - (aion[n] == aion[current_nuc_ind]+2 && - (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1 - || zion[n] == zion[current_nuc_ind]+2)) - || - (aion[n] == aion[current_nuc_ind]-2 && - (zion[n] == zion[current_nuc_ind]-2 || zion[n] == zion[current_nuc_ind]-1 - || zion[n] == zion[current_nuc_ind])) - ) { + (aion[n] == aion[current_nuc_ind]+3 && + (zion[n] == zion[current_nuc_ind]+1 || zion[n] == zion[current_nuc_ind]+2)) + || + (aion[n] == aion[current_nuc_ind]+2 && + (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1 + || zion[n] == zion[current_nuc_ind]+2)) + || + (aion[n] == aion[current_nuc_ind]-2 && + (zion[n] == zion[current_nuc_ind]-2 || zion[n] == zion[current_nuc_ind]-1 + || zion[n] == zion[current_nuc_ind])) + ) { ++max_nucs; } if ( - (aion[n] == aion[current_nuc_ind]+2 && - (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1 - || zion[n] == zion[current_nuc_ind]+2)) - || - (aion[n] == aion[current_nuc_ind]+1 && - (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1)) - || - (aion[n] == aion[current_nuc_ind]-3 && - (zion[n] == zion[current_nuc_ind]-1 || zion[n] == zion[current_nuc_ind]-2)) - ) { + (aion[n] == aion[current_nuc_ind]+2 && + (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1 + || zion[n] == zion[current_nuc_ind]+2)) + || + (aion[n] == aion[current_nuc_ind]+1 && + (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1)) + || + (aion[n] == aion[current_nuc_ind]-3 && + (zion[n] == zion[current_nuc_ind]-1 || zion[n] == zion[current_nuc_ind]-2)) + ) { ++max_nucs; } if ( - (aion[n] == aion[current_nuc_ind]+1 && - (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1)) - || - (aion[n] == aion[current_nuc_ind]-4 && zion[n] == zion[current_nuc_ind]-2) - ) { + (aion[n] == aion[current_nuc_ind]+1 && + (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1)) + || + (aion[n] == aion[current_nuc_ind]-4 && zion[n] == zion[current_nuc_ind]-2) + ) { ++max_nucs; } @@ -139,7 +139,7 @@ void find_max_nucs(int& max_nucs, const int current_nuc_ind) { AMREX_GPU_HOST_DEVICE AMREX_INLINE void get_rate_by_nuc(int& rate_index, amrex::Array1D reactants_indices, - amrex::Array1D products_indices) { + amrex::Array1D products_indices) { rate_index = -1; bool found_index = false; @@ -155,11 +155,11 @@ void get_rate_by_nuc(int& rate_index, amrex::Array1D reactants_indice for (int i = 1; i <= Rates::NumRates; ++i) { for (int j = 1; j <= 3; ++j) { if (NSE_INDEX::rate_indices(i, j) == reactants_indices(j) && NSE_INDEX::rate_indices(i, j+3) == products_indices(j)) { - found_index = true; + found_index = true; } else { - found_index = false; - break; + found_index = false; + break; } } @@ -174,8 +174,8 @@ void get_rate_by_nuc(int& rate_index, amrex::Array1D reactants_indice AMREX_GPU_HOST_DEVICE AMREX_INLINE void find_fast_reaction_cycle(const int current_nuc_ind, const amrex::Array1D& Y, - const amrex::Array1D& screened_rates, - const burn_t& state, const amrex::Real& t_s, bool& found_fast_reaction_cycle) { + const amrex::Array1D& screened_rates, + const burn_t& state, const amrex::Real& t_s, bool& found_fast_reaction_cycle) { // This function finds the fast reaction cycle of a given nuclei. // This is done to satisfy Section 4.4.3 of Kushnir @@ -226,61 +226,61 @@ void find_fast_reaction_cycle(const int current_nuc_ind, const amrex::Array1D NSE_INDEX::he4_index; --n) { if ( - (aion[n] == aion[current_nuc_ind]-1 && - (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]-1)) - || - (aion[n] == aion[current_nuc_ind]+3 && - (zion[n] == zion[current_nuc_ind]+1 || zion[n] == zion[current_nuc_ind]+2)) - || - (aion[n] == aion[current_nuc_ind]+4 && zion[n] == zion[current_nuc_ind]+2) - ) { + (aion[n] == aion[current_nuc_ind]-1 && + (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]-1)) + || + (aion[n] == aion[current_nuc_ind]+3 && + (zion[n] == zion[current_nuc_ind]+1 || zion[n] == zion[current_nuc_ind]+2)) + || + (aion[n] == aion[current_nuc_ind]+4 && zion[n] == zion[current_nuc_ind]+2) + ) { reactions(2, inter_nuc_ind1) = n; ++inter_nuc_ind1; } if ( - (aion[n] == aion[current_nuc_ind]+3 && - (zion[n] == zion[current_nuc_ind]+1 || zion[n] == zion[current_nuc_ind]+2)) - || - (aion[n] == aion[current_nuc_ind]+2 && - (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1 - || zion[n] == zion[current_nuc_ind]+2)) - || - (aion[n] == aion[current_nuc_ind]-2 && - (zion[n] == zion[current_nuc_ind]-2 || zion[n] == zion[current_nuc_ind]-1 - || zion[n] == zion[current_nuc_ind])) - ) { + (aion[n] == aion[current_nuc_ind]+3 && + (zion[n] == zion[current_nuc_ind]+1 || zion[n] == zion[current_nuc_ind]+2)) + || + (aion[n] == aion[current_nuc_ind]+2 && + (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1 + || zion[n] == zion[current_nuc_ind]+2)) + || + (aion[n] == aion[current_nuc_ind]-2 && + (zion[n] == zion[current_nuc_ind]-2 || zion[n] == zion[current_nuc_ind]-1 + || zion[n] == zion[current_nuc_ind])) + ) { reactions(3, inter_nuc_ind2) = n; ++inter_nuc_ind2; } if ( - (aion[n] == aion[current_nuc_ind]+2 && - (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1 - || zion[n] == zion[current_nuc_ind]+2)) - || - (aion[n] == aion[current_nuc_ind]+1 && - (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1)) - || - (aion[n] == aion[current_nuc_ind]-3 && - (zion[n] == zion[current_nuc_ind]-1 || zion[n] == zion[current_nuc_ind]-2)) - ) { + (aion[n] == aion[current_nuc_ind]+2 && + (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1 + || zion[n] == zion[current_nuc_ind]+2)) + || + (aion[n] == aion[current_nuc_ind]+1 && + (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1)) + || + (aion[n] == aion[current_nuc_ind]-3 && + (zion[n] == zion[current_nuc_ind]-1 || zion[n] == zion[current_nuc_ind]-2)) + ) { reactions(4, inter_nuc_ind3) = n; ++inter_nuc_ind3; } if ( - (aion[n] == aion[current_nuc_ind]+1 && - (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1)) - || - (aion[n] == aion[current_nuc_ind]-4 && zion[n] == zion[current_nuc_ind]-2) - ) { + (aion[n] == aion[current_nuc_ind]+1 && + (zion[n] == zion[current_nuc_ind] || zion[n] == zion[current_nuc_ind]+1)) + || + (aion[n] == aion[current_nuc_ind]-4 && zion[n] == zion[current_nuc_ind]-2) + ) { reactions(5, inter_nuc_ind4) = n; - ++inter_nuc_ind4; + ++inter_nuc_ind4; } } @@ -296,7 +296,7 @@ void find_fast_reaction_cycle(const int current_nuc_ind, const amrex::Array1D& group_ind) { + const amrex::Array1D& group_ind) { // This function returns the root index of the nuclei // by providing the nuclei index [0, NumSpec-1], and group indices, group_ind @@ -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; @@ -698,23 +698,23 @@ bool in_single_group(const amrex::Array1D& group_ind) { if (zion[n] >= 14) { - // Get even N group index - if (evenN_group == -1 && std::fmod(aion[n] - zion[n], 2) == 0.0_rt) { - evenN_group = get_root_index(n, group_ind); - continue; - } - - // Get odd N group index - if (oddN_group == -1 && std::fmod(aion[n] - zion[n], 2) == 1.0_rt) { - oddN_group = get_root_index(n, group_ind); - continue; - } - - if ((std::fmod(aion[n] - zion[n], 2) == 0.0_rt && evenN_group != get_root_index(n, group_ind)) || - (std::fmod(aion[n] - zion[n], 2) == 1.0_rt && oddN_group != get_root_index(n, group_ind))) { - in_single_group = false; - break; - } + // Get even N group index + if (evenN_group == -1 && std::fmod(aion[n] - zion[n], 2) == 0.0_rt) { + evenN_group = get_root_index(n, group_ind); + continue; + } + + // Get odd N group index + if (oddN_group == -1 && std::fmod(aion[n] - zion[n], 2) == 1.0_rt) { + oddN_group = get_root_index(n, group_ind); + continue; + } + + if ((std::fmod(aion[n] - zion[n], 2) == 0.0_rt && evenN_group != get_root_index(n, group_ind)) || + (std::fmod(aion[n] - zion[n], 2) == 1.0_rt && oddN_group != get_root_index(n, group_ind))) { + in_single_group = false; + break; + } } } @@ -726,12 +726,12 @@ bool in_single_group(const amrex::Array1D& group_ind) { AMREX_GPU_HOST_DEVICE AMREX_INLINE void fill_merge_indices(amrex::Array1D& merge_indices, - amrex::Real& fastest_t, const int current_rate, - const amrex::Array1D& Y, const burn_t& state, - const amrex::Array1D& screened_rates, - const amrex::Array1D& group_ind, - const amrex::Real& t_s) { - + amrex::Real& fastest_t, const int current_rate, + const amrex::Array1D& Y, const burn_t& state, + 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,17 +756,17 @@ 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 - ) { + && 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; + return; } nonNPA_ind(m) = k; } @@ -793,8 +793,8 @@ void fill_merge_indices(amrex::Array1D& merge_indices, // return if nonLIG_root index is repeated, meaning these isotope already merged if (root_index == nonLIG_root) { - return; - } + return; + } nonLIG_root = root_index; } } @@ -804,33 +804,33 @@ 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 amrex::Array1D Y_group = {0.0_rt, 0.0_rt, 0.0_rt, - 0.0_rt, 0.0_rt, 0.0_rt}; + 0.0_rt, 0.0_rt, 0.0_rt}; for (int k = 2; k <= 6; ++k) { if (NSE_INDEX::rate_indices(current_rate, k) == -1) { 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); + Y_group(k) = Y(NSE_INDEX::rate_indices(current_rate, k) + 1); } else { for (int n = 0; n < NumSpec; ++n) { - + // if nuclei have the same root_index, then they are the same group - if (root_index == get_root_index(n, group_ind)) { - Y_group(k) += Y(n + 1); - } + if (root_index == get_root_index(n, group_ind)) { + Y_group(k) += Y(n + 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; } @@ -886,10 +886,10 @@ void fill_merge_indices(amrex::Array1D& merge_indices, // If nonNPA index is -1, meaning null, then use LIG index if (nonNPA_ind(n) == -1) { - merge_indices(n) = get_root_index(NSE_INDEX::he4_index, group_ind); + merge_indices(n) = get_root_index(NSE_INDEX::he4_index, group_ind); } else { - merge_indices(n) = NSE_INDEX::rate_indices(current_rate, nonNPA_ind(n)); + merge_indices(n) = NSE_INDEX::rate_indices(current_rate, nonNPA_ind(n)); } } } @@ -899,9 +899,9 @@ void fill_merge_indices(amrex::Array1D& merge_indices, AMREX_GPU_HOST_DEVICE AMREX_INLINE void nse_grouping(amrex::Array1D& group_ind, const burn_t& state, - const amrex::Array1D& Y, - const amrex::Array1D& screened_rates, - const amrex::Real& t_s) { + const amrex::Array1D& Y, + const amrex::Array1D& screened_rates, + const amrex::Real& t_s) { // This function groups all the nuclei using group_ind // which contains the node # @@ -914,19 +914,19 @@ void nse_grouping(amrex::Array1D& group_ind, const burn_t& stat // let n,p,a form the same group (LIG) initially, let 1 be index of LIG if (i == NSE_INDEX::h1_index + 1 || i == NSE_INDEX::n_index + 1 - || i == NSE_INDEX::he4_index + 1) { + || i == NSE_INDEX::he4_index + 1) { // group_ind(i) = NSE_INDEX::he4_index; 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: @@ -1094,7 +1094,7 @@ bool in_nse(burn_t& current_state, bool skip_molar_check=false) { for (int n = NumSpec-1; n >= 0; --n) { if (found_fast_reaction_cycle) { - break; + break; } find_fast_reaction_cycle(n, Y, rate_eval.screened_rates, state, t_s, found_fast_reaction_cycle); diff --git a/nse_solver/nse_solver.H b/nse_solver/nse_solver.H index 39028c0603..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; @@ -66,10 +66,10 @@ T get_nonexponent_nse_state(const T& state) { // find nse mass frac without the exponent term. Real power = 2.0 * M_PI * network::mion(n+1) * - C::k_B * T_in / (C::hplanck * C::hplanck); + C::k_B * T_in / (C::hplanck * C::hplanck); nse_state.xn[n] = network::mion(n+1) * pf * spin / state.rho * - std::sqrt(power * power * power); + std::sqrt(power * power * power); } return nse_state; @@ -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) { @@ -133,9 +133,9 @@ void apply_nse_exponent(T& nse_state) { // iteration will make it happy again exponent = amrex::min(500.0_rt, - (zion[n] * nse_state.mu_p + (aion[n] - zion[n]) * - nse_state.mu_n - u_c + network::bion(n+1)) / - C::k_B / T_in * C::Legacy::MeV2erg); + (zion[n] * nse_state.mu_p + (aion[n] - zion[n]) * + nse_state.mu_n - u_c + network::bion(n+1)) / + C::k_B / T_in * C::Legacy::MeV2erg); nse_state.xn[n] *= std::exp(exponent); } @@ -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); @@ -274,42 +274,42 @@ void nse_hybrid_solver(T& state, amrex::Real eps=1.0e-10_rt) { for (int j = 0; j < 20; ++j) { - hj.x(1) = inner_x(1); - hj.x(2) = inner_x(2); + hj.x(1) = inner_x(1); + hj.x(2) = inner_x(2); - // hybrj<2, T>(hj, state, fcn_hybrid, jcn_hybrid); - hybrj(hj, state); + // hybrj<2, T>(hj, state, fcn_hybrid, jcn_hybrid); + hybrj(hj, state); - fcn(hj.x, f, state, flag); + fcn(hj.x, f, state, flag); - if (std::abs(f(1)) < eps && std::abs(f(2)) < eps) { + if (std::abs(f(1)) < eps && std::abs(f(2)) < eps) { - state.mu_p = hj.x(1); - state.mu_n = hj.x(2); - return; - } + state.mu_p = hj.x(1); + state.mu_n = hj.x(2); + return; + } - if (f(1) > 0.0_rt && f(2) > 0.0_rt) { - is_pos_new = true; - } - else{ - is_pos_new = false; - } + if (f(1) > 0.0_rt && f(2) > 0.0_rt) { + is_pos_new = true; + } + else{ + is_pos_new = false; + } - if (is_pos_old != is_pos_new) { - dx *= 0.8_rt; - } + if (is_pos_old != is_pos_new) { + dx *= 0.8_rt; + } - if (is_pos_new) { - inner_x(1) -= dx; - inner_x(2) -= dx; - } - else{ - inner_x(1) += dx; - inner_x(2) += dx; - } + if (is_pos_new) { + inner_x(1) -= dx; + inner_x(2) -= dx; + } + else{ + inner_x(1) += dx; + inner_x(2) += dx; + } - is_pos_old = is_pos_new; + is_pos_old = is_pos_new; } outer_x(1) -= 0.5_rt; @@ -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(); @@ -422,7 +422,7 @@ void nse_nr_solver(T& state, amrex::Real eps=1.0e-10_rt) { // check whether solution results in nan if (std::isnan(x(1)) || std::isnan(x(2))) { - amrex::Error("Nan encountered, likely due to overflow in digits or not making good progress"); + amrex::Error("Nan encountered, likely due to overflow in digits or not making good progress"); } // update constraint @@ -488,11 +488,11 @@ T get_actual_nse_state(T& state, amrex::Real eps=1.0e-10_rt, for (int n = 0; n < NumSpec; ++n) { #ifdef NEW_NETWORK_IMPLEMENTATION if (n == NSE_INDEX::h1_index) { - continue; + continue; } #endif if (zion[n] != aion[n] - zion[n]) { - singular_network = false; + singular_network = false; } } @@ -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 898772c8d8..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) { @@ -253,8 +253,8 @@ void actual_screen5 (const plasma_state_t& state, alph12dt = 0.0_rt; } - // redetermine previous factors if 3*gamma_ij/tau_ij > 1.6 - + // redetermine previous factors if 3*gamma_ij/tau_ij > 1.6 + gamef = 1.6e0_rt * tau12; if constexpr (do_T_derivatives) { gamefdt = 1.6e0_rt * tau12dt; @@ -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,16 +284,16 @@ 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; - // Here we follow Eq. A9 in Wallace:1982 - // See Eq. 25 Alastuey:1978, Eq. 16 and 17 in Jancovici:1977 for reference + // Here we follow Eq. A9 in Wallace:1982 + // See Eq. 25 Alastuey:1978, Eq. 16 and 17 in Jancovici:1977 for reference Real cc = 0.896434e0_rt * gamp * scn_fac.zhat - 3.44740e0_rt * gamp14 * scn_fac.zhat2 - 0.5551e0_rt * (std::log(gamp) + scn_fac.lzav) @@ -308,14 +308,14 @@ void actual_screen5 (const plasma_state_t& state, - 0.5551e0_rt *rr * gampdt; } - // (3gamma_ij/tau_ij)^3 + // (3gamma_ij/tau_ij)^3 Real a3 = alph12 * alph12 * alph12; Real da3 = 3.0e0_rt * alph12 * alph12; - // Part of Eq. 28 in Alastuey:1978 + // Part of Eq. 28 in Alastuey:1978 qq = 0.014e0_rt + 0.0128e0_rt*alph12; - // Part of Eq. 28 in Alastuey:1978 + // Part of Eq. 28 in Alastuey:1978 rr = (5.0_rt/32.0_rt) - alph12*qq; [[maybe_unused]] Real drrdt; if constexpr (do_T_derivatives) { @@ -323,20 +323,20 @@ void actual_screen5 (const plasma_state_t& state, drrdt = -(alph12dt*qq + alph12*dqqdt); } - // Part of Eq. 28 in Alastuey:1978 + // Part of Eq. 28 in Alastuey:1978 Real ss = tau12*rr; - // Part of Eq. 31 in Alastuey:1978 + // Part of Eq. 31 in Alastuey:1978 Real tt = -0.0098e0_rt + 0.0048e0_rt*alph12; - // Part of Eq. 31 in Alastuey:1978 + // Part of Eq. 31 in Alastuey:1978 Real uu = 0.0055e0_rt + alph12*tt; - // Part of Eq. 31 in Alastuey:1978 + // Part of Eq. 31 in Alastuey:1978 Real vv = gamef * alph12 * uu; - // Exponent of Eq. 32 in Alastuey:1978, which uses Eq.28 and Eq.31 - // Strong screening factor + // Exponent of Eq. 32 in Alastuey:1978, which uses Eq.28 and Eq.31 + // Strong screening factor h12 = cc - a3 * (ss + vv); if constexpr (do_T_derivatives) { Real dssdt = tau12dt*rr + tau12*drrdt; @@ -347,8 +347,8 @@ void actual_screen5 (const plasma_state_t& state, dh12dt = dccdt - rr*alph12dt - a3*(dssdt + dvvdt); } - // See conclusion and Eq. 34 in Alastuey:1978 - // This is an extra factor to account for quantum effects + // See conclusion and Eq. 34 in Alastuey:1978 + // This is an extra factor to account for quantum effects rr = 1.0_rt - 0.0562e0_rt*a3; if constexpr (do_T_derivatives) { ss = -0.0562e0_rt*da3; @@ -358,7 +358,7 @@ void actual_screen5 (const plasma_state_t& state, Real xlgfac; [[maybe_unused]] Real dxlgfacdt; - // In extreme case, rr is 0.77, see conclusion in Alastuey:1978 + // In extreme case, rr is 0.77, see conclusion in Alastuey:1978 if (rr >= 0.77e0_rt) { xlgfac = rr; if constexpr (do_T_derivatives) { @@ -371,15 +371,15 @@ void actual_screen5 (const plasma_state_t& state, } } - // Include the extra factor that accounts for quantum effects + // Include the extra factor that accounts for quantum effects h12 = std::log(xlgfac) + h12; rr = 1.0_rt/xlgfac; if constexpr (do_T_derivatives) { dh12dt = rr*dxlgfacdt + dh12dt; } - // If gamma_ij < upper limit of intermediate regime - // then it is in the intermediate regime, else strong screening. + // If gamma_ij < upper limit of intermediate regime + // then it is in the intermediate regime, else strong screening. if (gamef <= gamefs) { Real dgamma = 1.0e0_rt/(gamefs - gamefx); @@ -389,8 +389,8 @@ void actual_screen5 (const plasma_state_t& state, vv = h12; - // Then the screening factor is a combination - // of the strong and weak screening factor. + // Then the screening factor is a combination + // of the strong and weak screening factor. h12 = h12w*rr + vv*ss; if constexpr (do_T_derivatives) { drrdt = -dgamma*gamefdt; @@ -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,41 +888,41 @@ 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)); - + - 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)); + + 0.0048_rt * std::pow(b_fac, 6)); [[maybe_unused]] Real quantum_corr_1_dT; [[maybe_unused]] Real quantum_corr_2_dT; if constexpr (do_T_derivatives) { quantum_corr_1_dT = tau12dT / tau12 * quantum_corr_1 - tau12 * b_fac_dT * (15.0_rt/32.0_rt * std::pow(b_fac, 2) - 0.014_rt * 4.0_rt * std::pow(b_fac, 3) - - 0.128_rt * 5.0_rt * std::pow(b_fac, 4)); + - 0.128_rt * 5.0_rt * std::pow(b_fac, 4)); quantum_corr_2_dT = Gamma_eff_dT / Gamma_eff * quantum_corr_2 - Gamma_eff * b_fac_dT * (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)); + * 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/sphinx_docs/notes.txt b/sphinx_docs/notes.txt index a15e64f36b..9b6348fcd3 100644 --- a/sphinx_docs/notes.txt +++ b/sphinx_docs/notes.txt @@ -6,10 +6,10 @@ https://stackoverflow.com/questions/11347505/what-are-some-approaches-to-outputting-a-python-data-structure-to-restructuredte - + ** index: - use + use ..index:: burn_t diff --git a/sphinx_docs/source/basics.rst b/sphinx_docs/source/basics.rst index b5c8933bef..dcf86aafcd 100644 --- a/sphinx_docs/source/basics.rst +++ b/sphinx_docs/source/basics.rst @@ -38,7 +38,7 @@ This will create an executable called ``main3d.gnu.ex``. Then you can run it as ./main3d.gnu.ex inputs_aprox21 By default, the test is built with the 21-isotope ``aprox21`` network. -Here ``inputs_aprox21`` is the inputs file that sets options. +Here ``inputs_aprox21`` is the inputs file that sets options. diff --git a/sphinx_docs/source/integrators.rst b/sphinx_docs/source/integrators.rst index 77c59767df..c06320f946 100644 --- a/sphinx_docs/source/integrators.rst +++ b/sphinx_docs/source/integrators.rst @@ -22,7 +22,7 @@ The equations we integrate to do a nuclear burn are: Here, :math:`X_k` is the mass fraction of species :math:`k`, :math:`e` is the specific nuclear energy created through reactions. Also needed are density :math:`\rho`, -temperature :math:`T`, and the specific heat. The function :math:`f` provides the energy release from reactions and can often be expressed in terms of the +temperature :math:`T`, and the specific heat. The function :math:`f` provides the energy release from reactions and can often be expressed in terms of the instantaneous reaction terms, :math:`\dot{X}_k`. As noted in the previous section, this is implemented in a network-specific manner. @@ -70,7 +70,7 @@ routine (at the moment this can be ``VODE``, ``BackwardEuler``, ``ForwardEuler`` AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void burner (burn_t& state, Real dt) -The input is a ``burn_t``. +The input is a ``burn_t``. .. note:: @@ -369,7 +369,7 @@ the allowed options are: The spectral radius is estimated by default using the power method, built into RKC. Alternately, by setting ``integrator.use_circle_theorem=1``, - the `Gershgorin circle theorem `_ + the `Gershgorin circle theorem `_ is used instead. * ``VODE``: the VODE :cite:`vode` integration package. We ported this @@ -383,7 +383,7 @@ robust. .. important:: The integrator will not abort if it encounters trouble. Instead it will - set ``burn_t burn_state.success = false`` on exit. It is up to the + set ``burn_t burn_state.success = false`` on exit. It is up to the application code to handle the failure. .. note:: diff --git a/sphinx_docs/source/networks-overview.rst b/sphinx_docs/source/networks-overview.rst index ec67cc2fd7..f4beb95e9a 100644 --- a/sphinx_docs/source/networks-overview.rst +++ b/sphinx_docs/source/networks-overview.rst @@ -42,7 +42,7 @@ for the ability to swap integrators as desired. We discuss the integrators in a later section. A network is defined by a ``.net`` file which provides a list of species -and some data about each species (its name and some isotopic data). +and some data about each species (its name and some isotopic data). An example is ``Microphysics/networks/iso7/iso7.net``: diff --git a/sphinx_docs/source/networks.rst b/sphinx_docs/source/networks.rst index 2552e0d953..065a3d0f00 100644 --- a/sphinx_docs/source/networks.rst +++ b/sphinx_docs/source/networks.rst @@ -158,7 +158,7 @@ X_a / (A_a m_u)`, our rate equation is \begin{align} \frac{dX_f}{dt} &= - \frac{r_0}{m_u} \rho X_f^2 \frac{1}{A_f} \left (\frac{T}{T_0}\right)^\nu \equiv \omegadot_f \\ - \frac{dX_a}{dt} &= \frac{1}{2}\frac{r_0}{m_u} \rho X_f^2 \frac{A_a}{A_f^2} \left (\frac{T}{T_0}\right)^\nu = \frac{r_0}{m_u} \rho X_f^2 \frac{1}{A_f} \left (\frac{T}{T_0}\right)^\nu + \frac{dX_a}{dt} &= \frac{1}{2}\frac{r_0}{m_u} \rho X_f^2 \frac{A_a}{A_f^2} \left (\frac{T}{T_0}\right)^\nu = \frac{r_0}{m_u} \rho X_f^2 \frac{1}{A_f} \left (\frac{T}{T_0}\right)^\nu \end{align} We define a new rate constant, :math:`\rt` with units of :math:`[\mathrm{s^{-1}}]` as @@ -287,6 +287,6 @@ to disable rates: :math:`\isotm{N}{13}(\alpha,p)\isotm{O}{16}` and its inverse are disabled. -Together, these parameters allow us to turn off the sequence +Together, these parameters allow us to turn off the sequence :math:`\isotm{C}{12}(p,\gamma)\isotm{N}{13}(\alpha, p)\isotm{O}{16}` that acts as a bypass for :math:`\isotm{C}{12}(\alpha, \gamma)\isotm{O}{16}`. diff --git a/sphinx_docs/source/nse.rst b/sphinx_docs/source/nse.rst index d94816ba8b..c4a207d6ce 100644 --- a/sphinx_docs/source/nse.rst +++ b/sphinx_docs/source/nse.rst @@ -254,7 +254,7 @@ There are 3 main criteria discussed in the :cite:`Kushnir_2020`. An example of such reaction cycle would be: .. math:: - + \isotm{S}{32} (\gamma, p)(\gamma, p)(\gamma, n)(\gamma, n) \isotm{Si}{28} (\alpha, \gamma) \isotm{S}{32} @@ -265,11 +265,11 @@ There are 3 main criteria discussed in the :cite:`Kushnir_2020`. If there are no isotope present in the network that would form a closed-cycle, we move on to the next nuclei. We break out of the iteration once we found a fast reaction cycle. - + * If the previous two check pass, we proceed to nuclei grouping. Initially, :math:`p`, :math:`n`, and :math:`\alpha` are grouped into a single group called the light-isotope-group, or LIG. Other isotopes belong to their own group, - which only contains themselves. During each iteration, we find all valid reaction, + which only contains themselves. During each iteration, we find all valid reaction, :math:`k`, that has the fastest time-scale, :math:`t_{i,k} = \tilde{Y}_i/\textbf{min}(b_f(k), b_r(k))`, for :math:`i` to be the isotope involved with the reaction that is different from :math:`p`, :math:`n`, and :math:`\alpha`. @@ -283,13 +283,13 @@ There are 3 main criteria discussed in the :cite:`Kushnir_2020`. .. math:: t_{i,k} < \epsilon t_s - + * .. math:: 2|b_f(k) - b_r(k)|/(b_f(k) + b_r(k) < \epsilon - + Here we only consider two cases of reactions: * There are exactly two isotopes involved in reaction, :math:`k`, that are not in the @@ -307,7 +307,7 @@ There are 3 main criteria discussed in the :cite:`Kushnir_2020`. * Reactions that involve more than 2 reactants and products * Reactions that have more than 2 non-light-isotope-group. - + * The nuclei that participate in the reaction is either in LIG or in another group. This means that the non-LIG nuclei have already merged. @@ -320,8 +320,8 @@ There are 3 main criteria discussed in the :cite:`Kushnir_2020`. a single group due to the missing neutron rates. Therefore, there is an alternative criteria of defining a "single group" when neutron is not present in the network: for isotopes, :math:`Z >= 14`, isotopes with odd and even :math:`N` form two - distinct groups. - + distinct groups. + Additional Options ------------------ diff --git a/sphinx_docs/source/sdc.rst b/sphinx_docs/source/sdc.rst index 8db7a2d41b..379874f75f 100644 --- a/sphinx_docs/source/sdc.rst +++ b/sphinx_docs/source/sdc.rst @@ -53,9 +53,9 @@ The reactions don’t modify the total density, :math:`\rho`, or momentum, .. math:: - \frac{d}{dt}\left ( - \begin{array}{c} \rho X_k \\ \rho e \end{array} - \right ) = + \frac{d}{dt}\left ( + \begin{array}{c} \rho X_k \\ \rho e \end{array} + \right ) = \left ( \begin{array}{c} \Adv{\rho X_k}^{n+1/2} \\ \Adv{\rho e}^{n+1/2} \\ \end{array} \right ) + diff --git a/sphinx_docs/source/templated_networks.rst b/sphinx_docs/source/templated_networks.rst index e8342dc195..c6bb55cdae 100644 --- a/sphinx_docs/source/templated_networks.rst +++ b/sphinx_docs/source/templated_networks.rst @@ -181,7 +181,7 @@ special cases (e.g., for approximate nets): This indicates that each branch happens 50% of the time. -* ``apply_identical_particle_factor`` : +* ``apply_identical_particle_factor`` : Normally for rates involving identical nuclei, we divide the rate by a factor (:math:`n!`, where `n` is the number of the same nuclei participating). This @@ -216,7 +216,7 @@ special cases (e.g., for approximate nets): To save on computation, we can create a table of reaction rates by evaluating over a grid of temperature and then interpolating - in temperature as needed. This operates only on the + in temperature as needed. This operates only on the :math:`N_A \langle \sigma v \rangle` portion of the rate. Some rates are more complex than fits into the rate tabulation diff --git a/sphinx_docs/source/unit_tests.rst b/sphinx_docs/source/unit_tests.rst index 638e739556..39b6954836 100644 --- a/sphinx_docs/source/unit_tests.rst +++ b/sphinx_docs/source/unit_tests.rst @@ -164,7 +164,7 @@ Screening Test routine, using the ``aprox21`` reaction network. This uses the same basic ideas as the tests above---a cube of data is setup and the rates are evaluated using each zone's thermodynamic -conditions. +conditions. This works for both the Fortran and C++ implementations (via ``do_cxx``). diff --git a/unit_test/burn_cell/burn_cell.H b/unit_test/burn_cell/burn_cell.H index aeb5d826dc..21f1f0046f 100644 --- a/unit_test/burn_cell/burn_cell.H +++ b/unit_test/burn_cell/burn_cell.H @@ -122,7 +122,7 @@ void burn_cell_c() state_over_time << std::setw(25) << "Temperature"; for(int x = 0; x < NumSpec; ++x){ const std::string& element = short_spec_names_cxx[x]; - state_over_time << std::setw(25) << element; + state_over_time << std::setw(25) << element; } state_over_time << std::endl; state_over_time << std::setprecision(15); @@ -153,7 +153,7 @@ void burn_cell_c() Real tend = std::pow(10.0_rt, std::log10(tfirst) + dlogt * n); Real dt = tend - t; - burner(burn_state, dt); + burner(burn_state, dt); if (! burn_state.success) { amrex::Error("integration failed"); @@ -178,12 +178,12 @@ void burn_cell_c() t += dt; - state_over_time << std::setw(25) << t; - state_over_time << std::setw(25) << burn_state.T; - for (double X : burn_state.xn) { - state_over_time << std::setw(25) << X; - } - state_over_time << std::endl; + state_over_time << std::setw(25) << t; + state_over_time << std::setw(25) << burn_state.T; + for (double X : burn_state.xn) { + state_over_time << std::setw(25) << X; + } + state_over_time << std::endl; } state_over_time.close(); 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 c83752ecfa..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; @@ -324,18 +324,18 @@ void burn_cell_c() state_over_time << std::setw(12) << "Density"; 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; + const std::string& element = short_spec_names_cxx[x]; + 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; @@ -355,19 +355,19 @@ void burn_cell_c() std::cout << "burning for dt = " << dt << std::endl; - burner(burn_state, dt); + burner(burn_state, dt); nstep_int += burn_state.n_step; t += dt; - 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; - 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::endl; + 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; + 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::endl; } state_over_time.close(); 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 b13295a86d..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); @@ -35,44 +35,44 @@ 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); - for (int i = 0; i < NumSpec; ++i){ - state.xn[i] = nse_state.xn[i]; - } - - bool in_nse_state = in_nse(state); - - std::cout << std::scientific; + for (int i = 0; i < NumSpec; ++i){ + state.xn[i] = nse_state.xn[i]; + } + + bool in_nse_state = in_nse(state); + + std::cout << std::scientific; std::cout << std::setw(20) << state.rho << " " << std::setw(20) << state.T << " " << std::fixed << std::setw(20) << state.y_e << " " << std::setw(20) << state.mu_p << " " << std::setw(20) << state.mu_n << " " - << std::setw(20) << in_nse_state << std::endl; + << std::setw(20) << in_nse_state << std::endl; } } 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_react/main.cpp b/unit_test/test_react/main.cpp index fde5631dbe..c8788312c3 100644 --- a/unit_test/test_react/main.cpp +++ b/unit_test/test_react/main.cpp @@ -52,8 +52,8 @@ void main_main () // number of cells on each side of a square (or cubic) domain. pp.get("n_cell", n_cell); - print_every_nrhs = 0; - pp.query("print_every_nrhs", print_every_nrhs); + print_every_nrhs = 0; + pp.query("print_every_nrhs", print_every_nrhs); // The domain is broken into boxes of size max_grid_size max_grid_size = 32; diff --git a/unit_test/test_react/test_network_combinations.py b/unit_test/test_react/test_network_combinations.py index be1f9b4dd5..eadd7fdc09 100755 --- a/unit_test/test_react/test_network_combinations.py +++ b/unit_test/test_react/test_network_combinations.py @@ -192,7 +192,7 @@ def doit(): for k, v in sorted(outcomes.items()): print("{}: {}".format(k, v)) - + if __name__ == "__main__": doit() 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"; diff --git a/util/code_checker/code_checker.py b/util/code_checker/code_checker.py index 93217100c0..9a4695d63b 100644 --- a/util/code_checker/code_checker.py +++ b/util/code_checker/code_checker.py @@ -11,7 +11,7 @@ ignore_dirs = ['tmp_build_dir', 't', 'python_library'] def find_fortran_files(): - # find Microphysics Fortran source files + # find Microphysics Fortran source files try: microphysics_home = os.environ['MICROPHYSICS_HOME'] except KeyError: @@ -31,7 +31,7 @@ def pytest_generate_tests(metafunc): def test_double_precision(filename): if any([f'/{s}/' in str(filename) for s in ignore_dirs]): - return + return with open(filename, 'r') as file_dat: @@ -43,11 +43,11 @@ def test_double_precision(filename): assert re.search(double_prec, l.split('!')[0]) is None except UnicodeDecodeError: - return + return def test_dexp(filename): if any([f'/{s}/' in str(filename) for s in ignore_dirs]): - return + return with open(filename, 'r') as file_dat: @@ -59,11 +59,11 @@ def test_dexp(filename): assert re.search(dexp, l.split('!')[0]) is None except UnicodeDecodeError: - return + return def test_dlog(filename): if any([f'/{s}/' in str(filename) for s in ignore_dirs]): - return + return with open(filename, 'r') as file_dat: @@ -77,7 +77,7 @@ def test_dlog(filename): assert re.search(dlog10, l.split('!')[0]) is None except UnicodeDecodeError: - return + return @@ -85,9 +85,9 @@ def test_check_rt(filename): """ make sure that all of the numerical constants use _rt and are defined as real(rt) """ - + if any([f'/{s}/' in str(filename) for s in ignore_dirs]): - return + return elif 'extern.F90' in str(filename): return @@ -106,4 +106,4 @@ def test_check_rt(filename): # assert 'use amrex_constants_module' not in l.split('!')[0] except UnicodeDecodeError: - return \ No newline at end of file + return \ No newline at end of file diff --git a/util/hybrj/hybrj.H b/util/hybrj/hybrj.H index ce5353b977..883c258a73 100644 --- a/util/hybrj/hybrj.H +++ b/util/hybrj/hybrj.H @@ -188,18 +188,18 @@ void hybrj(hybrj_t& hj, // store the direction p and x + p. calculate the norm of p. - bool invalid = false; + bool invalid = false; - for (int i = 1; i < neqs; ++i) { - if ( amrex::isinf(hj.wa1(i)) || amrex::isnan(hj.wa1(i)) ){ - invalid = true; - } - } + for (int i = 1; i < neqs; ++i) { + if ( amrex::isinf(hj.wa1(i)) || amrex::isnan(hj.wa1(i)) ){ + invalid = true; + } + } - if (invalid) { - finished = true; - break; - } + if (invalid) { + finished = true; + break; + } for (int j = 1; j <= neqs; ++j) { hj.wa1(j) = -hj.wa1(j); @@ -344,9 +344,9 @@ void hybrj(hybrj_t& hj, // calculate the rank one modification to the jacobian // and update qtf if necessary. - if (pnorm == 0.0_rt) { - break; - } + if (pnorm == 0.0_rt) { + break; + } for (int j = 1; j <= hj.n; ++j) { Real sum = 0.0_rt; diff --git a/util/hybrj/hybrj_dogleg.H b/util/hybrj/hybrj_dogleg.H index 0bc5822b13..77a6c0d8f4 100644 --- a/util/hybrj/hybrj_dogleg.H +++ b/util/hybrj/hybrj_dogleg.H @@ -105,15 +105,15 @@ void dogleg(amrex::Array1D& r, wa1(i) += r(l) * temp; l++; - if ( amrex::isnan(wa1(i)) || amrex::isinf(wa1(i)) ) { - return; - } + if ( amrex::isnan(wa1(i)) || amrex::isinf(wa1(i)) ) { + return; + } } wa1(j) /= diag(j); - if ( amrex::isnan(wa1(j)) || amrex::isinf(wa1(j)) ) { - return; - } + if ( amrex::isnan(wa1(j)) || amrex::isinf(wa1(j)) ) { + return; + } } // calculate the norm of the scaled gradient and test for diff --git a/util/hybrj/hybrj_enorm.H b/util/hybrj/hybrj_enorm.H index 176b80a774..fa24cfc61b 100644 --- a/util/hybrj/hybrj_enorm.H +++ b/util/hybrj/hybrj_enorm.H @@ -43,9 +43,9 @@ Real enorm(const int n, amrex::Array1D& x) { for (int i = 1; i <= n; ++i) { Real xabs = std::abs(x(i)); - if ( amrex::isnan(xabs) || amrex::isinf(xabs) ) { - return 0.0_rt; - } + if ( amrex::isnan(xabs) || amrex::isinf(xabs) ) { + return 0.0_rt; + } if (xabs <= rdwarf || xabs >= agiant) { if (xabs > rdwarf) { diff --git a/util/hybrj/hybrj_r1mpyq.H b/util/hybrj/hybrj_r1mpyq.H index b31bcd1f46..1e1cade991 100644 --- a/util/hybrj/hybrj_r1mpyq.H +++ b/util/hybrj/hybrj_r1mpyq.H @@ -51,7 +51,7 @@ void r1mpyq(amrex::Array2D& a, fcos = 1.0_rt / v(j); fsin = std::sqrt(1.0_rt - fcos*fcos); } - else { + else { // if (std::abs(v(j)) <= 1.0_rt) { fsin = v(j); fcos = std::sqrt(1.0_rt - fsin*fsin); @@ -70,7 +70,7 @@ void r1mpyq(amrex::Array2D& a, fcos = 1.0_rt / w(j); fsin = std::sqrt(1.0_rt - fcos*fcos); } - else { + else { // if (std::abs(w(j)) <= 1.0_rt) { fsin = w(j); fcos = std::sqrt(1.0_rt - fsin*fsin); @@ -121,7 +121,7 @@ void r1mpyq(amrex::Array1D& a, fcos = 1.0_rt / v(j); fsin = std::sqrt(1.0_rt - fcos*fcos); } - else { + else { // if (std::abs(v(j)) <= 1.0_rt) { fsin = v(j); fcos = std::sqrt(1.0_rt - fsin*fsin); @@ -138,7 +138,7 @@ void r1mpyq(amrex::Array1D& a, fcos = 1.0_rt / w(j); fsin = std::sqrt(1.0_rt - fcos*fcos); } - else { + else { // if (std::abs(w(j)) <= 1.0_rt) { fsin = w(j); fcos = std::sqrt(1.0_rt - fsin*fsin); diff --git a/util/microphysics_sort.H b/util/microphysics_sort.H index 3949917a29..63403b7c2c 100644 --- a/util/microphysics_sort.H +++ b/util/microphysics_sort.H @@ -12,9 +12,9 @@ void sort_Array1D(amrex::Array1D& array_1d){ for (int i = l; i <= m; ++i){ for (int j = l; j <= m-i; ++j){ if (array_1d(j) > array_1d(j+1)){ - scratch = array_1d(j); - array_1d(j) = array_1d(j+1); - array_1d(j+1) = scratch; + scratch = array_1d(j); + array_1d(j) = array_1d(j+1); + array_1d(j+1) = scratch; } } } diff --git a/util/skynet/burn.py b/util/skynet/burn.py index c6154ec55e..e48f04f63a 100755 --- a/util/skynet/burn.py +++ b/util/skynet/burn.py @@ -29,7 +29,7 @@ def run_skynet(args): strongReactionLibrary = REACLIBReactionLibrary(SkyNetRoot + "/data/reaclib", ReactionType.Strong, True, LeptonMode.TreatAllAsDecayExceptLabelEC, - "Strong reactions", nuclib, opts, True) + "Strong reactions", nuclib, opts, True) symmetricFission = REACLIBReactionLibrary(SkyNetRoot + "/data/netsu_panov_symmetric_0neut", ReactionType.Strong, False, LeptonMode.TreatAllAsDecayExceptLabelEC, @@ -42,8 +42,8 @@ def run_skynet(args): # use only REACLIB weak rates weakReactionLibrary = REACLIBReactionLibrary(SkyNetRoot + "/data/reaclib", - ReactionType.Weak, False, LeptonMode.TreatAllAsDecayExceptLabelEC, - "Weak reactions", nuclib, opts, True) + ReactionType.Weak, False, LeptonMode.TreatAllAsDecayExceptLabelEC, + "Weak reactions", nuclib, opts, True) reactionLibraries = [strongReactionLibrary, symmetricFission, spontaneousFission, weakReactionLibrary] @@ -59,7 +59,7 @@ def run_skynet(args): #Y0[nuclib.NuclideIdsVsNames()["ne23"]] = 4e-4 / 23.0 # above threshold Y0[nuclib.NuclideIdsVsNames()["na23"]] = 4e-4 / 23.0 # below threshold - #XRB + #XRB #Y0[nuclib.NuclideIdsVsNames()["he4"]] = 1.0 / 4.0 #SubCh @@ -74,12 +74,12 @@ def run_skynet(args): #s = 10.0 # initial entropy in k_B / baryon #tau = 7.1 # expansion timescale in ms - time = np.linspace(0.0, 1e9) + time = np.linspace(0.0, 1e9) density_vs_time = ConstantFunction(rho) #isochoric # run through network, will save as "prefix".h5 and .log files output = net.EvolveSelfHeatingWithInitialTemperature(Y0, 0.0, 1.0E1, - T0, density_vs_time, "urca_isoc_belowthresh") + T0, density_vs_time, "urca_isoc_belowthresh") # save some additional information, not necessary as all will be # contained in h5 file @@ -87,37 +87,37 @@ def run_skynet(args): A = np.arange(len(YvsA)) np.savetxt("urca_isoc_belowthresh.txt", np.array([A, YvsA]).transpose(), - "%6i %30.20E") + "%6i %30.20E") return if __name__ == '__main__': - num_cores = multiprocessing.cpu_count() - print "Running with %i worker threads" % num_cores - pool = multiprocessing.Pool(num_cores) - num_done.value = 0 - - # use if you have trajectory files to read - #files = os.listdir(input_dir) - - # otherwise, give the initial density - #densities = [1e6, 5e6, 1e7, 5e7, 1e8, 5e8, 1e9] # multiple - densities = [1.0e9] # URCA - #densities = [2e6] #XRB Aprox13 - #densities = [1e6] #SubCh - - # number of jobs to run - size = len(densities) - args = [(r, size) for r in densities] - - # run skynet in parallel - pool.map_async(run_skynet, args) - - # done submitting jobs - pool.close() - pool.join() + num_cores = multiprocessing.cpu_count() + print "Running with %i worker threads" % num_cores + pool = multiprocessing.Pool(num_cores) + num_done.value = 0 + + # use if you have trajectory files to read + #files = os.listdir(input_dir) + + # otherwise, give the initial density + #densities = [1e6, 5e6, 1e7, 5e7, 1e8, 5e8, 1e9] # multiple + densities = [1.0e9] # URCA + #densities = [2e6] #XRB Aprox13 + #densities = [1e6] #SubCh + + # number of jobs to run + size = len(densities) + args = [(r, size) for r in densities] + + # run skynet in parallel + pool.map_async(run_skynet, args) + + # done submitting jobs + pool.close() + pool.join() # monitor progress with # $ cd work_dir diff --git a/util/skynet/compare.py b/util/skynet/compare.py index 48e6d7684f..c728082c0b 100755 --- a/util/skynet/compare.py +++ b/util/skynet/compare.py @@ -14,151 +14,151 @@ # Get Star Killer output class starkiller_data(): - # modified from Microphysics/unit_test/burn_cell/burn_cell.py - def __init__(self, inpath, runprefix='react_urca'): - files = glob.glob(inpath + runprefix + r'_[0-9]*') - data = [] - for fn in files: - d = {} - f = open(fn, 'r') - - # Get file number - fnsplit = fn.split('_') - fnum = int(fnsplit[-1]) - d['fnum'] = fnum - - # Eat lines - flines = [] - for l in f: - flines.append(l.strip()) - f.close() - - # Fill dataset - n = len(flines) - for i, xi in enumerate(flines): - if xi[-1] == ':': - # This is a field - key = xi[:-1] - xd = [] - # Collect following lines of field data - for j in range(i+1,n): - xj = flines[j] - if xj[-1] == ':': - break - else: - xd.append(xj.split()) - - # Interpret data - if (key=='nspec' or key=='neqs' or key=='i' or key=='j' or key=='k' - or key=='n_rhs' or key=='n_jac'): - # Integer - d[key] = int(xd[0][0]) - elif key=='short_spec_names': - # Strings of nuclide abbreviations - d[key] = [xj[0] for xj in xd] - elif key=='self_heat': - # Boolean - d[key] = (xd[0][0]=='T') - elif key=='xn' or key=='ydot': - # 1-D Float Array - d[key] = np.array([float(y) for y in xd[0]]) - elif key=='jac': - # 2-D Float Array - d[key] = np.array([[float(xij) for xij in xdi] for xdi in xd]) - else: - # Float - d[key] = float(xd[0][0]) - - # Store data - data.append(d) - - ## SORT file data by file number - data_sorted = sorted(data, key=lambda d: d['fnum']) - data = data_sorted - - ## INIT VARIABLES - nspec = data[0]['nspec'] - neqs = data[0]['neqs'] - self.short_spec_names = data[0]['short_spec_names'] - - # Init time, temp, ener - fnum = [] - time = [] - temp = [] - ener = [] - - # Init abundance vectors - xn = [[] for i in range(nspec)] - - # Init ydot vectors - ydot = [[] for i in range(neqs)] - - ## DATA LOOP - # Loop through data and collect - for d in data: - fnum.append(d['fnum']) - temp.append(d['T']) - ener.append(d['e']) - time.append(d['time']) - for i, xi in enumerate(d['xn']): - xn[i].append(xi) - for i, xi in enumerate(d['ydot']): - ydot[i].append(xi) - - # Convert data to numpy arrays - for i in range(nspec): - xn[i] = np.array(xn[i]) - self.X = xn - #for i in range(neqs): - # ydot[i] = np.array(ydot[i]) - # ydot[i][0] = ydot[i][1] - self.fnum = np.array(fnum) - self.temp = np.array(temp) - self.time = np.array(time) - self.dtime = np.ediff1d(time, to_begin=0) - self.ener = np.array(ener) - denerdt = np.zeros_like(ener) - denerdt[1:] = self.ener[1:]/self.dtime[1:] - self.edot = denerdt - # for now ydot is garbage might be useful later? + # modified from Microphysics/unit_test/burn_cell/burn_cell.py + def __init__(self, inpath, runprefix='react_urca'): + files = glob.glob(inpath + runprefix + r'_[0-9]*') + data = [] + for fn in files: + d = {} + f = open(fn, 'r') + + # Get file number + fnsplit = fn.split('_') + fnum = int(fnsplit[-1]) + d['fnum'] = fnum + + # Eat lines + flines = [] + for l in f: + flines.append(l.strip()) + f.close() + + # Fill dataset + n = len(flines) + for i, xi in enumerate(flines): + if xi[-1] == ':': + # This is a field + key = xi[:-1] + xd = [] + # Collect following lines of field data + for j in range(i+1,n): + xj = flines[j] + if xj[-1] == ':': + break + else: + xd.append(xj.split()) + + # Interpret data + if (key=='nspec' or key=='neqs' or key=='i' or key=='j' or key=='k' + or key=='n_rhs' or key=='n_jac'): + # Integer + d[key] = int(xd[0][0]) + elif key=='short_spec_names': + # Strings of nuclide abbreviations + d[key] = [xj[0] for xj in xd] + elif key=='self_heat': + # Boolean + d[key] = (xd[0][0]=='T') + elif key=='xn' or key=='ydot': + # 1-D Float Array + d[key] = np.array([float(y) for y in xd[0]]) + elif key=='jac': + # 2-D Float Array + d[key] = np.array([[float(xij) for xij in xdi] for xdi in xd]) + else: + # Float + d[key] = float(xd[0][0]) + + # Store data + data.append(d) + + ## SORT file data by file number + data_sorted = sorted(data, key=lambda d: d['fnum']) + data = data_sorted + + ## INIT VARIABLES + nspec = data[0]['nspec'] + neqs = data[0]['neqs'] + self.short_spec_names = data[0]['short_spec_names'] + + # Init time, temp, ener + fnum = [] + time = [] + temp = [] + ener = [] + + # Init abundance vectors + xn = [[] for i in range(nspec)] + + # Init ydot vectors + ydot = [[] for i in range(neqs)] + + ## DATA LOOP + # Loop through data and collect + for d in data: + fnum.append(d['fnum']) + temp.append(d['T']) + ener.append(d['e']) + time.append(d['time']) + for i, xi in enumerate(d['xn']): + xn[i].append(xi) + for i, xi in enumerate(d['ydot']): + ydot[i].append(xi) + + # Convert data to numpy arrays + for i in range(nspec): + xn[i] = np.array(xn[i]) + self.X = xn + #for i in range(neqs): + # ydot[i] = np.array(ydot[i]) + # ydot[i][0] = ydot[i][1] + self.fnum = np.array(fnum) + self.temp = np.array(temp) + self.time = np.array(time) + self.dtime = np.ediff1d(time, to_begin=0) + self.ener = np.array(ener) + denerdt = np.zeros_like(ener) + denerdt[1:] = self.ener[1:]/self.dtime[1:] + self.edot = denerdt + # for now ydot is garbage might be useful later? class skydata(): - def __init__(self, inpath, pressure = False): - - out = NetworkOutput.ReadFromFile(inpath) - self.time = np.array(out.Times()) - self.temp = np.array(out.TemperatureVsTime()) * 1.0E9 - self.rho = np.array(out.DensityVsTime()) - self.edot = np.array(out.HeatingRateVsTime()) - self.Y = np.array(out.YVsTime()) - self.A = np.array(out.A()) - self.Z = np.array(out.Z()) - self.X = np.array([self.A * y for y in self.Y[:]]) - - if pressure: - jmax = len(self.temp) - - # writing intermediate thermo file for EoS - # calls the Helmholtz EoS for pressure as a.out - f = open("tmp.txt", 'w') - f.write(str(jmax) + "\n") - - for i in range(jmax): - wbar = 1.0 / np.sum(self.Y[i,:]) - abar = wbar * np.sum(np.dot(self.A,self.Y[i,:])) - zbar = wbar * np.sum(np.dot(self.Z,self.Y[i,:])) - f.write("{:.15e} {:.15e} {:.15e} {:.15e}\n".format(self.temp[i], - self.rho[i], abar, zbar)) - f.close() - - process = subprocess.Popen("./a.out", shell=True) - process.wait() - self.pressure = np.loadtxt("tmp_out.txt") - os.system("rm tmp*") - - def isoidx(self, a, z): + def __init__(self, inpath, pressure = False): + + out = NetworkOutput.ReadFromFile(inpath) + self.time = np.array(out.Times()) + self.temp = np.array(out.TemperatureVsTime()) * 1.0E9 + self.rho = np.array(out.DensityVsTime()) + self.edot = np.array(out.HeatingRateVsTime()) + self.Y = np.array(out.YVsTime()) + self.A = np.array(out.A()) + self.Z = np.array(out.Z()) + self.X = np.array([self.A * y for y in self.Y[:]]) + + if pressure: + jmax = len(self.temp) + + # writing intermediate thermo file for EoS + # calls the Helmholtz EoS for pressure as a.out + f = open("tmp.txt", 'w') + f.write(str(jmax) + "\n") + + for i in range(jmax): + wbar = 1.0 / np.sum(self.Y[i,:]) + abar = wbar * np.sum(np.dot(self.A,self.Y[i,:])) + zbar = wbar * np.sum(np.dot(self.Z,self.Y[i,:])) + f.write("{:.15e} {:.15e} {:.15e} {:.15e}\n".format(self.temp[i], + self.rho[i], abar, zbar)) + f.close() + + process = subprocess.Popen("./a.out", shell=True) + process.wait() + self.pressure = np.loadtxt("tmp_out.txt") + os.system("rm tmp*") + + def isoidx(self, a, z): ''' return index of isotope in the self.z, self.z, self.isos, self.misos, self.xisos[i,:] arrays @@ -168,7 +168,7 @@ def isoidx(self, a, z): print('isotope not found') else: return wh[0] - + #sky = skydata(inpath = "./urca_abovethresh/urca_isoc_abovethresh.h5", pressure = False) #star = starkiller_data("./urca_abovethresh/", runprefix='react_urca')