From d82c8c88afb55e8ad4386897d5f9c4a41d81ebd3 Mon Sep 17 00:00:00 2001 From: "Eric T. Johnson" Date: Thu, 4 Apr 2024 16:32:47 -0400 Subject: [PATCH] Update pynucastro networks for derived rate speedup (#1529) Includes improvements from pynucastro/pynucastro#726. --- networks/CNO_extras/partition_functions.H | 24 + networks/ECSN/partition_functions.H | 24 + networks/He-C-Fe-group/partition_functions.H | 24 + networks/He-C-Fe-group/reaclib_rates.H | 564 +++++++++--------- networks/ase/partition_functions.H | 24 + networks/ase/reaclib_rates.H | 300 +++++----- .../C-burn-simple/partition_functions.H | 24 + .../URCA-medium/partition_functions.H | 24 + .../URCA-simple/partition_functions.H | 24 + networks/nova/partition_functions.H | 24 + networks/nova2/partition_functions.H | 24 + networks/partition_test/partition_functions.H | 24 + networks/partition_test/reaclib_rates.H | 26 +- networks/sn160/partition_functions.H | 24 + networks/subch_approx/partition_functions.H | 24 + networks/subch_base/partition_functions.H | 24 + networks/subch_base/reaclib_rates.H | 246 ++++---- networks/subch_full/partition_functions.H | 24 + networks/subch_simple/partition_functions.H | 24 + 19 files changed, 932 insertions(+), 564 deletions(-) diff --git a/networks/CNO_extras/partition_functions.H b/networks/CNO_extras/partition_functions.H index 5f61b99b72..49793556f6 100644 --- a/networks/CNO_extras/partition_functions.H +++ b/networks/CNO_extras/partition_functions.H @@ -66,6 +66,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -88,6 +96,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/ECSN/partition_functions.H b/networks/ECSN/partition_functions.H index df8c6fe4e9..1e068bfe08 100644 --- a/networks/ECSN/partition_functions.H +++ b/networks/ECSN/partition_functions.H @@ -66,6 +66,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -88,6 +96,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/He-C-Fe-group/partition_functions.H b/networks/He-C-Fe-group/partition_functions.H index 9473909cfa..9f8483441a 100644 --- a/networks/He-C-Fe-group/partition_functions.H +++ b/networks/He-C-Fe-group/partition_functions.H @@ -769,6 +769,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -927,6 +935,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/He-C-Fe-group/reaclib_rates.H b/networks/He-C-Fe-group/reaclib_rates.H index 6327360c63..d423ce14dc 100644 --- a/networks/He-C-Fe-group/reaclib_rates.H +++ b/networks/He-C-Fe-group/reaclib_rates.H @@ -3263,7 +3263,7 @@ void rate_p_V47_to_Cr48_removed(const tf_t& tfactors, amrex::Real& rate, amrex:: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_N13_to_p_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_N13_to_p_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // N13 --> p + C12 @@ -3339,7 +3339,7 @@ void rate_N13_to_p_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::R template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // O16 --> He4 + C12 @@ -3397,7 +3397,7 @@ void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real O16_pf, dO16_pf_dT; // interpolating O16 partition function - get_partition_function(O16, tfactors, O16_pf, dO16_pf_dT); + get_partition_function_cached(O16, tfactors, pf_cache, O16_pf, dO16_pf_dT); amrex::Real z_r = He4_pf * C12_pf; amrex::Real z_p = O16_pf; @@ -3414,7 +3414,7 @@ void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_F18_to_He4_N14_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_F18_to_He4_N14_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // F18 --> He4 + N14 @@ -3480,7 +3480,7 @@ void rate_F18_to_He4_N14_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real F18_pf, dF18_pf_dT; // interpolating F18 partition function - get_partition_function(F18, tfactors, F18_pf, dF18_pf_dT); + get_partition_function_cached(F18, tfactors, pf_cache, F18_pf, dF18_pf_dT); amrex::Real N14_pf, dN14_pf_dT; // setting N14 partition function to 1.0 by default, independent of T @@ -3502,7 +3502,7 @@ void rate_F18_to_He4_N14_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ne20 --> He4 + O16 @@ -3570,11 +3570,11 @@ void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex amrex::Real O16_pf, dO16_pf_dT; // interpolating O16 partition function - get_partition_function(O16, tfactors, O16_pf, dO16_pf_dT); + get_partition_function_cached(O16, tfactors, pf_cache, O16_pf, dO16_pf_dT); amrex::Real Ne20_pf, dNe20_pf_dT; // interpolating Ne20 partition function - get_partition_function(Ne20, tfactors, Ne20_pf, dNe20_pf_dT); + get_partition_function_cached(Ne20, tfactors, pf_cache, Ne20_pf, dNe20_pf_dT); amrex::Real z_r = He4_pf * O16_pf; amrex::Real z_p = Ne20_pf; @@ -3591,7 +3591,7 @@ void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Na22_to_p_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Na22_to_p_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Na22 --> p + Ne21 @@ -3669,7 +3669,7 @@ void rate_Na22_to_p_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Ne21_pf, dNe21_pf_dT; // interpolating Ne21 partition function - get_partition_function(Ne21, tfactors, Ne21_pf, dNe21_pf_dT); + get_partition_function_cached(Ne21, tfactors, pf_cache, Ne21_pf, dNe21_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -3678,7 +3678,7 @@ void rate_Na22_to_p_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Na22_pf, dNa22_pf_dT; // interpolating Na22 partition function - get_partition_function(Na22, tfactors, Na22_pf, dNa22_pf_dT); + get_partition_function_cached(Na22, tfactors, pf_cache, Na22_pf, dNa22_pf_dT); amrex::Real z_r = p_pf * Ne21_pf; amrex::Real z_p = Na22_pf; @@ -3695,7 +3695,7 @@ void rate_Na22_to_p_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Na22_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Na22_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Na22 --> He4 + F18 @@ -3731,11 +3731,11 @@ void rate_Na22_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex amrex::Real F18_pf, dF18_pf_dT; // interpolating F18 partition function - get_partition_function(F18, tfactors, F18_pf, dF18_pf_dT); + get_partition_function_cached(F18, tfactors, pf_cache, F18_pf, dF18_pf_dT); amrex::Real Na22_pf, dNa22_pf_dT; // interpolating Na22 partition function - get_partition_function(Na22, tfactors, Na22_pf, dNa22_pf_dT); + get_partition_function_cached(Na22, tfactors, pf_cache, Na22_pf, dNa22_pf_dT); amrex::Real z_r = He4_pf * F18_pf; amrex::Real z_p = Na22_pf; @@ -3752,7 +3752,7 @@ void rate_Na22_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mg24 --> p + Na23 @@ -3815,7 +3815,7 @@ void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Na23_pf, dNa23_pf_dT; // interpolating Na23 partition function - get_partition_function(Na23, tfactors, Na23_pf, dNa23_pf_dT); + get_partition_function_cached(Na23, tfactors, pf_cache, Na23_pf, dNa23_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -3824,7 +3824,7 @@ void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real z_r = p_pf * Na23_pf; amrex::Real z_p = Mg24_pf; @@ -3841,7 +3841,7 @@ void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mg24 --> He4 + Ne20 @@ -3924,11 +3924,11 @@ void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real Ne20_pf, dNe20_pf_dT; // interpolating Ne20 partition function - get_partition_function(Ne20, tfactors, Ne20_pf, dNe20_pf_dT); + get_partition_function_cached(Ne20, tfactors, pf_cache, Ne20_pf, dNe20_pf_dT); amrex::Real z_r = He4_pf * Ne20_pf; amrex::Real z_p = Mg24_pf; @@ -3945,7 +3945,7 @@ void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Si28 --> p + Al27 @@ -4015,11 +4015,11 @@ void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Al27_pf, dAl27_pf_dT; // interpolating Al27 partition function - get_partition_function(Al27, tfactors, Al27_pf, dAl27_pf_dT); + get_partition_function_cached(Al27, tfactors, pf_cache, Al27_pf, dAl27_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = p_pf * Al27_pf; amrex::Real z_p = Si28_pf; @@ -4036,7 +4036,7 @@ void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Si28 --> He4 + Mg24 @@ -4087,11 +4087,11 @@ void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = He4_pf * Mg24_pf; amrex::Real z_p = Si28_pf; @@ -4108,7 +4108,7 @@ void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // S32 --> p + P31 @@ -4176,11 +4176,11 @@ void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::R amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real P31_pf, dP31_pf_dT; // interpolating P31 partition function - get_partition_function(P31, tfactors, P31_pf, dP31_pf_dT); + get_partition_function_cached(P31, tfactors, pf_cache, P31_pf, dP31_pf_dT); amrex::Real z_r = p_pf * P31_pf; amrex::Real z_p = S32_pf; @@ -4197,7 +4197,7 @@ void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::R template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // S32 --> He4 + Si28 @@ -4233,11 +4233,11 @@ void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = He4_pf * Si28_pf; amrex::Real z_p = S32_pf; @@ -4254,7 +4254,7 @@ void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Fe52_to_p_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Fe52_to_p_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe52 --> p + Mn51 @@ -4285,7 +4285,7 @@ void rate_Fe52_to_p_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Mn51_pf, dMn51_pf_dT; // interpolating Mn51 partition function - get_partition_function(Mn51, tfactors, Mn51_pf, dMn51_pf_dT); + get_partition_function_cached(Mn51, tfactors, pf_cache, Mn51_pf, dMn51_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -4294,7 +4294,7 @@ void rate_Fe52_to_p_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = p_pf * Mn51_pf; amrex::Real z_p = Fe52_pf; @@ -4311,7 +4311,7 @@ void rate_Fe52_to_p_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Fe52_to_He4_Cr48_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Fe52_to_He4_Cr48_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe52 --> He4 + Cr48 @@ -4342,7 +4342,7 @@ void rate_Fe52_to_He4_Cr48_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4351,7 +4351,7 @@ void rate_Fe52_to_He4_Cr48_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = He4_pf * Cr48_pf; amrex::Real z_p = Fe52_pf; @@ -4368,7 +4368,7 @@ void rate_Fe52_to_He4_Cr48_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Co55_to_He4_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Co55_to_He4_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co55 --> He4 + Mn51 @@ -4399,7 +4399,7 @@ void rate_Co55_to_He4_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Mn51_pf, dMn51_pf_dT; // interpolating Mn51 partition function - get_partition_function(Mn51, tfactors, Mn51_pf, dMn51_pf_dT); + get_partition_function_cached(Mn51, tfactors, pf_cache, Mn51_pf, dMn51_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4408,7 +4408,7 @@ void rate_Co55_to_He4_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real z_r = He4_pf * Mn51_pf; amrex::Real z_p = Co55_pf; @@ -4425,7 +4425,7 @@ void rate_Co55_to_He4_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni56_to_p_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni56_to_p_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni56 --> p + Co55 @@ -4456,7 +4456,7 @@ void rate_Ni56_to_p_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -4465,7 +4465,7 @@ void rate_Ni56_to_p_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real z_r = p_pf * Co55_pf; amrex::Real z_p = Ni56_pf; @@ -4482,7 +4482,7 @@ void rate_Ni56_to_p_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni56_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni56_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni56 --> He4 + Fe52 @@ -4513,7 +4513,7 @@ void rate_Ni56_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4522,7 +4522,7 @@ void rate_Ni56_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = He4_pf * Fe52_pf; amrex::Real z_p = Ni56_pf; @@ -4539,7 +4539,7 @@ void rate_Ni56_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Cu59_to_He4_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Cu59_to_He4_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Cu59 --> He4 + Co55 @@ -4570,7 +4570,7 @@ void rate_Cu59_to_He4_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Cu59_pf, dCu59_pf_dT; // interpolating Cu59 partition function - get_partition_function(Cu59, tfactors, Cu59_pf, dCu59_pf_dT); + get_partition_function_cached(Cu59, tfactors, pf_cache, Cu59_pf, dCu59_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4579,7 +4579,7 @@ void rate_Cu59_to_He4_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real z_r = He4_pf * Co55_pf; amrex::Real z_p = Cu59_pf; @@ -4596,7 +4596,7 @@ void rate_Cu59_to_He4_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Zn60_to_p_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Zn60_to_p_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Zn60 --> p + Cu59 @@ -4627,7 +4627,7 @@ void rate_Zn60_to_p_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Cu59_pf, dCu59_pf_dT; // interpolating Cu59 partition function - get_partition_function(Cu59, tfactors, Cu59_pf, dCu59_pf_dT); + get_partition_function_cached(Cu59, tfactors, pf_cache, Cu59_pf, dCu59_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -4636,7 +4636,7 @@ void rate_Zn60_to_p_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Zn60_pf, dZn60_pf_dT; // interpolating Zn60 partition function - get_partition_function(Zn60, tfactors, Zn60_pf, dZn60_pf_dT); + get_partition_function_cached(Zn60, tfactors, pf_cache, Zn60_pf, dZn60_pf_dT); amrex::Real z_r = p_pf * Cu59_pf; amrex::Real z_p = Zn60_pf; @@ -4653,7 +4653,7 @@ void rate_Zn60_to_p_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Zn60_to_He4_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Zn60_to_He4_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Zn60 --> He4 + Ni56 @@ -4684,7 +4684,7 @@ void rate_Zn60_to_He4_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4693,7 +4693,7 @@ void rate_Zn60_to_He4_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Zn60_pf, dZn60_pf_dT; // interpolating Zn60 partition function - get_partition_function(Zn60, tfactors, Zn60_pf, dZn60_pf_dT); + get_partition_function_cached(Zn60, tfactors, pf_cache, Zn60_pf, dZn60_pf_dT); amrex::Real z_r = He4_pf * Ni56_pf; amrex::Real z_p = Zn60_pf; @@ -4710,7 +4710,7 @@ void rate_Zn60_to_He4_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_C12_to_He4_He4_He4_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_C12_to_He4_He4_He4_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // C12 --> He4 + He4 + He4 @@ -4798,7 +4798,7 @@ void rate_C12_to_He4_He4_He4_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // O16 + p --> He4 + N13 @@ -4834,7 +4834,7 @@ void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real O16_pf, dO16_pf_dT; // interpolating O16 partition function - get_partition_function(O16, tfactors, O16_pf, dO16_pf_dT); + get_partition_function_cached(O16, tfactors, pf_cache, O16_pf, dO16_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4861,7 +4861,7 @@ void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ne20 + He4 --> p + Na23 @@ -4926,7 +4926,7 @@ void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Na23_pf, dNa23_pf_dT; // interpolating Na23 partition function - get_partition_function(Na23, tfactors, Na23_pf, dNa23_pf_dT); + get_partition_function_cached(Na23, tfactors, pf_cache, Na23_pf, dNa23_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -4940,7 +4940,7 @@ void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Ne20_pf, dNe20_pf_dT; // interpolating Ne20 partition function - get_partition_function(Ne20, tfactors, Ne20_pf, dNe20_pf_dT); + get_partition_function_cached(Ne20, tfactors, pf_cache, Ne20_pf, dNe20_pf_dT); amrex::Real z_r = p_pf * Na23_pf; amrex::Real z_p = He4_pf * Ne20_pf; @@ -4957,7 +4957,7 @@ void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Ne21_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Ne21_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ne21 + p --> He4 + F18 @@ -4993,7 +4993,7 @@ void rate_p_Ne21_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amr amrex::Real Ne21_pf, dNe21_pf_dT; // interpolating Ne21 partition function - get_partition_function(Ne21, tfactors, Ne21_pf, dNe21_pf_dT); + get_partition_function_cached(Ne21, tfactors, pf_cache, Ne21_pf, dNe21_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -5002,7 +5002,7 @@ void rate_p_Ne21_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amr amrex::Real F18_pf, dF18_pf_dT; // interpolating F18 partition function - get_partition_function(F18, tfactors, F18_pf, dF18_pf_dT); + get_partition_function_cached(F18, tfactors, pf_cache, F18_pf, dF18_pf_dT); amrex::Real z_r = He4_pf * F18_pf; amrex::Real z_p = p_pf * Ne21_pf; @@ -5019,7 +5019,7 @@ void rate_p_Ne21_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amr template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mg24 + He4 --> p + Al27 @@ -5089,11 +5089,11 @@ void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Al27_pf, dAl27_pf_dT; // interpolating Al27 partition function - get_partition_function(Al27, tfactors, Al27_pf, dAl27_pf_dT); + get_partition_function_cached(Al27, tfactors, pf_cache, Al27_pf, dAl27_pf_dT); amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -5115,7 +5115,7 @@ void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Si28 + He4 --> p + P31 @@ -5190,11 +5190,11 @@ void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amr amrex::Real P31_pf, dP31_pf_dT; // interpolating P31 partition function - get_partition_function(P31, tfactors, P31_pf, dP31_pf_dT); + get_partition_function_cached(P31, tfactors, pf_cache, P31_pf, dP31_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = p_pf * P31_pf; amrex::Real z_p = He4_pf * Si28_pf; @@ -5211,7 +5211,7 @@ void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amr template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Mn51_to_He4_Cr48_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Mn51_to_He4_Cr48_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mn51 + p --> He4 + Cr48 @@ -5247,7 +5247,7 @@ void rate_p_Mn51_to_He4_Cr48_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -5256,7 +5256,7 @@ void rate_p_Mn51_to_He4_Cr48_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Mn51_pf, dMn51_pf_dT; // interpolating Mn51 partition function - get_partition_function(Mn51, tfactors, Mn51_pf, dMn51_pf_dT); + get_partition_function_cached(Mn51, tfactors, pf_cache, Mn51_pf, dMn51_pf_dT); amrex::Real z_r = He4_pf * Cr48_pf; amrex::Real z_p = p_pf * Mn51_pf; @@ -5273,7 +5273,7 @@ void rate_p_Mn51_to_He4_Cr48_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Co55_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Co55_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co55 + p --> He4 + Fe52 @@ -5314,11 +5314,11 @@ void rate_p_Co55_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = He4_pf * Fe52_pf; amrex::Real z_p = p_pf * Co55_pf; @@ -5335,7 +5335,7 @@ void rate_p_Co55_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Ni56_to_p_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Ni56_to_p_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni56 + He4 --> p + Cu59 @@ -5366,11 +5366,11 @@ void rate_He4_Ni56_to_p_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Cu59_pf, dCu59_pf_dT; // interpolating Cu59 partition function - get_partition_function(Cu59, tfactors, Cu59_pf, dCu59_pf_dT); + get_partition_function_cached(Cu59, tfactors, pf_cache, Cu59_pf, dCu59_pf_dT); amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -5397,7 +5397,7 @@ void rate_He4_Ni56_to_p_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Fe53_to_n_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Fe53_to_n_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe53 --> n + Fe52 @@ -5433,11 +5433,11 @@ void rate_Fe53_to_n_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real Fe53_pf, dFe53_pf_dT; // interpolating Fe53 partition function - get_partition_function(Fe53, tfactors, Fe53_pf, dFe53_pf_dT); + get_partition_function_cached(Fe53, tfactors, pf_cache, Fe53_pf, dFe53_pf_dT); amrex::Real z_r = n_pf * Fe52_pf; amrex::Real z_p = Fe53_pf; @@ -5454,7 +5454,7 @@ void rate_Fe53_to_n_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Fe54_to_n_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Fe54_to_n_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe54 --> n + Fe53 @@ -5490,11 +5490,11 @@ void rate_Fe54_to_n_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Fe53_pf, dFe53_pf_dT; // interpolating Fe53 partition function - get_partition_function(Fe53, tfactors, Fe53_pf, dFe53_pf_dT); + get_partition_function_cached(Fe53, tfactors, pf_cache, Fe53_pf, dFe53_pf_dT); amrex::Real Fe54_pf, dFe54_pf_dT; // interpolating Fe54 partition function - get_partition_function(Fe54, tfactors, Fe54_pf, dFe54_pf_dT); + get_partition_function_cached(Fe54, tfactors, pf_cache, Fe54_pf, dFe54_pf_dT); amrex::Real z_r = n_pf * Fe53_pf; amrex::Real z_p = Fe54_pf; @@ -5511,7 +5511,7 @@ void rate_Fe54_to_n_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Fe55_to_n_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Fe55_to_n_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe55 --> n + Fe54 @@ -5547,11 +5547,11 @@ void rate_Fe55_to_n_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Fe55_pf, dFe55_pf_dT; // interpolating Fe55 partition function - get_partition_function(Fe55, tfactors, Fe55_pf, dFe55_pf_dT); + get_partition_function_cached(Fe55, tfactors, pf_cache, Fe55_pf, dFe55_pf_dT); amrex::Real Fe54_pf, dFe54_pf_dT; // interpolating Fe54 partition function - get_partition_function(Fe54, tfactors, Fe54_pf, dFe54_pf_dT); + get_partition_function_cached(Fe54, tfactors, pf_cache, Fe54_pf, dFe54_pf_dT); amrex::Real z_r = n_pf * Fe54_pf; amrex::Real z_p = Fe55_pf; @@ -5568,7 +5568,7 @@ void rate_Fe55_to_n_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Fe56_to_n_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Fe56_to_n_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe56 --> n + Fe55 @@ -5604,11 +5604,11 @@ void rate_Fe56_to_n_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Fe56_pf, dFe56_pf_dT; // interpolating Fe56 partition function - get_partition_function(Fe56, tfactors, Fe56_pf, dFe56_pf_dT); + get_partition_function_cached(Fe56, tfactors, pf_cache, Fe56_pf, dFe56_pf_dT); amrex::Real Fe55_pf, dFe55_pf_dT; // interpolating Fe55 partition function - get_partition_function(Fe55, tfactors, Fe55_pf, dFe55_pf_dT); + get_partition_function_cached(Fe55, tfactors, pf_cache, Fe55_pf, dFe55_pf_dT); amrex::Real z_r = n_pf * Fe55_pf; amrex::Real z_p = Fe56_pf; @@ -5625,7 +5625,7 @@ void rate_Fe56_to_n_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Fe56_to_p_Mn55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Fe56_to_p_Mn55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe56 --> p + Mn55 @@ -5661,11 +5661,11 @@ void rate_Fe56_to_p_Mn55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Fe56_pf, dFe56_pf_dT; // interpolating Fe56 partition function - get_partition_function(Fe56, tfactors, Fe56_pf, dFe56_pf_dT); + get_partition_function_cached(Fe56, tfactors, pf_cache, Fe56_pf, dFe56_pf_dT); amrex::Real Mn55_pf, dMn55_pf_dT; // interpolating Mn55 partition function - get_partition_function(Mn55, tfactors, Mn55_pf, dMn55_pf_dT); + get_partition_function_cached(Mn55, tfactors, pf_cache, Mn55_pf, dMn55_pf_dT); amrex::Real z_r = p_pf * Mn55_pf; amrex::Real z_p = Fe56_pf; @@ -5682,7 +5682,7 @@ void rate_Fe56_to_p_Mn55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Co55_to_p_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Co55_to_p_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co55 --> p + Fe54 @@ -5718,11 +5718,11 @@ void rate_Co55_to_p_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real Fe54_pf, dFe54_pf_dT; // interpolating Fe54 partition function - get_partition_function(Fe54, tfactors, Fe54_pf, dFe54_pf_dT); + get_partition_function_cached(Fe54, tfactors, pf_cache, Fe54_pf, dFe54_pf_dT); amrex::Real z_r = p_pf * Fe54_pf; amrex::Real z_p = Co55_pf; @@ -5739,7 +5739,7 @@ void rate_Co55_to_p_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Co56_to_n_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Co56_to_n_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co56 --> n + Co55 @@ -5775,11 +5775,11 @@ void rate_Co56_to_n_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real Co56_pf, dCo56_pf_dT; // interpolating Co56 partition function - get_partition_function(Co56, tfactors, Co56_pf, dCo56_pf_dT); + get_partition_function_cached(Co56, tfactors, pf_cache, Co56_pf, dCo56_pf_dT); amrex::Real z_r = n_pf * Co55_pf; amrex::Real z_p = Co56_pf; @@ -5796,7 +5796,7 @@ void rate_Co56_to_n_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Co56_to_p_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Co56_to_p_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co56 --> p + Fe55 @@ -5827,7 +5827,7 @@ void rate_Co56_to_p_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Fe55_pf, dFe55_pf_dT; // interpolating Fe55 partition function - get_partition_function(Fe55, tfactors, Fe55_pf, dFe55_pf_dT); + get_partition_function_cached(Fe55, tfactors, pf_cache, Fe55_pf, dFe55_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -5836,7 +5836,7 @@ void rate_Co56_to_p_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Co56_pf, dCo56_pf_dT; // interpolating Co56 partition function - get_partition_function(Co56, tfactors, Co56_pf, dCo56_pf_dT); + get_partition_function_cached(Co56, tfactors, pf_cache, Co56_pf, dCo56_pf_dT); amrex::Real z_r = p_pf * Fe55_pf; amrex::Real z_p = Co56_pf; @@ -5853,7 +5853,7 @@ void rate_Co56_to_p_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Co57_to_n_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Co57_to_n_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co57 --> n + Co56 @@ -5889,11 +5889,11 @@ void rate_Co57_to_n_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Co56_pf, dCo56_pf_dT; // interpolating Co56 partition function - get_partition_function(Co56, tfactors, Co56_pf, dCo56_pf_dT); + get_partition_function_cached(Co56, tfactors, pf_cache, Co56_pf, dCo56_pf_dT); amrex::Real Co57_pf, dCo57_pf_dT; // interpolating Co57 partition function - get_partition_function(Co57, tfactors, Co57_pf, dCo57_pf_dT); + get_partition_function_cached(Co57, tfactors, pf_cache, Co57_pf, dCo57_pf_dT); amrex::Real z_r = n_pf * Co56_pf; amrex::Real z_p = Co57_pf; @@ -5910,7 +5910,7 @@ void rate_Co57_to_n_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Co57_to_p_Fe56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Co57_to_p_Fe56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co57 --> p + Fe56 @@ -5946,11 +5946,11 @@ void rate_Co57_to_p_Fe56_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Fe56_pf, dFe56_pf_dT; // interpolating Fe56 partition function - get_partition_function(Fe56, tfactors, Fe56_pf, dFe56_pf_dT); + get_partition_function_cached(Fe56, tfactors, pf_cache, Fe56_pf, dFe56_pf_dT); amrex::Real Co57_pf, dCo57_pf_dT; // interpolating Co57 partition function - get_partition_function(Co57, tfactors, Co57_pf, dCo57_pf_dT); + get_partition_function_cached(Co57, tfactors, pf_cache, Co57_pf, dCo57_pf_dT); amrex::Real z_r = p_pf * Fe56_pf; amrex::Real z_p = Co57_pf; @@ -5967,7 +5967,7 @@ void rate_Co57_to_p_Fe56_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni57_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni57_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni57 --> n + Ni56 @@ -6003,11 +6003,11 @@ void rate_Ni57_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real Ni57_pf, dNi57_pf_dT; // interpolating Ni57 partition function - get_partition_function(Ni57, tfactors, Ni57_pf, dNi57_pf_dT); + get_partition_function_cached(Ni57, tfactors, pf_cache, Ni57_pf, dNi57_pf_dT); amrex::Real z_r = n_pf * Ni56_pf; amrex::Real z_p = Ni57_pf; @@ -6024,7 +6024,7 @@ void rate_Ni57_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni57_to_p_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni57_to_p_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni57 --> p + Co56 @@ -6055,7 +6055,7 @@ void rate_Ni57_to_p_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Ni57_pf, dNi57_pf_dT; // interpolating Ni57 partition function - get_partition_function(Ni57, tfactors, Ni57_pf, dNi57_pf_dT); + get_partition_function_cached(Ni57, tfactors, pf_cache, Ni57_pf, dNi57_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -6064,7 +6064,7 @@ void rate_Ni57_to_p_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Co56_pf, dCo56_pf_dT; // interpolating Co56 partition function - get_partition_function(Co56, tfactors, Co56_pf, dCo56_pf_dT); + get_partition_function_cached(Co56, tfactors, pf_cache, Co56_pf, dCo56_pf_dT); amrex::Real z_r = p_pf * Co56_pf; amrex::Real z_p = Ni57_pf; @@ -6081,7 +6081,7 @@ void rate_Ni57_to_p_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni57_to_He4_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni57_to_He4_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni57 --> He4 + Fe53 @@ -6112,7 +6112,7 @@ void rate_Ni57_to_He4_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Ni57_pf, dNi57_pf_dT; // interpolating Ni57 partition function - get_partition_function(Ni57, tfactors, Ni57_pf, dNi57_pf_dT); + get_partition_function_cached(Ni57, tfactors, pf_cache, Ni57_pf, dNi57_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -6121,7 +6121,7 @@ void rate_Ni57_to_He4_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Fe53_pf, dFe53_pf_dT; // interpolating Fe53 partition function - get_partition_function(Fe53, tfactors, Fe53_pf, dFe53_pf_dT); + get_partition_function_cached(Fe53, tfactors, pf_cache, Fe53_pf, dFe53_pf_dT); amrex::Real z_r = He4_pf * Fe53_pf; amrex::Real z_p = Ni57_pf; @@ -6138,7 +6138,7 @@ void rate_Ni57_to_He4_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni58_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni58_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni58 --> n + Ni57 @@ -6174,11 +6174,11 @@ void rate_Ni58_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Ni57_pf, dNi57_pf_dT; // interpolating Ni57 partition function - get_partition_function(Ni57, tfactors, Ni57_pf, dNi57_pf_dT); + get_partition_function_cached(Ni57, tfactors, pf_cache, Ni57_pf, dNi57_pf_dT); amrex::Real Ni58_pf, dNi58_pf_dT; // interpolating Ni58 partition function - get_partition_function(Ni58, tfactors, Ni58_pf, dNi58_pf_dT); + get_partition_function_cached(Ni58, tfactors, pf_cache, Ni58_pf, dNi58_pf_dT); amrex::Real z_r = n_pf * Ni57_pf; amrex::Real z_p = Ni58_pf; @@ -6195,7 +6195,7 @@ void rate_Ni58_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni58_to_p_Co57_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni58_to_p_Co57_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni58 --> p + Co57 @@ -6231,11 +6231,11 @@ void rate_Ni58_to_p_Co57_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Ni58_pf, dNi58_pf_dT; // interpolating Ni58 partition function - get_partition_function(Ni58, tfactors, Ni58_pf, dNi58_pf_dT); + get_partition_function_cached(Ni58, tfactors, pf_cache, Ni58_pf, dNi58_pf_dT); amrex::Real Co57_pf, dCo57_pf_dT; // interpolating Co57 partition function - get_partition_function(Co57, tfactors, Co57_pf, dCo57_pf_dT); + get_partition_function_cached(Co57, tfactors, pf_cache, Co57_pf, dCo57_pf_dT); amrex::Real z_r = p_pf * Co57_pf; amrex::Real z_p = Ni58_pf; @@ -6252,7 +6252,7 @@ void rate_Ni58_to_p_Co57_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni58_to_He4_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni58_to_He4_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni58 --> He4 + Fe54 @@ -6288,11 +6288,11 @@ void rate_Ni58_to_He4_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Ni58_pf, dNi58_pf_dT; // interpolating Ni58 partition function - get_partition_function(Ni58, tfactors, Ni58_pf, dNi58_pf_dT); + get_partition_function_cached(Ni58, tfactors, pf_cache, Ni58_pf, dNi58_pf_dT); amrex::Real Fe54_pf, dFe54_pf_dT; // interpolating Fe54 partition function - get_partition_function(Fe54, tfactors, Fe54_pf, dFe54_pf_dT); + get_partition_function_cached(Fe54, tfactors, pf_cache, Fe54_pf, dFe54_pf_dT); amrex::Real z_r = He4_pf * Fe54_pf; amrex::Real z_p = Ni58_pf; @@ -6309,7 +6309,7 @@ void rate_Ni58_to_He4_Fe54_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Cu59_to_p_Ni58_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Cu59_to_p_Ni58_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Cu59 --> p + Ni58 @@ -6340,7 +6340,7 @@ void rate_Cu59_to_p_Ni58_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Cu59_pf, dCu59_pf_dT; // interpolating Cu59 partition function - get_partition_function(Cu59, tfactors, Cu59_pf, dCu59_pf_dT); + get_partition_function_cached(Cu59, tfactors, pf_cache, Cu59_pf, dCu59_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -6349,7 +6349,7 @@ void rate_Cu59_to_p_Ni58_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Ni58_pf, dNi58_pf_dT; // interpolating Ni58 partition function - get_partition_function(Ni58, tfactors, Ni58_pf, dNi58_pf_dT); + get_partition_function_cached(Ni58, tfactors, pf_cache, Ni58_pf, dNi58_pf_dT); amrex::Real z_r = p_pf * Ni58_pf; amrex::Real z_p = Cu59_pf; @@ -6366,7 +6366,7 @@ void rate_Cu59_to_p_Ni58_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Mn55_to_n_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Mn55_to_n_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mn55 + p --> n + Fe55 @@ -6407,11 +6407,11 @@ void rate_p_Mn55_to_n_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Fe55_pf, dFe55_pf_dT; // interpolating Fe55 partition function - get_partition_function(Fe55, tfactors, Fe55_pf, dFe55_pf_dT); + get_partition_function_cached(Fe55, tfactors, pf_cache, Fe55_pf, dFe55_pf_dT); amrex::Real Mn55_pf, dMn55_pf_dT; // interpolating Mn55 partition function - get_partition_function(Mn55, tfactors, Mn55_pf, dMn55_pf_dT); + get_partition_function_cached(Mn55, tfactors, pf_cache, Mn55_pf, dMn55_pf_dT); amrex::Real z_r = n_pf * Fe55_pf; amrex::Real z_p = p_pf * Mn55_pf; @@ -6428,7 +6428,7 @@ void rate_p_Mn55_to_n_Fe55_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Fe53_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Fe53_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe53 + He4 --> n + Ni56 @@ -6464,7 +6464,7 @@ void rate_He4_Fe53_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -6473,7 +6473,7 @@ void rate_He4_Fe53_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Fe53_pf, dFe53_pf_dT; // interpolating Fe53 partition function - get_partition_function(Fe53, tfactors, Fe53_pf, dFe53_pf_dT); + get_partition_function_cached(Fe53, tfactors, pf_cache, Fe53_pf, dFe53_pf_dT); amrex::Real z_r = n_pf * Ni56_pf; amrex::Real z_p = He4_pf * Fe53_pf; @@ -6490,7 +6490,7 @@ void rate_He4_Fe53_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Fe54_to_He4_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Fe54_to_He4_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe54 + p --> He4 + Mn51 @@ -6526,7 +6526,7 @@ void rate_p_Fe54_to_He4_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Mn51_pf, dMn51_pf_dT; // interpolating Mn51 partition function - get_partition_function(Mn51, tfactors, Mn51_pf, dMn51_pf_dT); + get_partition_function_cached(Mn51, tfactors, pf_cache, Mn51_pf, dMn51_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -6535,7 +6535,7 @@ void rate_p_Fe54_to_He4_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Fe54_pf, dFe54_pf_dT; // interpolating Fe54 partition function - get_partition_function(Fe54, tfactors, Fe54_pf, dFe54_pf_dT); + get_partition_function_cached(Fe54, tfactors, pf_cache, Fe54_pf, dFe54_pf_dT); amrex::Real z_r = He4_pf * Mn51_pf; amrex::Real z_p = p_pf * Fe54_pf; @@ -6552,7 +6552,7 @@ void rate_p_Fe54_to_He4_Mn51_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Fe54_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Fe54_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe54 + He4 --> n + Ni57 @@ -6588,7 +6588,7 @@ void rate_He4_Fe54_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Ni57_pf, dNi57_pf_dT; // interpolating Ni57 partition function - get_partition_function(Ni57, tfactors, Ni57_pf, dNi57_pf_dT); + get_partition_function_cached(Ni57, tfactors, pf_cache, Ni57_pf, dNi57_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -6597,7 +6597,7 @@ void rate_He4_Fe54_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Fe54_pf, dFe54_pf_dT; // interpolating Fe54 partition function - get_partition_function(Fe54, tfactors, Fe54_pf, dFe54_pf_dT); + get_partition_function_cached(Fe54, tfactors, pf_cache, Fe54_pf, dFe54_pf_dT); amrex::Real z_r = n_pf * Ni57_pf; amrex::Real z_p = He4_pf * Fe54_pf; @@ -6614,7 +6614,7 @@ void rate_He4_Fe54_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Fe54_to_p_Co57_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Fe54_to_p_Co57_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe54 + He4 --> p + Co57 @@ -6655,11 +6655,11 @@ void rate_He4_Fe54_to_p_Co57_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Co57_pf, dCo57_pf_dT; // interpolating Co57 partition function - get_partition_function(Co57, tfactors, Co57_pf, dCo57_pf_dT); + get_partition_function_cached(Co57, tfactors, pf_cache, Co57_pf, dCo57_pf_dT); amrex::Real Fe54_pf, dFe54_pf_dT; // interpolating Fe54 partition function - get_partition_function(Fe54, tfactors, Fe54_pf, dFe54_pf_dT); + get_partition_function_cached(Fe54, tfactors, pf_cache, Fe54_pf, dFe54_pf_dT); amrex::Real z_r = p_pf * Co57_pf; amrex::Real z_p = He4_pf * Fe54_pf; @@ -6676,7 +6676,7 @@ void rate_He4_Fe54_to_p_Co57_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Fe55_to_n_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Fe55_to_n_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe55 + p --> n + Co55 @@ -6717,11 +6717,11 @@ void rate_p_Fe55_to_n_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real Fe55_pf, dFe55_pf_dT; // interpolating Fe55 partition function - get_partition_function(Fe55, tfactors, Fe55_pf, dFe55_pf_dT); + get_partition_function_cached(Fe55, tfactors, pf_cache, Fe55_pf, dFe55_pf_dT); amrex::Real z_r = n_pf * Co55_pf; amrex::Real z_p = p_pf * Fe55_pf; @@ -6738,7 +6738,7 @@ void rate_p_Fe55_to_n_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Fe55_to_n_Ni58_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Fe55_to_n_Ni58_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe55 + He4 --> n + Ni58 @@ -6779,11 +6779,11 @@ void rate_He4_Fe55_to_n_Ni58_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Ni58_pf, dNi58_pf_dT; // interpolating Ni58 partition function - get_partition_function(Ni58, tfactors, Ni58_pf, dNi58_pf_dT); + get_partition_function_cached(Ni58, tfactors, pf_cache, Ni58_pf, dNi58_pf_dT); amrex::Real Fe55_pf, dFe55_pf_dT; // interpolating Fe55 partition function - get_partition_function(Fe55, tfactors, Fe55_pf, dFe55_pf_dT); + get_partition_function_cached(Fe55, tfactors, pf_cache, Fe55_pf, dFe55_pf_dT); amrex::Real z_r = n_pf * Ni58_pf; amrex::Real z_p = He4_pf * Fe55_pf; @@ -6800,7 +6800,7 @@ void rate_He4_Fe55_to_n_Ni58_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Fe56_to_n_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Fe56_to_n_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe56 + p --> n + Co56 @@ -6841,11 +6841,11 @@ void rate_p_Fe56_to_n_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Fe56_pf, dFe56_pf_dT; // interpolating Fe56 partition function - get_partition_function(Fe56, tfactors, Fe56_pf, dFe56_pf_dT); + get_partition_function_cached(Fe56, tfactors, pf_cache, Fe56_pf, dFe56_pf_dT); amrex::Real Co56_pf, dCo56_pf_dT; // interpolating Co56 partition function - get_partition_function(Co56, tfactors, Co56_pf, dCo56_pf_dT); + get_partition_function_cached(Co56, tfactors, pf_cache, Co56_pf, dCo56_pf_dT); amrex::Real z_r = n_pf * Co56_pf; amrex::Real z_p = p_pf * Fe56_pf; @@ -6862,7 +6862,7 @@ void rate_p_Fe56_to_n_Co56_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Co56_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Co56_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co56 + p --> n + Ni56 @@ -6898,7 +6898,7 @@ void rate_p_Co56_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -6907,7 +6907,7 @@ void rate_p_Co56_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Co56_pf, dCo56_pf_dT; // interpolating Co56 partition function - get_partition_function(Co56, tfactors, Co56_pf, dCo56_pf_dT); + get_partition_function_cached(Co56, tfactors, pf_cache, Co56_pf, dCo56_pf_dT); amrex::Real z_r = n_pf * Ni56_pf; amrex::Real z_p = p_pf * Co56_pf; @@ -6924,7 +6924,7 @@ void rate_p_Co56_to_n_Ni56_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Co56_to_He4_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Co56_to_He4_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co56 + p --> He4 + Fe53 @@ -6965,11 +6965,11 @@ void rate_p_Co56_to_He4_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Fe53_pf, dFe53_pf_dT; // interpolating Fe53 partition function - get_partition_function(Fe53, tfactors, Fe53_pf, dFe53_pf_dT); + get_partition_function_cached(Fe53, tfactors, pf_cache, Fe53_pf, dFe53_pf_dT); amrex::Real Co56_pf, dCo56_pf_dT; // interpolating Co56 partition function - get_partition_function(Co56, tfactors, Co56_pf, dCo56_pf_dT); + get_partition_function_cached(Co56, tfactors, pf_cache, Co56_pf, dCo56_pf_dT); amrex::Real z_r = He4_pf * Fe53_pf; amrex::Real z_p = p_pf * Co56_pf; @@ -6986,7 +6986,7 @@ void rate_p_Co56_to_He4_Fe53_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Co56_to_n_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Co56_to_n_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co56 + He4 --> n + Cu59 @@ -7022,7 +7022,7 @@ void rate_He4_Co56_to_n_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Cu59_pf, dCu59_pf_dT; // interpolating Cu59 partition function - get_partition_function(Cu59, tfactors, Cu59_pf, dCu59_pf_dT); + get_partition_function_cached(Cu59, tfactors, pf_cache, Cu59_pf, dCu59_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -7031,7 +7031,7 @@ void rate_He4_Co56_to_n_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Co56_pf, dCo56_pf_dT; // interpolating Co56 partition function - get_partition_function(Co56, tfactors, Co56_pf, dCo56_pf_dT); + get_partition_function_cached(Co56, tfactors, pf_cache, Co56_pf, dCo56_pf_dT); amrex::Real z_r = n_pf * Cu59_pf; amrex::Real z_p = He4_pf * Co56_pf; @@ -7048,7 +7048,7 @@ void rate_He4_Co56_to_n_Cu59_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Co57_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Co57_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co57 + p --> n + Ni57 @@ -7084,11 +7084,11 @@ void rate_p_Co57_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Ni57_pf, dNi57_pf_dT; // interpolating Ni57 partition function - get_partition_function(Ni57, tfactors, Ni57_pf, dNi57_pf_dT); + get_partition_function_cached(Ni57, tfactors, pf_cache, Ni57_pf, dNi57_pf_dT); amrex::Real Co57_pf, dCo57_pf_dT; // interpolating Co57 partition function - get_partition_function(Co57, tfactors, Co57_pf, dCo57_pf_dT); + get_partition_function_cached(Co57, tfactors, pf_cache, Co57_pf, dCo57_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -7110,7 +7110,7 @@ void rate_p_Co57_to_n_Ni57_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Ni57_to_n_Zn60_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Ni57_to_n_Zn60_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni57 + He4 --> n + Zn60 @@ -7146,7 +7146,7 @@ void rate_He4_Ni57_to_n_Zn60_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Ni57_pf, dNi57_pf_dT; // interpolating Ni57 partition function - get_partition_function(Ni57, tfactors, Ni57_pf, dNi57_pf_dT); + get_partition_function_cached(Ni57, tfactors, pf_cache, Ni57_pf, dNi57_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -7155,7 +7155,7 @@ void rate_He4_Ni57_to_n_Zn60_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Zn60_pf, dZn60_pf_dT; // interpolating Zn60 partition function - get_partition_function(Zn60, tfactors, Zn60_pf, dZn60_pf_dT); + get_partition_function_cached(Zn60, tfactors, pf_cache, Zn60_pf, dZn60_pf_dT); amrex::Real z_r = n_pf * Zn60_pf; amrex::Real z_p = He4_pf * Ni57_pf; @@ -7172,7 +7172,7 @@ void rate_He4_Ni57_to_n_Zn60_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Ni58_to_He4_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Ni58_to_He4_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni58 + p --> He4 + Co55 @@ -7213,11 +7213,11 @@ void rate_p_Ni58_to_He4_Co55_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real Ni58_pf, dNi58_pf_dT; // interpolating Ni58 partition function - get_partition_function(Ni58, tfactors, Ni58_pf, dNi58_pf_dT); + get_partition_function_cached(Ni58, tfactors, pf_cache, Ni58_pf, dNi58_pf_dT); amrex::Real z_r = He4_pf * Co55_pf; amrex::Real z_p = p_pf * Ni58_pf; @@ -7234,7 +7234,7 @@ void rate_p_Ni58_to_He4_Co55_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // S32 + He4 --> p + Cl35 @@ -7321,11 +7321,11 @@ void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& r amrex::Real Cl35_pf, dCl35_pf_dT; // interpolating Cl35 partition function - get_partition_function(Cl35, tfactors, Cl35_pf, dCl35_pf_dT); + get_partition_function_cached(Cl35, tfactors, pf_cache, Cl35_pf, dCl35_pf_dT); amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -7347,7 +7347,7 @@ void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& r template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ar36 --> He4 + S32 @@ -7383,11 +7383,11 @@ void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rat amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real z_r = He4_pf * S32_pf; amrex::Real z_p = Ar36_pf; @@ -7404,7 +7404,7 @@ void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rat template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ar36 --> p + Cl35 @@ -7487,11 +7487,11 @@ void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Cl35_pf, dCl35_pf_dT; // interpolating Cl35 partition function - get_partition_function(Cl35, tfactors, Cl35_pf, dCl35_pf_dT); + get_partition_function_cached(Cl35, tfactors, pf_cache, Cl35_pf, dCl35_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real z_r = p_pf * Cl35_pf; amrex::Real z_p = Ar36_pf; @@ -7508,7 +7508,7 @@ void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ar36 + He4 --> p + K39 @@ -7544,11 +7544,11 @@ void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& r amrex::Real K39_pf, dK39_pf_dT; // interpolating K39 partition function - get_partition_function(K39, tfactors, K39_pf, dK39_pf_dT); + get_partition_function_cached(K39, tfactors, pf_cache, K39_pf, dK39_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -7570,7 +7570,7 @@ void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& r template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ca40 --> He4 + Ar36 @@ -7606,11 +7606,11 @@ void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real z_r = He4_pf * Ar36_pf; amrex::Real z_p = Ca40_pf; @@ -7627,7 +7627,7 @@ void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ca40 --> p + K39 @@ -7697,11 +7697,11 @@ void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real K39_pf, dK39_pf_dT; // interpolating K39 partition function - get_partition_function(K39, tfactors, K39_pf, dK39_pf_dT); + get_partition_function_cached(K39, tfactors, pf_cache, K39_pf, dK39_pf_dT); amrex::Real z_r = p_pf * K39_pf; amrex::Real z_p = Ca40_pf; @@ -7718,7 +7718,7 @@ void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ca40 + He4 --> p + Sc43 @@ -7754,7 +7754,7 @@ void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -7763,7 +7763,7 @@ void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Sc43_pf, dSc43_pf_dT; // interpolating Sc43 partition function - get_partition_function(Sc43, tfactors, Sc43_pf, dSc43_pf_dT); + get_partition_function_cached(Sc43, tfactors, pf_cache, Sc43_pf, dSc43_pf_dT); amrex::Real z_r = p_pf * Sc43_pf; amrex::Real z_p = He4_pf * Ca40_pf; @@ -7780,7 +7780,7 @@ void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ti44 --> He4 + Ca40 @@ -7816,11 +7816,11 @@ void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real z_r = He4_pf * Ca40_pf; amrex::Real z_p = Ti44_pf; @@ -7837,7 +7837,7 @@ void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ti44 --> p + Sc43 @@ -7873,11 +7873,11 @@ void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real Sc43_pf, dSc43_pf_dT; // interpolating Sc43 partition function - get_partition_function(Sc43, tfactors, Sc43_pf, dSc43_pf_dT); + get_partition_function_cached(Sc43, tfactors, pf_cache, Sc43_pf, dSc43_pf_dT); amrex::Real z_r = p_pf * Sc43_pf; amrex::Real z_p = Ti44_pf; @@ -7894,7 +7894,7 @@ void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Cr48 --> He4 + Ti44 @@ -7925,7 +7925,7 @@ void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -7934,7 +7934,7 @@ void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real z_r = He4_pf * Ti44_pf; amrex::Real z_p = Cr48_pf; @@ -7951,7 +7951,7 @@ void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Cr48 --> p + V47 @@ -8033,7 +8033,7 @@ void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -8042,7 +8042,7 @@ void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real V47_pf, dV47_pf_dT; // interpolating V47 partition function - get_partition_function(V47, tfactors, V47_pf, dV47_pf_dT); + get_partition_function_cached(V47, tfactors, pf_cache, V47_pf, dV47_pf_dT); amrex::Real z_r = p_pf * V47_pf; amrex::Real z_p = Cr48_pf; @@ -8059,7 +8059,7 @@ void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_V47_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_V47_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // V47 + p --> He4 + Ti44 @@ -8100,11 +8100,11 @@ void rate_p_V47_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& r amrex::Real V47_pf, dV47_pf_dT; // interpolating V47 partition function - get_partition_function(V47, tfactors, V47_pf, dV47_pf_dT); + get_partition_function_cached(V47, tfactors, pf_cache, V47_pf, dV47_pf_dT); amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real z_r = He4_pf * Ti44_pf; amrex::Real z_p = p_pf * V47_pf; @@ -8282,6 +8282,8 @@ fill_reaclib_rates(const tf_t& tfactors, T& rate_eval) amrex::Real rate; amrex::Real drate_dT; + part_fun::pf_cache_t pf_cache{}; + rate_p_C12_to_N13(tfactors, rate, drate_dT); rate_eval.screened_rates(k_p_C12_to_N13) = rate; if constexpr (std::is_same_v) { @@ -8768,433 +8770,433 @@ fill_reaclib_rates(const tf_t& tfactors, T& rate_eval) rate_eval.dscreened_rates_dT(k_p_V47_to_Cr48_removed) = drate_dT; } - rate_N13_to_p_C12_derived(tfactors, rate, drate_dT); + rate_N13_to_p_C12_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_N13_to_p_C12_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_N13_to_p_C12_derived) = drate_dT; } - rate_O16_to_He4_C12_derived(tfactors, rate, drate_dT); + rate_O16_to_He4_C12_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_O16_to_He4_C12_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_O16_to_He4_C12_derived) = drate_dT; } - rate_F18_to_He4_N14_derived(tfactors, rate, drate_dT); + rate_F18_to_He4_N14_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_F18_to_He4_N14_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_F18_to_He4_N14_derived) = drate_dT; } - rate_Ne20_to_He4_O16_derived(tfactors, rate, drate_dT); + rate_Ne20_to_He4_O16_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ne20_to_He4_O16_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ne20_to_He4_O16_derived) = drate_dT; } - rate_Na22_to_p_Ne21_derived(tfactors, rate, drate_dT); + rate_Na22_to_p_Ne21_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Na22_to_p_Ne21_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Na22_to_p_Ne21_derived) = drate_dT; } - rate_Na22_to_He4_F18_derived(tfactors, rate, drate_dT); + rate_Na22_to_He4_F18_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Na22_to_He4_F18_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Na22_to_He4_F18_derived) = drate_dT; } - rate_Mg24_to_p_Na23_derived(tfactors, rate, drate_dT); + rate_Mg24_to_p_Na23_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Mg24_to_p_Na23_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Mg24_to_p_Na23_derived) = drate_dT; } - rate_Mg24_to_He4_Ne20_derived(tfactors, rate, drate_dT); + rate_Mg24_to_He4_Ne20_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Mg24_to_He4_Ne20_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Mg24_to_He4_Ne20_derived) = drate_dT; } - rate_Si28_to_p_Al27_derived(tfactors, rate, drate_dT); + rate_Si28_to_p_Al27_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Si28_to_p_Al27_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Si28_to_p_Al27_derived) = drate_dT; } - rate_Si28_to_He4_Mg24_derived(tfactors, rate, drate_dT); + rate_Si28_to_He4_Mg24_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Si28_to_He4_Mg24_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Si28_to_He4_Mg24_derived) = drate_dT; } - rate_S32_to_p_P31_derived(tfactors, rate, drate_dT); + rate_S32_to_p_P31_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_S32_to_p_P31_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_S32_to_p_P31_derived) = drate_dT; } - rate_S32_to_He4_Si28_derived(tfactors, rate, drate_dT); + rate_S32_to_He4_Si28_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_S32_to_He4_Si28_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_S32_to_He4_Si28_derived) = drate_dT; } - rate_Fe52_to_p_Mn51_derived(tfactors, rate, drate_dT); + rate_Fe52_to_p_Mn51_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Fe52_to_p_Mn51_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Fe52_to_p_Mn51_derived) = drate_dT; } - rate_Fe52_to_He4_Cr48_derived(tfactors, rate, drate_dT); + rate_Fe52_to_He4_Cr48_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Fe52_to_He4_Cr48_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Fe52_to_He4_Cr48_derived) = drate_dT; } - rate_Co55_to_He4_Mn51_derived(tfactors, rate, drate_dT); + rate_Co55_to_He4_Mn51_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Co55_to_He4_Mn51_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Co55_to_He4_Mn51_derived) = drate_dT; } - rate_Ni56_to_p_Co55_derived(tfactors, rate, drate_dT); + rate_Ni56_to_p_Co55_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni56_to_p_Co55_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni56_to_p_Co55_derived) = drate_dT; } - rate_Ni56_to_He4_Fe52_derived(tfactors, rate, drate_dT); + rate_Ni56_to_He4_Fe52_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni56_to_He4_Fe52_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni56_to_He4_Fe52_derived) = drate_dT; } - rate_Cu59_to_He4_Co55_derived(tfactors, rate, drate_dT); + rate_Cu59_to_He4_Co55_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Cu59_to_He4_Co55_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Cu59_to_He4_Co55_derived) = drate_dT; } - rate_Zn60_to_p_Cu59_derived(tfactors, rate, drate_dT); + rate_Zn60_to_p_Cu59_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Zn60_to_p_Cu59_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Zn60_to_p_Cu59_derived) = drate_dT; } - rate_Zn60_to_He4_Ni56_derived(tfactors, rate, drate_dT); + rate_Zn60_to_He4_Ni56_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Zn60_to_He4_Ni56_derived) = rate; if constexpr (std::is_same_v) { 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_C12_to_He4_He4_He4_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_C12_to_He4_He4_He4_derived) = rate; if constexpr (std::is_same_v) { 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_p_O16_to_He4_N13_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_O16_to_He4_N13_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Ne20_to_p_Na23_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Ne20_to_p_Na23_derived) = rate; if constexpr (std::is_same_v) { 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_p_Ne21_to_He4_F18_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Ne21_to_He4_F18_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Mg24_to_p_Al27_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Mg24_to_p_Al27_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Si28_to_p_P31_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Si28_to_p_P31_derived) = rate; if constexpr (std::is_same_v) { 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_p_Mn51_to_He4_Cr48_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Mn51_to_He4_Cr48_derived) = rate; if constexpr (std::is_same_v) { 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_p_Co55_to_He4_Fe52_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Co55_to_He4_Fe52_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Ni56_to_p_Cu59_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Ni56_to_p_Cu59_derived) = rate; if constexpr (std::is_same_v) { 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_Fe53_to_n_Fe52_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Fe53_to_n_Fe52_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Fe53_to_n_Fe52_derived) = drate_dT; } - rate_Fe54_to_n_Fe53_derived(tfactors, rate, drate_dT); + rate_Fe54_to_n_Fe53_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Fe54_to_n_Fe53_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Fe54_to_n_Fe53_derived) = drate_dT; } - rate_Fe55_to_n_Fe54_derived(tfactors, rate, drate_dT); + rate_Fe55_to_n_Fe54_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Fe55_to_n_Fe54_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Fe55_to_n_Fe54_derived) = drate_dT; } - rate_Fe56_to_n_Fe55_derived(tfactors, rate, drate_dT); + rate_Fe56_to_n_Fe55_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Fe56_to_n_Fe55_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Fe56_to_n_Fe55_derived) = drate_dT; } - rate_Fe56_to_p_Mn55_derived(tfactors, rate, drate_dT); + rate_Fe56_to_p_Mn55_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Fe56_to_p_Mn55_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Fe56_to_p_Mn55_derived) = drate_dT; } - rate_Co55_to_p_Fe54_derived(tfactors, rate, drate_dT); + rate_Co55_to_p_Fe54_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Co55_to_p_Fe54_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Co55_to_p_Fe54_derived) = drate_dT; } - rate_Co56_to_n_Co55_derived(tfactors, rate, drate_dT); + rate_Co56_to_n_Co55_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Co56_to_n_Co55_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Co56_to_n_Co55_derived) = drate_dT; } - rate_Co56_to_p_Fe55_derived(tfactors, rate, drate_dT); + rate_Co56_to_p_Fe55_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Co56_to_p_Fe55_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Co56_to_p_Fe55_derived) = drate_dT; } - rate_Co57_to_n_Co56_derived(tfactors, rate, drate_dT); + rate_Co57_to_n_Co56_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Co57_to_n_Co56_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Co57_to_n_Co56_derived) = drate_dT; } - rate_Co57_to_p_Fe56_derived(tfactors, rate, drate_dT); + rate_Co57_to_p_Fe56_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Co57_to_p_Fe56_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Co57_to_p_Fe56_derived) = drate_dT; } - rate_Ni57_to_n_Ni56_derived(tfactors, rate, drate_dT); + rate_Ni57_to_n_Ni56_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni57_to_n_Ni56_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni57_to_n_Ni56_derived) = drate_dT; } - rate_Ni57_to_p_Co56_derived(tfactors, rate, drate_dT); + rate_Ni57_to_p_Co56_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni57_to_p_Co56_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni57_to_p_Co56_derived) = drate_dT; } - rate_Ni57_to_He4_Fe53_derived(tfactors, rate, drate_dT); + rate_Ni57_to_He4_Fe53_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni57_to_He4_Fe53_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni57_to_He4_Fe53_derived) = drate_dT; } - rate_Ni58_to_n_Ni57_derived(tfactors, rate, drate_dT); + rate_Ni58_to_n_Ni57_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni58_to_n_Ni57_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni58_to_n_Ni57_derived) = drate_dT; } - rate_Ni58_to_p_Co57_derived(tfactors, rate, drate_dT); + rate_Ni58_to_p_Co57_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni58_to_p_Co57_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni58_to_p_Co57_derived) = drate_dT; } - rate_Ni58_to_He4_Fe54_derived(tfactors, rate, drate_dT); + rate_Ni58_to_He4_Fe54_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni58_to_He4_Fe54_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni58_to_He4_Fe54_derived) = drate_dT; } - rate_Cu59_to_p_Ni58_derived(tfactors, rate, drate_dT); + rate_Cu59_to_p_Ni58_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Cu59_to_p_Ni58_derived) = rate; if constexpr (std::is_same_v) { 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_p_Mn55_to_n_Fe55_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Mn55_to_n_Fe55_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Fe53_to_n_Ni56_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Fe53_to_n_Ni56_derived) = rate; if constexpr (std::is_same_v) { 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_p_Fe54_to_He4_Mn51_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Fe54_to_He4_Mn51_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Fe54_to_n_Ni57_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Fe54_to_n_Ni57_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Fe54_to_p_Co57_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Fe54_to_p_Co57_derived) = rate; if constexpr (std::is_same_v) { 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_p_Fe55_to_n_Co55_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Fe55_to_n_Co55_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Fe55_to_n_Ni58_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Fe55_to_n_Ni58_derived) = rate; if constexpr (std::is_same_v) { 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_p_Fe56_to_n_Co56_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Fe56_to_n_Co56_derived) = rate; if constexpr (std::is_same_v) { 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_p_Co56_to_n_Ni56_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Co56_to_n_Ni56_derived) = rate; if constexpr (std::is_same_v) { 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_p_Co56_to_He4_Fe53_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Co56_to_He4_Fe53_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Co56_to_n_Cu59_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Co56_to_n_Cu59_derived) = rate; if constexpr (std::is_same_v) { 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_p_Co57_to_n_Ni57_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Co57_to_n_Ni57_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Ni57_to_n_Zn60_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Ni57_to_n_Zn60_derived) = rate; if constexpr (std::is_same_v) { 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_p_Ni58_to_He4_Co55_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Ni58_to_He4_Co55_derived) = rate; if constexpr (std::is_same_v) { 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_He4_S32_to_p_Cl35_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_S32_to_p_Cl35_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ar36_to_He4_S32_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ar36_to_He4_S32_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ar36_to_p_Cl35_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ar36_to_p_Cl35_derived_removed) = rate; if constexpr (std::is_same_v) { 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_He4_Ar36_to_p_K39_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Ar36_to_p_K39_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ca40_to_He4_Ar36_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ca40_to_He4_Ar36_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ca40_to_p_K39_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ca40_to_p_K39_derived_removed) = rate; if constexpr (std::is_same_v) { 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_He4_Ca40_to_p_Sc43_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Ca40_to_p_Sc43_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ti44_to_He4_Ca40_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ti44_to_He4_Ca40_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ti44_to_p_Sc43_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ti44_to_p_Sc43_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Cr48_to_He4_Ti44_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Cr48_to_He4_Ti44_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Cr48_to_p_V47_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Cr48_to_p_V47_derived_removed) = rate; if constexpr (std::is_same_v) { 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_p_V47_to_He4_Ti44_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_V47_to_He4_Ti44_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_p_V47_to_He4_Ti44_derived_removed) = drate_dT; diff --git a/networks/ase/partition_functions.H b/networks/ase/partition_functions.H index 31d93349a1..34445edac6 100644 --- a/networks/ase/partition_functions.H +++ b/networks/ase/partition_functions.H @@ -549,6 +549,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -663,6 +671,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/ase/reaclib_rates.H b/networks/ase/reaclib_rates.H index 269063bebf..01b30a072c 100644 --- a/networks/ase/reaclib_rates.H +++ b/networks/ase/reaclib_rates.H @@ -2240,7 +2240,7 @@ void rate_p_Co55_to_Ni56_removed(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_N13_to_p_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_N13_to_p_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // N13 --> p + C12 @@ -2316,7 +2316,7 @@ void rate_N13_to_p_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::R template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // O16 --> He4 + C12 @@ -2374,7 +2374,7 @@ void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real O16_pf, dO16_pf_dT; // interpolating O16 partition function - get_partition_function(O16, tfactors, O16_pf, dO16_pf_dT); + get_partition_function_cached(O16, tfactors, pf_cache, O16_pf, dO16_pf_dT); amrex::Real z_r = He4_pf * C12_pf; amrex::Real z_p = O16_pf; @@ -2391,7 +2391,7 @@ void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_F18_to_He4_N14_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_F18_to_He4_N14_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // F18 --> He4 + N14 @@ -2457,7 +2457,7 @@ void rate_F18_to_He4_N14_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real F18_pf, dF18_pf_dT; // interpolating F18 partition function - get_partition_function(F18, tfactors, F18_pf, dF18_pf_dT); + get_partition_function_cached(F18, tfactors, pf_cache, F18_pf, dF18_pf_dT); amrex::Real N14_pf, dN14_pf_dT; // setting N14 partition function to 1.0 by default, independent of T @@ -2479,7 +2479,7 @@ void rate_F18_to_He4_N14_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ne20 --> He4 + O16 @@ -2547,11 +2547,11 @@ void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex amrex::Real O16_pf, dO16_pf_dT; // interpolating O16 partition function - get_partition_function(O16, tfactors, O16_pf, dO16_pf_dT); + get_partition_function_cached(O16, tfactors, pf_cache, O16_pf, dO16_pf_dT); amrex::Real Ne20_pf, dNe20_pf_dT; // interpolating Ne20 partition function - get_partition_function(Ne20, tfactors, Ne20_pf, dNe20_pf_dT); + get_partition_function_cached(Ne20, tfactors, pf_cache, Ne20_pf, dNe20_pf_dT); amrex::Real z_r = He4_pf * O16_pf; amrex::Real z_p = Ne20_pf; @@ -2568,7 +2568,7 @@ void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ne21_to_n_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ne21_to_n_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ne21 --> n + Ne20 @@ -2619,11 +2619,11 @@ void rate_Ne21_to_n_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Ne21_pf, dNe21_pf_dT; // interpolating Ne21 partition function - get_partition_function(Ne21, tfactors, Ne21_pf, dNe21_pf_dT); + get_partition_function_cached(Ne21, tfactors, pf_cache, Ne21_pf, dNe21_pf_dT); amrex::Real Ne20_pf, dNe20_pf_dT; // interpolating Ne20 partition function - get_partition_function(Ne20, tfactors, Ne20_pf, dNe20_pf_dT); + get_partition_function_cached(Ne20, tfactors, pf_cache, Ne20_pf, dNe20_pf_dT); amrex::Real z_r = n_pf * Ne20_pf; amrex::Real z_p = Ne21_pf; @@ -2640,7 +2640,7 @@ void rate_Ne21_to_n_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Na22_to_p_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Na22_to_p_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Na22 --> p + Ne21 @@ -2718,7 +2718,7 @@ void rate_Na22_to_p_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Ne21_pf, dNe21_pf_dT; // interpolating Ne21 partition function - get_partition_function(Ne21, tfactors, Ne21_pf, dNe21_pf_dT); + get_partition_function_cached(Ne21, tfactors, pf_cache, Ne21_pf, dNe21_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -2727,7 +2727,7 @@ void rate_Na22_to_p_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Na22_pf, dNa22_pf_dT; // interpolating Na22 partition function - get_partition_function(Na22, tfactors, Na22_pf, dNa22_pf_dT); + get_partition_function_cached(Na22, tfactors, pf_cache, Na22_pf, dNa22_pf_dT); amrex::Real z_r = p_pf * Ne21_pf; amrex::Real z_p = Na22_pf; @@ -2744,7 +2744,7 @@ void rate_Na22_to_p_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Na22_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Na22_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Na22 --> He4 + F18 @@ -2780,11 +2780,11 @@ void rate_Na22_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex amrex::Real F18_pf, dF18_pf_dT; // interpolating F18 partition function - get_partition_function(F18, tfactors, F18_pf, dF18_pf_dT); + get_partition_function_cached(F18, tfactors, pf_cache, F18_pf, dF18_pf_dT); amrex::Real Na22_pf, dNa22_pf_dT; // interpolating Na22 partition function - get_partition_function(Na22, tfactors, Na22_pf, dNa22_pf_dT); + get_partition_function_cached(Na22, tfactors, pf_cache, Na22_pf, dNa22_pf_dT); amrex::Real z_r = He4_pf * F18_pf; amrex::Real z_p = Na22_pf; @@ -2801,7 +2801,7 @@ void rate_Na22_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Na23_to_n_Na22_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Na23_to_n_Na22_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Na23 --> n + Na22 @@ -2837,11 +2837,11 @@ void rate_Na23_to_n_Na22_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Na23_pf, dNa23_pf_dT; // interpolating Na23 partition function - get_partition_function(Na23, tfactors, Na23_pf, dNa23_pf_dT); + get_partition_function_cached(Na23, tfactors, pf_cache, Na23_pf, dNa23_pf_dT); amrex::Real Na22_pf, dNa22_pf_dT; // interpolating Na22 partition function - get_partition_function(Na22, tfactors, Na22_pf, dNa22_pf_dT); + get_partition_function_cached(Na22, tfactors, pf_cache, Na22_pf, dNa22_pf_dT); amrex::Real z_r = n_pf * Na22_pf; amrex::Real z_p = Na23_pf; @@ -2858,7 +2858,7 @@ void rate_Na23_to_n_Na22_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mg24 --> p + Na23 @@ -2921,7 +2921,7 @@ void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Na23_pf, dNa23_pf_dT; // interpolating Na23 partition function - get_partition_function(Na23, tfactors, Na23_pf, dNa23_pf_dT); + get_partition_function_cached(Na23, tfactors, pf_cache, Na23_pf, dNa23_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -2930,7 +2930,7 @@ void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real z_r = p_pf * Na23_pf; amrex::Real z_p = Mg24_pf; @@ -2947,7 +2947,7 @@ void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mg24 --> He4 + Ne20 @@ -3030,11 +3030,11 @@ void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real Ne20_pf, dNe20_pf_dT; // interpolating Ne20 partition function - get_partition_function(Ne20, tfactors, Ne20_pf, dNe20_pf_dT); + get_partition_function_cached(Ne20, tfactors, pf_cache, Ne20_pf, dNe20_pf_dT); amrex::Real z_r = He4_pf * Ne20_pf; amrex::Real z_p = Mg24_pf; @@ -3051,7 +3051,7 @@ void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Si28 --> p + Al27 @@ -3121,11 +3121,11 @@ void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Al27_pf, dAl27_pf_dT; // interpolating Al27 partition function - get_partition_function(Al27, tfactors, Al27_pf, dAl27_pf_dT); + get_partition_function_cached(Al27, tfactors, pf_cache, Al27_pf, dAl27_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = p_pf * Al27_pf; amrex::Real z_p = Si28_pf; @@ -3142,7 +3142,7 @@ void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Si28 --> He4 + Mg24 @@ -3193,11 +3193,11 @@ void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = He4_pf * Mg24_pf; amrex::Real z_p = Si28_pf; @@ -3214,7 +3214,7 @@ void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // S32 --> p + P31 @@ -3282,11 +3282,11 @@ void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::R amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real P31_pf, dP31_pf_dT; // interpolating P31 partition function - get_partition_function(P31, tfactors, P31_pf, dP31_pf_dT); + get_partition_function_cached(P31, tfactors, pf_cache, P31_pf, dP31_pf_dT); amrex::Real z_r = p_pf * P31_pf; amrex::Real z_p = S32_pf; @@ -3303,7 +3303,7 @@ void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::R template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // S32 --> He4 + Si28 @@ -3339,11 +3339,11 @@ void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = He4_pf * Si28_pf; amrex::Real z_p = S32_pf; @@ -3360,7 +3360,7 @@ void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_C12_to_He4_He4_He4_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_C12_to_He4_He4_He4_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // C12 --> He4 + He4 + He4 @@ -3448,7 +3448,7 @@ void rate_C12_to_He4_He4_He4_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // O16 + p --> He4 + N13 @@ -3484,7 +3484,7 @@ void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real O16_pf, dO16_pf_dT; // interpolating O16 partition function - get_partition_function(O16, tfactors, O16_pf, dO16_pf_dT); + get_partition_function_cached(O16, tfactors, pf_cache, O16_pf, dO16_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -3511,7 +3511,7 @@ void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ne20 + He4 --> p + Na23 @@ -3576,7 +3576,7 @@ void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Na23_pf, dNa23_pf_dT; // interpolating Na23 partition function - get_partition_function(Na23, tfactors, Na23_pf, dNa23_pf_dT); + get_partition_function_cached(Na23, tfactors, pf_cache, Na23_pf, dNa23_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -3590,7 +3590,7 @@ void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Ne20_pf, dNe20_pf_dT; // interpolating Ne20 partition function - get_partition_function(Ne20, tfactors, Ne20_pf, dNe20_pf_dT); + get_partition_function_cached(Ne20, tfactors, pf_cache, Ne20_pf, dNe20_pf_dT); amrex::Real z_r = p_pf * Na23_pf; amrex::Real z_p = He4_pf * Ne20_pf; @@ -3607,7 +3607,7 @@ void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Ne21_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Ne21_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ne21 + p --> He4 + F18 @@ -3643,7 +3643,7 @@ void rate_p_Ne21_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amr amrex::Real Ne21_pf, dNe21_pf_dT; // interpolating Ne21 partition function - get_partition_function(Ne21, tfactors, Ne21_pf, dNe21_pf_dT); + get_partition_function_cached(Ne21, tfactors, pf_cache, Ne21_pf, dNe21_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -3652,7 +3652,7 @@ void rate_p_Ne21_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amr amrex::Real F18_pf, dF18_pf_dT; // interpolating F18 partition function - get_partition_function(F18, tfactors, F18_pf, dF18_pf_dT); + get_partition_function_cached(F18, tfactors, pf_cache, F18_pf, dF18_pf_dT); amrex::Real z_r = He4_pf * F18_pf; amrex::Real z_p = p_pf * Ne21_pf; @@ -3669,7 +3669,7 @@ void rate_p_Ne21_to_He4_F18_derived(const tf_t& tfactors, amrex::Real& rate, amr template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_n_Mg24_to_He4_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_n_Mg24_to_He4_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mg24 + n --> He4 + Ne21 @@ -3722,7 +3722,7 @@ void rate_n_Mg24_to_He4_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Ne21_pf, dNe21_pf_dT; // interpolating Ne21 partition function - get_partition_function(Ne21, tfactors, Ne21_pf, dNe21_pf_dT); + get_partition_function_cached(Ne21, tfactors, pf_cache, Ne21_pf, dNe21_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -3731,7 +3731,7 @@ void rate_n_Mg24_to_He4_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real z_r = He4_pf * Ne21_pf; amrex::Real z_p = n_pf * Mg24_pf; @@ -3748,7 +3748,7 @@ void rate_n_Mg24_to_He4_Ne21_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mg24 + He4 --> p + Al27 @@ -3818,11 +3818,11 @@ void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Al27_pf, dAl27_pf_dT; // interpolating Al27 partition function - get_partition_function(Al27, tfactors, Al27_pf, dAl27_pf_dT); + get_partition_function_cached(Al27, tfactors, pf_cache, Al27_pf, dAl27_pf_dT); amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -3844,7 +3844,7 @@ void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Si28 + He4 --> p + P31 @@ -3919,11 +3919,11 @@ void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amr amrex::Real P31_pf, dP31_pf_dT; // interpolating P31 partition function - get_partition_function(P31, tfactors, P31_pf, dP31_pf_dT); + get_partition_function_cached(P31, tfactors, pf_cache, P31_pf, dP31_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = p_pf * P31_pf; amrex::Real z_p = He4_pf * Si28_pf; @@ -3940,7 +3940,7 @@ void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amr template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // S32 + He4 --> p + Cl35 @@ -4027,11 +4027,11 @@ void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& r amrex::Real Cl35_pf, dCl35_pf_dT; // interpolating Cl35 partition function - get_partition_function(Cl35, tfactors, Cl35_pf, dCl35_pf_dT); + get_partition_function_cached(Cl35, tfactors, pf_cache, Cl35_pf, dCl35_pf_dT); amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4053,7 +4053,7 @@ void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& r template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ar36 --> He4 + S32 @@ -4089,11 +4089,11 @@ void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rat amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real z_r = He4_pf * S32_pf; amrex::Real z_p = Ar36_pf; @@ -4110,7 +4110,7 @@ void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rat template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ar36 --> p + Cl35 @@ -4193,11 +4193,11 @@ void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Cl35_pf, dCl35_pf_dT; // interpolating Cl35 partition function - get_partition_function(Cl35, tfactors, Cl35_pf, dCl35_pf_dT); + get_partition_function_cached(Cl35, tfactors, pf_cache, Cl35_pf, dCl35_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real z_r = p_pf * Cl35_pf; amrex::Real z_p = Ar36_pf; @@ -4214,7 +4214,7 @@ void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ar36 + He4 --> p + K39 @@ -4250,11 +4250,11 @@ void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& r amrex::Real K39_pf, dK39_pf_dT; // interpolating K39 partition function - get_partition_function(K39, tfactors, K39_pf, dK39_pf_dT); + get_partition_function_cached(K39, tfactors, pf_cache, K39_pf, dK39_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4276,7 +4276,7 @@ void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& r template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ca40 --> He4 + Ar36 @@ -4312,11 +4312,11 @@ void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real z_r = He4_pf * Ar36_pf; amrex::Real z_p = Ca40_pf; @@ -4333,7 +4333,7 @@ void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ca40 --> p + K39 @@ -4403,11 +4403,11 @@ void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real K39_pf, dK39_pf_dT; // interpolating K39 partition function - get_partition_function(K39, tfactors, K39_pf, dK39_pf_dT); + get_partition_function_cached(K39, tfactors, pf_cache, K39_pf, dK39_pf_dT); amrex::Real z_r = p_pf * K39_pf; amrex::Real z_p = Ca40_pf; @@ -4424,7 +4424,7 @@ void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ca40 + He4 --> p + Sc43 @@ -4460,7 +4460,7 @@ void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4469,7 +4469,7 @@ void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Sc43_pf, dSc43_pf_dT; // interpolating Sc43 partition function - get_partition_function(Sc43, tfactors, Sc43_pf, dSc43_pf_dT); + get_partition_function_cached(Sc43, tfactors, pf_cache, Sc43_pf, dSc43_pf_dT); amrex::Real z_r = p_pf * Sc43_pf; amrex::Real z_p = He4_pf * Ca40_pf; @@ -4486,7 +4486,7 @@ void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ti44 --> He4 + Ca40 @@ -4522,11 +4522,11 @@ void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real z_r = He4_pf * Ca40_pf; amrex::Real z_p = Ti44_pf; @@ -4543,7 +4543,7 @@ void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ti44 --> p + Sc43 @@ -4579,11 +4579,11 @@ void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real Sc43_pf, dSc43_pf_dT; // interpolating Sc43 partition function - get_partition_function(Sc43, tfactors, Sc43_pf, dSc43_pf_dT); + get_partition_function_cached(Sc43, tfactors, pf_cache, Sc43_pf, dSc43_pf_dT); amrex::Real z_r = p_pf * Sc43_pf; amrex::Real z_p = Ti44_pf; @@ -4600,7 +4600,7 @@ void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Cr48 --> He4 + Ti44 @@ -4631,7 +4631,7 @@ void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4640,7 +4640,7 @@ void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real z_r = He4_pf * Ti44_pf; amrex::Real z_p = Cr48_pf; @@ -4657,7 +4657,7 @@ void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Cr48 --> p + V47 @@ -4739,7 +4739,7 @@ void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -4748,7 +4748,7 @@ void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real V47_pf, dV47_pf_dT; // interpolating V47 partition function - get_partition_function(V47, tfactors, V47_pf, dV47_pf_dT); + get_partition_function_cached(V47, tfactors, pf_cache, V47_pf, dV47_pf_dT); amrex::Real z_r = p_pf * V47_pf; amrex::Real z_p = Cr48_pf; @@ -4765,7 +4765,7 @@ void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_V47_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_V47_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // V47 + p --> He4 + Ti44 @@ -4806,11 +4806,11 @@ void rate_p_V47_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& r amrex::Real V47_pf, dV47_pf_dT; // interpolating V47 partition function - get_partition_function(V47, tfactors, V47_pf, dV47_pf_dT); + get_partition_function_cached(V47, tfactors, pf_cache, V47_pf, dV47_pf_dT); amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real z_r = He4_pf * Ti44_pf; amrex::Real z_p = p_pf * V47_pf; @@ -4827,7 +4827,7 @@ void rate_p_V47_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& r template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Fe52_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Fe52_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe52 --> He4 + Cr48 @@ -4858,7 +4858,7 @@ void rate_Fe52_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4867,7 +4867,7 @@ void rate_Fe52_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = He4_pf * Cr48_pf; amrex::Real z_p = Fe52_pf; @@ -4884,7 +4884,7 @@ void rate_Fe52_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Fe52_to_p_Mn51_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Fe52_to_p_Mn51_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe52 --> p + Mn51 @@ -4915,7 +4915,7 @@ void rate_Fe52_to_p_Mn51_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Mn51_pf, dMn51_pf_dT; // interpolating Mn51 partition function - get_partition_function(Mn51, tfactors, Mn51_pf, dMn51_pf_dT); + get_partition_function_cached(Mn51, tfactors, pf_cache, Mn51_pf, dMn51_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -4924,7 +4924,7 @@ void rate_Fe52_to_p_Mn51_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = p_pf * Mn51_pf; amrex::Real z_p = Fe52_pf; @@ -4941,7 +4941,7 @@ void rate_Fe52_to_p_Mn51_derived_removed(const tf_t& tfactors, amrex::Real& rate template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Mn51_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Mn51_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mn51 + p --> He4 + Cr48 @@ -4977,7 +4977,7 @@ void rate_p_Mn51_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4986,7 +4986,7 @@ void rate_p_Mn51_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Mn51_pf, dMn51_pf_dT; // interpolating Mn51 partition function - get_partition_function(Mn51, tfactors, Mn51_pf, dMn51_pf_dT); + get_partition_function_cached(Mn51, tfactors, pf_cache, Mn51_pf, dMn51_pf_dT); amrex::Real z_r = He4_pf * Cr48_pf; amrex::Real z_p = p_pf * Mn51_pf; @@ -5003,7 +5003,7 @@ void rate_p_Mn51_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni56_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni56_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni56 --> He4 + Fe52 @@ -5034,7 +5034,7 @@ void rate_Ni56_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -5043,7 +5043,7 @@ void rate_Ni56_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = He4_pf * Fe52_pf; amrex::Real z_p = Ni56_pf; @@ -5060,7 +5060,7 @@ void rate_Ni56_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni56_to_p_Co55_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni56_to_p_Co55_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni56 --> p + Co55 @@ -5091,7 +5091,7 @@ void rate_Ni56_to_p_Co55_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -5100,7 +5100,7 @@ void rate_Ni56_to_p_Co55_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real z_r = p_pf * Co55_pf; amrex::Real z_p = Ni56_pf; @@ -5117,7 +5117,7 @@ void rate_Ni56_to_p_Co55_derived_removed(const tf_t& tfactors, amrex::Real& rate template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Co55_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Co55_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co55 + p --> He4 + Fe52 @@ -5158,11 +5158,11 @@ void rate_p_Co55_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = He4_pf * Fe52_pf; amrex::Real z_p = p_pf * Co55_pf; @@ -5416,6 +5416,8 @@ fill_reaclib_rates(const tf_t& tfactors, T& rate_eval) amrex::Real rate; amrex::Real drate_dT; + part_fun::pf_cache_t pf_cache{}; + rate_p_C12_to_N13(tfactors, rate, drate_dT); rate_eval.screened_rates(k_p_C12_to_N13) = rate; if constexpr (std::is_same_v) { @@ -5704,235 +5706,235 @@ fill_reaclib_rates(const tf_t& tfactors, T& rate_eval) rate_eval.dscreened_rates_dT(k_p_Co55_to_Ni56_removed) = drate_dT; } - rate_N13_to_p_C12_derived(tfactors, rate, drate_dT); + rate_N13_to_p_C12_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_N13_to_p_C12_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_N13_to_p_C12_derived) = drate_dT; } - rate_O16_to_He4_C12_derived(tfactors, rate, drate_dT); + rate_O16_to_He4_C12_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_O16_to_He4_C12_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_O16_to_He4_C12_derived) = drate_dT; } - rate_F18_to_He4_N14_derived(tfactors, rate, drate_dT); + rate_F18_to_He4_N14_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_F18_to_He4_N14_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_F18_to_He4_N14_derived) = drate_dT; } - rate_Ne20_to_He4_O16_derived(tfactors, rate, drate_dT); + rate_Ne20_to_He4_O16_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ne20_to_He4_O16_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ne20_to_He4_O16_derived) = drate_dT; } - rate_Ne21_to_n_Ne20_derived(tfactors, rate, drate_dT); + rate_Ne21_to_n_Ne20_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ne21_to_n_Ne20_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ne21_to_n_Ne20_derived) = drate_dT; } - rate_Na22_to_p_Ne21_derived(tfactors, rate, drate_dT); + rate_Na22_to_p_Ne21_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Na22_to_p_Ne21_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Na22_to_p_Ne21_derived) = drate_dT; } - rate_Na22_to_He4_F18_derived(tfactors, rate, drate_dT); + rate_Na22_to_He4_F18_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Na22_to_He4_F18_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Na22_to_He4_F18_derived) = drate_dT; } - rate_Na23_to_n_Na22_derived(tfactors, rate, drate_dT); + rate_Na23_to_n_Na22_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Na23_to_n_Na22_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Na23_to_n_Na22_derived) = drate_dT; } - rate_Mg24_to_p_Na23_derived(tfactors, rate, drate_dT); + rate_Mg24_to_p_Na23_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Mg24_to_p_Na23_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Mg24_to_p_Na23_derived) = drate_dT; } - rate_Mg24_to_He4_Ne20_derived(tfactors, rate, drate_dT); + rate_Mg24_to_He4_Ne20_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Mg24_to_He4_Ne20_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Mg24_to_He4_Ne20_derived) = drate_dT; } - rate_Si28_to_p_Al27_derived(tfactors, rate, drate_dT); + rate_Si28_to_p_Al27_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Si28_to_p_Al27_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Si28_to_p_Al27_derived) = drate_dT; } - rate_Si28_to_He4_Mg24_derived(tfactors, rate, drate_dT); + rate_Si28_to_He4_Mg24_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Si28_to_He4_Mg24_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Si28_to_He4_Mg24_derived) = drate_dT; } - rate_S32_to_p_P31_derived(tfactors, rate, drate_dT); + rate_S32_to_p_P31_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_S32_to_p_P31_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_S32_to_p_P31_derived) = drate_dT; } - rate_S32_to_He4_Si28_derived(tfactors, rate, drate_dT); + rate_S32_to_He4_Si28_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_S32_to_He4_Si28_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_S32_to_He4_Si28_derived) = drate_dT; } - rate_C12_to_He4_He4_He4_derived(tfactors, rate, drate_dT); + rate_C12_to_He4_He4_He4_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_C12_to_He4_He4_He4_derived) = rate; if constexpr (std::is_same_v) { 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_p_O16_to_He4_N13_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_O16_to_He4_N13_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Ne20_to_p_Na23_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Ne20_to_p_Na23_derived) = rate; if constexpr (std::is_same_v) { 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_p_Ne21_to_He4_F18_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Ne21_to_He4_F18_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_p_Ne21_to_He4_F18_derived) = drate_dT; } - rate_n_Mg24_to_He4_Ne21_derived(tfactors, rate, drate_dT); + rate_n_Mg24_to_He4_Ne21_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_n_Mg24_to_He4_Ne21_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_n_Mg24_to_He4_Ne21_derived) = drate_dT; } - rate_He4_Mg24_to_p_Al27_derived(tfactors, rate, drate_dT); + rate_He4_Mg24_to_p_Al27_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Mg24_to_p_Al27_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Si28_to_p_P31_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Si28_to_p_P31_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_He4_Si28_to_p_P31_derived) = drate_dT; } - rate_He4_S32_to_p_Cl35_derived_removed(tfactors, rate, drate_dT); + rate_He4_S32_to_p_Cl35_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_S32_to_p_Cl35_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ar36_to_He4_S32_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ar36_to_He4_S32_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ar36_to_p_Cl35_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ar36_to_p_Cl35_derived_removed) = rate; if constexpr (std::is_same_v) { 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_He4_Ar36_to_p_K39_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Ar36_to_p_K39_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ca40_to_He4_Ar36_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ca40_to_He4_Ar36_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ca40_to_p_K39_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ca40_to_p_K39_derived_removed) = rate; if constexpr (std::is_same_v) { 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_He4_Ca40_to_p_Sc43_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Ca40_to_p_Sc43_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ti44_to_He4_Ca40_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ti44_to_He4_Ca40_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ti44_to_p_Sc43_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ti44_to_p_Sc43_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Cr48_to_He4_Ti44_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Cr48_to_He4_Ti44_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Cr48_to_p_V47_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Cr48_to_p_V47_derived_removed) = rate; if constexpr (std::is_same_v) { 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_p_V47_to_He4_Ti44_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_V47_to_He4_Ti44_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_p_V47_to_He4_Ti44_derived_removed) = drate_dT; } - rate_Fe52_to_He4_Cr48_derived_removed(tfactors, rate, drate_dT); + rate_Fe52_to_He4_Cr48_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Fe52_to_He4_Cr48_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Fe52_to_He4_Cr48_derived_removed) = drate_dT; } - rate_Fe52_to_p_Mn51_derived_removed(tfactors, rate, drate_dT); + rate_Fe52_to_p_Mn51_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Fe52_to_p_Mn51_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Fe52_to_p_Mn51_derived_removed) = drate_dT; } - rate_p_Mn51_to_He4_Cr48_derived_removed(tfactors, rate, drate_dT); + rate_p_Mn51_to_He4_Cr48_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Mn51_to_He4_Cr48_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_p_Mn51_to_He4_Cr48_derived_removed) = drate_dT; } - rate_Ni56_to_He4_Fe52_derived_removed(tfactors, rate, drate_dT); + rate_Ni56_to_He4_Fe52_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni56_to_He4_Fe52_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni56_to_He4_Fe52_derived_removed) = drate_dT; } - rate_Ni56_to_p_Co55_derived_removed(tfactors, rate, drate_dT); + rate_Ni56_to_p_Co55_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni56_to_p_Co55_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni56_to_p_Co55_derived_removed) = drate_dT; } - rate_p_Co55_to_He4_Fe52_derived_removed(tfactors, rate, drate_dT); + rate_p_Co55_to_He4_Fe52_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Co55_to_He4_Fe52_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_p_Co55_to_He4_Fe52_derived_removed) = drate_dT; diff --git a/networks/ignition_reaclib/C-burn-simple/partition_functions.H b/networks/ignition_reaclib/C-burn-simple/partition_functions.H index 27b4556435..9076194f88 100644 --- a/networks/ignition_reaclib/C-burn-simple/partition_functions.H +++ b/networks/ignition_reaclib/C-burn-simple/partition_functions.H @@ -66,6 +66,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -88,6 +96,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/ignition_reaclib/URCA-medium/partition_functions.H b/networks/ignition_reaclib/URCA-medium/partition_functions.H index a616e0f888..da024d8205 100644 --- a/networks/ignition_reaclib/URCA-medium/partition_functions.H +++ b/networks/ignition_reaclib/URCA-medium/partition_functions.H @@ -66,6 +66,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -88,6 +96,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/ignition_reaclib/URCA-simple/partition_functions.H b/networks/ignition_reaclib/URCA-simple/partition_functions.H index e2fbfecc0b..c797456d6f 100644 --- a/networks/ignition_reaclib/URCA-simple/partition_functions.H +++ b/networks/ignition_reaclib/URCA-simple/partition_functions.H @@ -66,6 +66,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -88,6 +96,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/nova/partition_functions.H b/networks/nova/partition_functions.H index 454dced3be..a5162644b0 100644 --- a/networks/nova/partition_functions.H +++ b/networks/nova/partition_functions.H @@ -66,6 +66,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -88,6 +96,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/nova2/partition_functions.H b/networks/nova2/partition_functions.H index f4341bce9c..6fe1122bfb 100644 --- a/networks/nova2/partition_functions.H +++ b/networks/nova2/partition_functions.H @@ -66,6 +66,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -88,6 +96,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/partition_test/partition_functions.H b/networks/partition_test/partition_functions.H index 86a39e552d..0082ba8600 100644 --- a/networks/partition_test/partition_functions.H +++ b/networks/partition_test/partition_functions.H @@ -149,6 +149,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -183,6 +191,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/partition_test/reaclib_rates.H b/networks/partition_test/reaclib_rates.H index 1399c8b6f2..b4bb4986ba 100644 --- a/networks/partition_test/reaclib_rates.H +++ b/networks/partition_test/reaclib_rates.H @@ -121,7 +121,7 @@ void rate_He4_Fe52_to_p_Co55(const tf_t& tfactors, amrex::Real& rate, amrex::Rea template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni56_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni56_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni56 --> He4 + Fe52 @@ -152,7 +152,7 @@ void rate_Ni56_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -161,7 +161,7 @@ void rate_Ni56_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = He4_pf * Fe52_pf; amrex::Real z_p = Ni56_pf; @@ -178,7 +178,7 @@ void rate_Ni56_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni56_to_p_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni56_to_p_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni56 --> p + Co55 @@ -209,7 +209,7 @@ void rate_Ni56_to_p_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -218,7 +218,7 @@ void rate_Ni56_to_p_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real z_r = p_pf * Co55_pf; amrex::Real z_p = Ni56_pf; @@ -235,7 +235,7 @@ void rate_Ni56_to_p_Co55_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Co55_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Co55_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co55 + p --> He4 + Fe52 @@ -276,11 +276,11 @@ void rate_p_Co55_to_He4_Fe52_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = He4_pf * Fe52_pf; amrex::Real z_p = p_pf * Co55_pf; @@ -306,6 +306,8 @@ fill_reaclib_rates(const tf_t& tfactors, T& rate_eval) amrex::Real rate; amrex::Real drate_dT; + part_fun::pf_cache_t pf_cache{}; + rate_He4_Fe52_to_Ni56(tfactors, rate, drate_dT); rate_eval.screened_rates(k_He4_Fe52_to_Ni56) = rate; if constexpr (std::is_same_v) { @@ -324,19 +326,19 @@ fill_reaclib_rates(const tf_t& tfactors, T& rate_eval) rate_eval.dscreened_rates_dT(k_He4_Fe52_to_p_Co55) = drate_dT; } - rate_Ni56_to_He4_Fe52_derived(tfactors, rate, drate_dT); + rate_Ni56_to_He4_Fe52_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni56_to_He4_Fe52_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni56_to_He4_Fe52_derived) = drate_dT; } - rate_Ni56_to_p_Co55_derived(tfactors, rate, drate_dT); + rate_Ni56_to_p_Co55_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni56_to_p_Co55_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni56_to_p_Co55_derived) = drate_dT; } - rate_p_Co55_to_He4_Fe52_derived(tfactors, rate, drate_dT); + rate_p_Co55_to_He4_Fe52_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Co55_to_He4_Fe52_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_p_Co55_to_He4_Fe52_derived) = drate_dT; diff --git a/networks/sn160/partition_functions.H b/networks/sn160/partition_functions.H index a38f3a6229..ed59be7fd2 100644 --- a/networks/sn160/partition_functions.H +++ b/networks/sn160/partition_functions.H @@ -66,6 +66,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -88,6 +96,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/subch_approx/partition_functions.H b/networks/subch_approx/partition_functions.H index c1cf9675e9..950f83acae 100644 --- a/networks/subch_approx/partition_functions.H +++ b/networks/subch_approx/partition_functions.H @@ -66,6 +66,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -88,6 +96,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/subch_base/partition_functions.H b/networks/subch_base/partition_functions.H index 7759bec56d..6ce164ed2b 100644 --- a/networks/subch_base/partition_functions.H +++ b/networks/subch_base/partition_functions.H @@ -489,6 +489,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -591,6 +599,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/subch_base/reaclib_rates.H b/networks/subch_base/reaclib_rates.H index a8ada72827..3734a971f3 100644 --- a/networks/subch_base/reaclib_rates.H +++ b/networks/subch_base/reaclib_rates.H @@ -1898,7 +1898,7 @@ void rate_p_Co55_to_Ni56_removed(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_N13_to_p_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_N13_to_p_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // N13 --> p + C12 @@ -1974,7 +1974,7 @@ void rate_N13_to_p_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::R template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // O16 --> He4 + C12 @@ -2032,7 +2032,7 @@ void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real O16_pf, dO16_pf_dT; // interpolating O16 partition function - get_partition_function(O16, tfactors, O16_pf, dO16_pf_dT); + get_partition_function_cached(O16, tfactors, pf_cache, O16_pf, dO16_pf_dT); amrex::Real z_r = He4_pf * C12_pf; amrex::Real z_p = O16_pf; @@ -2049,7 +2049,7 @@ void rate_O16_to_He4_C12_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ne20 --> He4 + O16 @@ -2117,11 +2117,11 @@ void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex amrex::Real O16_pf, dO16_pf_dT; // interpolating O16 partition function - get_partition_function(O16, tfactors, O16_pf, dO16_pf_dT); + get_partition_function_cached(O16, tfactors, pf_cache, O16_pf, dO16_pf_dT); amrex::Real Ne20_pf, dNe20_pf_dT; // interpolating Ne20 partition function - get_partition_function(Ne20, tfactors, Ne20_pf, dNe20_pf_dT); + get_partition_function_cached(Ne20, tfactors, pf_cache, Ne20_pf, dNe20_pf_dT); amrex::Real z_r = He4_pf * O16_pf; amrex::Real z_p = Ne20_pf; @@ -2138,7 +2138,7 @@ void rate_Ne20_to_He4_O16_derived(const tf_t& tfactors, amrex::Real& rate, amrex template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mg24 --> p + Na23 @@ -2201,7 +2201,7 @@ void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Na23_pf, dNa23_pf_dT; // interpolating Na23 partition function - get_partition_function(Na23, tfactors, Na23_pf, dNa23_pf_dT); + get_partition_function_cached(Na23, tfactors, pf_cache, Na23_pf, dNa23_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -2210,7 +2210,7 @@ void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real z_r = p_pf * Na23_pf; amrex::Real z_p = Mg24_pf; @@ -2227,7 +2227,7 @@ void rate_Mg24_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mg24 --> He4 + Ne20 @@ -2310,11 +2310,11 @@ void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real Ne20_pf, dNe20_pf_dT; // interpolating Ne20 partition function - get_partition_function(Ne20, tfactors, Ne20_pf, dNe20_pf_dT); + get_partition_function_cached(Ne20, tfactors, pf_cache, Ne20_pf, dNe20_pf_dT); amrex::Real z_r = He4_pf * Ne20_pf; amrex::Real z_p = Mg24_pf; @@ -2331,7 +2331,7 @@ void rate_Mg24_to_He4_Ne20_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Si28 --> p + Al27 @@ -2401,11 +2401,11 @@ void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex: amrex::Real Al27_pf, dAl27_pf_dT; // interpolating Al27 partition function - get_partition_function(Al27, tfactors, Al27_pf, dAl27_pf_dT); + get_partition_function_cached(Al27, tfactors, pf_cache, Al27_pf, dAl27_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = p_pf * Al27_pf; amrex::Real z_p = Si28_pf; @@ -2422,7 +2422,7 @@ void rate_Si28_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex: template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Si28 --> He4 + Mg24 @@ -2473,11 +2473,11 @@ void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = He4_pf * Mg24_pf; amrex::Real z_p = Si28_pf; @@ -2494,7 +2494,7 @@ void rate_Si28_to_He4_Mg24_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // S32 --> p + P31 @@ -2562,11 +2562,11 @@ void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::R amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real P31_pf, dP31_pf_dT; // interpolating P31 partition function - get_partition_function(P31, tfactors, P31_pf, dP31_pf_dT); + get_partition_function_cached(P31, tfactors, pf_cache, P31_pf, dP31_pf_dT); amrex::Real z_r = p_pf * P31_pf; amrex::Real z_p = S32_pf; @@ -2583,7 +2583,7 @@ void rate_S32_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::R template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // S32 --> He4 + Si28 @@ -2619,11 +2619,11 @@ void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = He4_pf * Si28_pf; amrex::Real z_p = S32_pf; @@ -2640,7 +2640,7 @@ void rate_S32_to_He4_Si28_derived(const tf_t& tfactors, amrex::Real& rate, amrex template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_C12_to_He4_He4_He4_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_C12_to_He4_He4_He4_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // C12 --> He4 + He4 + He4 @@ -2728,7 +2728,7 @@ void rate_C12_to_He4_He4_He4_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // O16 + p --> He4 + N13 @@ -2764,7 +2764,7 @@ void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amre amrex::Real O16_pf, dO16_pf_dT; // interpolating O16 partition function - get_partition_function(O16, tfactors, O16_pf, dO16_pf_dT); + get_partition_function_cached(O16, tfactors, pf_cache, O16_pf, dO16_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -2791,7 +2791,7 @@ void rate_p_O16_to_He4_N13_derived(const tf_t& tfactors, amrex::Real& rate, amre template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ne20 + He4 --> p + Na23 @@ -2856,7 +2856,7 @@ void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Na23_pf, dNa23_pf_dT; // interpolating Na23 partition function - get_partition_function(Na23, tfactors, Na23_pf, dNa23_pf_dT); + get_partition_function_cached(Na23, tfactors, pf_cache, Na23_pf, dNa23_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -2870,7 +2870,7 @@ void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Ne20_pf, dNe20_pf_dT; // interpolating Ne20 partition function - get_partition_function(Ne20, tfactors, Ne20_pf, dNe20_pf_dT); + get_partition_function_cached(Ne20, tfactors, pf_cache, Ne20_pf, dNe20_pf_dT); amrex::Real z_r = p_pf * Na23_pf; amrex::Real z_p = He4_pf * Ne20_pf; @@ -2887,7 +2887,7 @@ void rate_He4_Ne20_to_p_Na23_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mg24 + He4 --> p + Al27 @@ -2957,11 +2957,11 @@ void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, am amrex::Real Al27_pf, dAl27_pf_dT; // interpolating Al27 partition function - get_partition_function(Al27, tfactors, Al27_pf, dAl27_pf_dT); + get_partition_function_cached(Al27, tfactors, pf_cache, Al27_pf, dAl27_pf_dT); amrex::Real Mg24_pf, dMg24_pf_dT; // interpolating Mg24 partition function - get_partition_function(Mg24, tfactors, Mg24_pf, dMg24_pf_dT); + get_partition_function_cached(Mg24, tfactors, pf_cache, Mg24_pf, dMg24_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -2983,7 +2983,7 @@ void rate_He4_Mg24_to_p_Al27_derived(const tf_t& tfactors, amrex::Real& rate, am template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Si28 + He4 --> p + P31 @@ -3058,11 +3058,11 @@ void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amr amrex::Real P31_pf, dP31_pf_dT; // interpolating P31 partition function - get_partition_function(P31, tfactors, P31_pf, dP31_pf_dT); + get_partition_function_cached(P31, tfactors, pf_cache, P31_pf, dP31_pf_dT); amrex::Real Si28_pf, dSi28_pf_dT; // interpolating Si28 partition function - get_partition_function(Si28, tfactors, Si28_pf, dSi28_pf_dT); + get_partition_function_cached(Si28, tfactors, pf_cache, Si28_pf, dSi28_pf_dT); amrex::Real z_r = p_pf * P31_pf; amrex::Real z_p = He4_pf * Si28_pf; @@ -3079,7 +3079,7 @@ void rate_He4_Si28_to_p_P31_derived(const tf_t& tfactors, amrex::Real& rate, amr template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // S32 + He4 --> p + Cl35 @@ -3166,11 +3166,11 @@ void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& r amrex::Real Cl35_pf, dCl35_pf_dT; // interpolating Cl35 partition function - get_partition_function(Cl35, tfactors, Cl35_pf, dCl35_pf_dT); + get_partition_function_cached(Cl35, tfactors, pf_cache, Cl35_pf, dCl35_pf_dT); amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -3192,7 +3192,7 @@ void rate_He4_S32_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& r template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ar36 --> He4 + S32 @@ -3228,11 +3228,11 @@ void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rat amrex::Real S32_pf, dS32_pf_dT; // interpolating S32 partition function - get_partition_function(S32, tfactors, S32_pf, dS32_pf_dT); + get_partition_function_cached(S32, tfactors, pf_cache, S32_pf, dS32_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real z_r = He4_pf * S32_pf; amrex::Real z_p = Ar36_pf; @@ -3249,7 +3249,7 @@ void rate_Ar36_to_He4_S32_derived_removed(const tf_t& tfactors, amrex::Real& rat template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ar36 --> p + Cl35 @@ -3332,11 +3332,11 @@ void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Cl35_pf, dCl35_pf_dT; // interpolating Cl35 partition function - get_partition_function(Cl35, tfactors, Cl35_pf, dCl35_pf_dT); + get_partition_function_cached(Cl35, tfactors, pf_cache, Cl35_pf, dCl35_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real z_r = p_pf * Cl35_pf; amrex::Real z_p = Ar36_pf; @@ -3353,7 +3353,7 @@ void rate_Ar36_to_p_Cl35_derived_removed(const tf_t& tfactors, amrex::Real& rate template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ar36 + He4 --> p + K39 @@ -3389,11 +3389,11 @@ void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& r amrex::Real K39_pf, dK39_pf_dT; // interpolating K39 partition function - get_partition_function(K39, tfactors, K39_pf, dK39_pf_dT); + get_partition_function_cached(K39, tfactors, pf_cache, K39_pf, dK39_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -3415,7 +3415,7 @@ void rate_He4_Ar36_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& r template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ca40 --> He4 + Ar36 @@ -3451,11 +3451,11 @@ void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real Ar36_pf, dAr36_pf_dT; // interpolating Ar36 partition function - get_partition_function(Ar36, tfactors, Ar36_pf, dAr36_pf_dT); + get_partition_function_cached(Ar36, tfactors, pf_cache, Ar36_pf, dAr36_pf_dT); amrex::Real z_r = He4_pf * Ar36_pf; amrex::Real z_p = Ca40_pf; @@ -3472,7 +3472,7 @@ void rate_Ca40_to_He4_Ar36_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ca40 --> p + K39 @@ -3542,11 +3542,11 @@ void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real K39_pf, dK39_pf_dT; // interpolating K39 partition function - get_partition_function(K39, tfactors, K39_pf, dK39_pf_dT); + get_partition_function_cached(K39, tfactors, pf_cache, K39_pf, dK39_pf_dT); amrex::Real z_r = p_pf * K39_pf; amrex::Real z_p = Ca40_pf; @@ -3563,7 +3563,7 @@ void rate_Ca40_to_p_K39_derived_removed(const tf_t& tfactors, amrex::Real& rate, template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ca40 + He4 --> p + Sc43 @@ -3599,7 +3599,7 @@ void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -3608,7 +3608,7 @@ void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Sc43_pf, dSc43_pf_dT; // interpolating Sc43 partition function - get_partition_function(Sc43, tfactors, Sc43_pf, dSc43_pf_dT); + get_partition_function_cached(Sc43, tfactors, pf_cache, Sc43_pf, dSc43_pf_dT); amrex::Real z_r = p_pf * Sc43_pf; amrex::Real z_p = He4_pf * Ca40_pf; @@ -3625,7 +3625,7 @@ void rate_He4_Ca40_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ti44 --> He4 + Ca40 @@ -3661,11 +3661,11 @@ void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Ca40_pf, dCa40_pf_dT; // interpolating Ca40 partition function - get_partition_function(Ca40, tfactors, Ca40_pf, dCa40_pf_dT); + get_partition_function_cached(Ca40, tfactors, pf_cache, Ca40_pf, dCa40_pf_dT); amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real z_r = He4_pf * Ca40_pf; amrex::Real z_p = Ti44_pf; @@ -3682,7 +3682,7 @@ void rate_Ti44_to_He4_Ca40_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ti44 --> p + Sc43 @@ -3718,11 +3718,11 @@ void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real Sc43_pf, dSc43_pf_dT; // interpolating Sc43 partition function - get_partition_function(Sc43, tfactors, Sc43_pf, dSc43_pf_dT); + get_partition_function_cached(Sc43, tfactors, pf_cache, Sc43_pf, dSc43_pf_dT); amrex::Real z_r = p_pf * Sc43_pf; amrex::Real z_p = Ti44_pf; @@ -3739,7 +3739,7 @@ void rate_Ti44_to_p_Sc43_derived_removed(const tf_t& tfactors, amrex::Real& rate template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Cr48 --> He4 + Ti44 @@ -3770,7 +3770,7 @@ void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -3779,7 +3779,7 @@ void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real z_r = He4_pf * Ti44_pf; amrex::Real z_p = Cr48_pf; @@ -3796,7 +3796,7 @@ void rate_Cr48_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Cr48 --> p + V47 @@ -3878,7 +3878,7 @@ void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -3887,7 +3887,7 @@ void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real V47_pf, dV47_pf_dT; // interpolating V47 partition function - get_partition_function(V47, tfactors, V47_pf, dV47_pf_dT); + get_partition_function_cached(V47, tfactors, pf_cache, V47_pf, dV47_pf_dT); amrex::Real z_r = p_pf * V47_pf; amrex::Real z_p = Cr48_pf; @@ -3904,7 +3904,7 @@ void rate_Cr48_to_p_V47_derived_removed(const tf_t& tfactors, amrex::Real& rate, template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_V47_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_V47_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // V47 + p --> He4 + Ti44 @@ -3945,11 +3945,11 @@ void rate_p_V47_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& r amrex::Real V47_pf, dV47_pf_dT; // interpolating V47 partition function - get_partition_function(V47, tfactors, V47_pf, dV47_pf_dT); + get_partition_function_cached(V47, tfactors, pf_cache, V47_pf, dV47_pf_dT); amrex::Real Ti44_pf, dTi44_pf_dT; // interpolating Ti44 partition function - get_partition_function(Ti44, tfactors, Ti44_pf, dTi44_pf_dT); + get_partition_function_cached(Ti44, tfactors, pf_cache, Ti44_pf, dTi44_pf_dT); amrex::Real z_r = He4_pf * Ti44_pf; amrex::Real z_p = p_pf * V47_pf; @@ -3966,7 +3966,7 @@ void rate_p_V47_to_He4_Ti44_derived_removed(const tf_t& tfactors, amrex::Real& r template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Fe52_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Fe52_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe52 --> He4 + Cr48 @@ -3997,7 +3997,7 @@ void rate_Fe52_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4006,7 +4006,7 @@ void rate_Fe52_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = He4_pf * Cr48_pf; amrex::Real z_p = Fe52_pf; @@ -4023,7 +4023,7 @@ void rate_Fe52_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Fe52_to_p_Mn51_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Fe52_to_p_Mn51_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Fe52 --> p + Mn51 @@ -4054,7 +4054,7 @@ void rate_Fe52_to_p_Mn51_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Mn51_pf, dMn51_pf_dT; // interpolating Mn51 partition function - get_partition_function(Mn51, tfactors, Mn51_pf, dMn51_pf_dT); + get_partition_function_cached(Mn51, tfactors, pf_cache, Mn51_pf, dMn51_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -4063,7 +4063,7 @@ void rate_Fe52_to_p_Mn51_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = p_pf * Mn51_pf; amrex::Real z_p = Fe52_pf; @@ -4080,7 +4080,7 @@ void rate_Fe52_to_p_Mn51_derived_removed(const tf_t& tfactors, amrex::Real& rate template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Mn51_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Mn51_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Mn51 + p --> He4 + Cr48 @@ -4116,7 +4116,7 @@ void rate_p_Mn51_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Cr48_pf, dCr48_pf_dT; // interpolating Cr48 partition function - get_partition_function(Cr48, tfactors, Cr48_pf, dCr48_pf_dT); + get_partition_function_cached(Cr48, tfactors, pf_cache, Cr48_pf, dCr48_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4125,7 +4125,7 @@ void rate_p_Mn51_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Mn51_pf, dMn51_pf_dT; // interpolating Mn51 partition function - get_partition_function(Mn51, tfactors, Mn51_pf, dMn51_pf_dT); + get_partition_function_cached(Mn51, tfactors, pf_cache, Mn51_pf, dMn51_pf_dT); amrex::Real z_r = He4_pf * Cr48_pf; amrex::Real z_p = p_pf * Mn51_pf; @@ -4142,7 +4142,7 @@ void rate_p_Mn51_to_He4_Cr48_derived_removed(const tf_t& tfactors, amrex::Real& template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni56_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni56_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni56 --> He4 + Fe52 @@ -4173,7 +4173,7 @@ void rate_Ni56_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real He4_pf, dHe4_pf_dT; // setting He4 partition function to 1.0 by default, independent of T @@ -4182,7 +4182,7 @@ void rate_Ni56_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& ra amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = He4_pf * Fe52_pf; amrex::Real z_p = Ni56_pf; @@ -4199,7 +4199,7 @@ void rate_Ni56_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& ra template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_Ni56_to_p_Co55_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_Ni56_to_p_Co55_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Ni56 --> p + Co55 @@ -4230,7 +4230,7 @@ void rate_Ni56_to_p_Co55_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Ni56_pf, dNi56_pf_dT; // interpolating Ni56 partition function - get_partition_function(Ni56, tfactors, Ni56_pf, dNi56_pf_dT); + get_partition_function_cached(Ni56, tfactors, pf_cache, Ni56_pf, dNi56_pf_dT); amrex::Real p_pf, dp_pf_dT; // setting p partition function to 1.0 by default, independent of T @@ -4239,7 +4239,7 @@ void rate_Ni56_to_p_Co55_derived_removed(const tf_t& tfactors, amrex::Real& rate amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real z_r = p_pf * Co55_pf; amrex::Real z_p = Ni56_pf; @@ -4256,7 +4256,7 @@ void rate_Ni56_to_p_Co55_derived_removed(const tf_t& tfactors, amrex::Real& rate template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_p_Co55_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT) { +void rate_p_Co55_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& rate, amrex::Real& drate_dT, [[maybe_unused]] part_fun::pf_cache_t& pf_cache) { // Co55 + p --> He4 + Fe52 @@ -4297,11 +4297,11 @@ void rate_p_Co55_to_He4_Fe52_derived_removed(const tf_t& tfactors, amrex::Real& amrex::Real Co55_pf, dCo55_pf_dT; // interpolating Co55 partition function - get_partition_function(Co55, tfactors, Co55_pf, dCo55_pf_dT); + get_partition_function_cached(Co55, tfactors, pf_cache, Co55_pf, dCo55_pf_dT); amrex::Real Fe52_pf, dFe52_pf_dT; // interpolating Fe52 partition function - get_partition_function(Fe52, tfactors, Fe52_pf, dFe52_pf_dT); + get_partition_function_cached(Fe52, tfactors, pf_cache, Fe52_pf, dFe52_pf_dT); amrex::Real z_r = He4_pf * Fe52_pf; amrex::Real z_p = p_pf * Co55_pf; @@ -4555,6 +4555,8 @@ fill_reaclib_rates(const tf_t& tfactors, T& rate_eval) amrex::Real rate; amrex::Real drate_dT; + part_fun::pf_cache_t pf_cache{}; + rate_p_C12_to_N13(tfactors, rate, drate_dT); rate_eval.screened_rates(k_p_C12_to_N13) = rate; if constexpr (std::is_same_v) { @@ -4801,193 +4803,193 @@ fill_reaclib_rates(const tf_t& tfactors, T& rate_eval) rate_eval.dscreened_rates_dT(k_p_Co55_to_Ni56_removed) = drate_dT; } - rate_N13_to_p_C12_derived(tfactors, rate, drate_dT); + rate_N13_to_p_C12_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_N13_to_p_C12_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_N13_to_p_C12_derived) = drate_dT; } - rate_O16_to_He4_C12_derived(tfactors, rate, drate_dT); + rate_O16_to_He4_C12_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_O16_to_He4_C12_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_O16_to_He4_C12_derived) = drate_dT; } - rate_Ne20_to_He4_O16_derived(tfactors, rate, drate_dT); + rate_Ne20_to_He4_O16_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ne20_to_He4_O16_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ne20_to_He4_O16_derived) = drate_dT; } - rate_Mg24_to_p_Na23_derived(tfactors, rate, drate_dT); + rate_Mg24_to_p_Na23_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Mg24_to_p_Na23_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Mg24_to_p_Na23_derived) = drate_dT; } - rate_Mg24_to_He4_Ne20_derived(tfactors, rate, drate_dT); + rate_Mg24_to_He4_Ne20_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Mg24_to_He4_Ne20_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Mg24_to_He4_Ne20_derived) = drate_dT; } - rate_Si28_to_p_Al27_derived(tfactors, rate, drate_dT); + rate_Si28_to_p_Al27_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Si28_to_p_Al27_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Si28_to_p_Al27_derived) = drate_dT; } - rate_Si28_to_He4_Mg24_derived(tfactors, rate, drate_dT); + rate_Si28_to_He4_Mg24_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Si28_to_He4_Mg24_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Si28_to_He4_Mg24_derived) = drate_dT; } - rate_S32_to_p_P31_derived(tfactors, rate, drate_dT); + rate_S32_to_p_P31_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_S32_to_p_P31_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_S32_to_p_P31_derived) = drate_dT; } - rate_S32_to_He4_Si28_derived(tfactors, rate, drate_dT); + rate_S32_to_He4_Si28_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_S32_to_He4_Si28_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_S32_to_He4_Si28_derived) = drate_dT; } - rate_C12_to_He4_He4_He4_derived(tfactors, rate, drate_dT); + rate_C12_to_He4_He4_He4_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_C12_to_He4_He4_He4_derived) = rate; if constexpr (std::is_same_v) { 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_p_O16_to_He4_N13_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_O16_to_He4_N13_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Ne20_to_p_Na23_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Ne20_to_p_Na23_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_He4_Ne20_to_p_Na23_derived) = drate_dT; } - rate_He4_Mg24_to_p_Al27_derived(tfactors, rate, drate_dT); + rate_He4_Mg24_to_p_Al27_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Mg24_to_p_Al27_derived) = rate; if constexpr (std::is_same_v) { 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_He4_Si28_to_p_P31_derived(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Si28_to_p_P31_derived) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_He4_Si28_to_p_P31_derived) = drate_dT; } - rate_He4_S32_to_p_Cl35_derived_removed(tfactors, rate, drate_dT); + rate_He4_S32_to_p_Cl35_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_S32_to_p_Cl35_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ar36_to_He4_S32_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ar36_to_He4_S32_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ar36_to_p_Cl35_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ar36_to_p_Cl35_derived_removed) = rate; if constexpr (std::is_same_v) { 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_He4_Ar36_to_p_K39_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Ar36_to_p_K39_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ca40_to_He4_Ar36_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ca40_to_He4_Ar36_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ca40_to_p_K39_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ca40_to_p_K39_derived_removed) = rate; if constexpr (std::is_same_v) { 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_He4_Ca40_to_p_Sc43_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_He4_Ca40_to_p_Sc43_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ti44_to_He4_Ca40_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ti44_to_He4_Ca40_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Ti44_to_p_Sc43_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ti44_to_p_Sc43_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Cr48_to_He4_Ti44_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Cr48_to_He4_Ti44_derived_removed) = rate; if constexpr (std::is_same_v) { 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_Cr48_to_p_V47_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Cr48_to_p_V47_derived_removed) = rate; if constexpr (std::is_same_v) { 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_p_V47_to_He4_Ti44_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_V47_to_He4_Ti44_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_p_V47_to_He4_Ti44_derived_removed) = drate_dT; } - rate_Fe52_to_He4_Cr48_derived_removed(tfactors, rate, drate_dT); + rate_Fe52_to_He4_Cr48_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Fe52_to_He4_Cr48_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Fe52_to_He4_Cr48_derived_removed) = drate_dT; } - rate_Fe52_to_p_Mn51_derived_removed(tfactors, rate, drate_dT); + rate_Fe52_to_p_Mn51_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Fe52_to_p_Mn51_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Fe52_to_p_Mn51_derived_removed) = drate_dT; } - rate_p_Mn51_to_He4_Cr48_derived_removed(tfactors, rate, drate_dT); + rate_p_Mn51_to_He4_Cr48_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Mn51_to_He4_Cr48_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_p_Mn51_to_He4_Cr48_derived_removed) = drate_dT; } - rate_Ni56_to_He4_Fe52_derived_removed(tfactors, rate, drate_dT); + rate_Ni56_to_He4_Fe52_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni56_to_He4_Fe52_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni56_to_He4_Fe52_derived_removed) = drate_dT; } - rate_Ni56_to_p_Co55_derived_removed(tfactors, rate, drate_dT); + rate_Ni56_to_p_Co55_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_Ni56_to_p_Co55_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_Ni56_to_p_Co55_derived_removed) = drate_dT; } - rate_p_Co55_to_He4_Fe52_derived_removed(tfactors, rate, drate_dT); + rate_p_Co55_to_He4_Fe52_derived_removed(tfactors, rate, drate_dT, pf_cache); rate_eval.screened_rates(k_p_Co55_to_He4_Fe52_derived_removed) = rate; if constexpr (std::is_same_v) { rate_eval.dscreened_rates_dT(k_p_Co55_to_He4_Fe52_derived_removed) = drate_dT; diff --git a/networks/subch_full/partition_functions.H b/networks/subch_full/partition_functions.H index c1cf9675e9..950f83acae 100644 --- a/networks/subch_full/partition_functions.H +++ b/networks/subch_full/partition_functions.H @@ -66,6 +66,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -88,6 +96,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE diff --git a/networks/subch_simple/partition_functions.H b/networks/subch_simple/partition_functions.H index c1cf9675e9..950f83acae 100644 --- a/networks/subch_simple/partition_functions.H +++ b/networks/subch_simple/partition_functions.H @@ -66,6 +66,14 @@ namespace part_fun { } + struct pf_cache_t { + // Store the coefficient and derivative adjacent in memory, as they're + // always accessed at the same time. + // The entries will be default-initialized to zero, which is fine since + // log10(x) is never zero. + amrex::Array2D data{}; + }; + } // main interface @@ -88,6 +96,22 @@ void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactor } +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function_cached(const int inuc, const tf_t& tfactors, + part_fun::pf_cache_t& pf_cache, + amrex::Real& pf, amrex::Real& dpf_dT) { + if (pf_cache.data(inuc, 1) != 0.0_rt) { + // present in cache + amrex::ignore_unused(tfactors); + pf = pf_cache.data(inuc, 1); + dpf_dT = pf_cache.data(inuc, 2); + } else { + get_partition_function(inuc, tfactors, pf, dpf_dT); + pf_cache.data(inuc, 1) = pf; + pf_cache.data(inuc, 2) = dpf_dT; + } +} + // spins AMREX_GPU_HOST_DEVICE AMREX_INLINE