diff --git a/.github/workflows/macos_build_cell_primordial_chem.yml b/.github/workflows/macos_build_cell_primordial_chem.yml index 8d6e64769e..43eee22bbc 100644 --- a/.github/workflows/macos_build_cell_primordial_chem.yml +++ b/.github/workflows/macos_build_cell_primordial_chem.yml @@ -11,7 +11,8 @@ jobs: - name: Install dependencies run: | - brew install cmake openmpi python3 + brew install cmake openmpi python3 || true + brew link --overwrite python@3.11 - name: Compile and run run: | diff --git a/networks/He-C-Fe-group/55co-55fe_electroncapture.dat b/networks/He-C-Fe-group/55co-55fe_electroncapture.dat new file mode 100644 index 0000000000..3d05c44ab4 --- /dev/null +++ b/networks/He-C-Fe-group/55co-55fe_electroncapture.dat @@ -0,0 +1,148 @@ +!55co -> 55fe, e- capture +!Q=-2.9403 MeV +! +!Log(rhoY) Log(temp) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -8.471000 -1.103229e+01 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -8.964000 -1.103229e+01 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -9.106000 -1.103229e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -9.235000 -1.103229e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -8.679000 -1.103229e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -7.399000 -1.102629e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -6.240000 -1.094929e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -5.556000 -1.070929e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -4.648000 -9.893290e+00 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -3.243000 -8.401290e+00 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -1.052000 -6.117290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 4.619000 4.487104e-01 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -7.492000 -1.102829e+01 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -7.965000 -1.103129e+01 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -8.106000 -1.103129e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -8.235000 -1.103229e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -8.266000 -1.103229e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -7.377000 -1.102629e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -6.239000 -1.094929e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -5.556000 -1.070929e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -4.648000 -9.893290e+00 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -3.243000 -8.401290e+00 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -1.052000 -6.117290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 4.619000 4.487104e-01 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -6.622000 -1.099829e+01 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -6.971000 -1.101729e+01 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -7.108000 -1.102129e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -7.235000 -1.102429e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -7.319000 -1.102529e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -7.172000 -1.102229e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -6.224000 -1.094629e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -5.553000 -1.070729e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -4.647000 -9.893290e+00 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -3.243000 -8.401290e+00 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -1.052000 -6.117290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 4.619000 4.487104e-01 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -5.913000 -1.087929e+01 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -6.024000 -1.090929e+01 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -6.128000 -1.093229e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -6.241000 -1.095329e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -6.321000 -1.096429e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -6.354000 -1.096829e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -6.084000 -1.091729e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -5.521000 -1.069129e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -4.642000 -9.889290e+00 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -3.242000 -8.400290e+00 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -1.052000 -6.117290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 4.619000 4.487104e-01 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -5.211000 -1.053529e+01 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -5.218000 -1.053929e+01 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -5.239000 -1.055329e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -5.287000 -1.058229e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -5.337000 -1.061129e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -5.364000 -1.062329e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -5.366000 -1.061729e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -5.239000 -1.052129e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -4.590000 -9.855290e+00 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -3.234000 -8.395290e+00 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -1.051000 -6.116290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 4.619000 4.487104e-01 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -4.399000 -9.845290e+00 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -4.399000 -9.845290e+00 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -4.398000 -9.844290e+00 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -4.398000 -9.843290e+00 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -4.397000 -9.839290e+00 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -4.394000 -9.831290e+00 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -4.380000 -9.810290e+00 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -4.348000 -9.770290e+00 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -4.166000 -9.530290e+00 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -3.152000 -8.343290e+00 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -1.042000 -6.109290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 1.851000 -2.843290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 4.620000 4.487104e-01 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -3.354000 -8.788290e+00 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -3.354000 -8.788290e+00 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -3.353000 -8.787290e+00 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -3.351000 -8.785290e+00 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -3.345000 -8.778290e+00 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -3.335000 -8.766290e+00 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -3.309000 -8.739290e+00 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -3.268000 -8.699290e+00 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -3.126000 -8.557290e+00 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -2.564000 -7.886290e+00 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -0.955000 -6.031290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 1.854000 -2.840290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 4.620000 4.487104e-01 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -1.817000 -7.283290e+00 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -1.816000 -7.283290e+00 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -1.816000 -7.282290e+00 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -1.814000 -7.280290e+00 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -1.807000 -7.274290e+00 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -1.797000 -7.264290e+00 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -1.770000 -7.240290e+00 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -1.729000 -7.204290e+00 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -1.603000 -7.086290e+00 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -1.223000 -6.632290e+00 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -0.324000 -5.441290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 1.885000 -2.809290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 4.620000 4.497104e-01 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 0.654000 -4.759290e+00 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 0.654000 -4.759290e+00 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 0.654000 -4.759290e+00 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 0.655000 -4.758290e+00 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 0.657000 -4.755290e+00 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 0.660000 -4.750290e+00 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 0.667000 -4.738290e+00 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 0.677000 -4.722290e+00 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 0.705000 -4.677290e+00 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 0.789000 -4.538290e+00 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 1.094000 -4.025290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 2.174000 -2.519290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 4.629000 4.587104e-01 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 2.827000 -2.139290e+00 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 2.827000 -2.139290e+00 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 2.827000 -2.139290e+00 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 2.827000 -2.139290e+00 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 2.828000 -2.138290e+00 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 2.828000 -2.138290e+00 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 2.829000 -2.136290e+00 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 2.830000 -2.134290e+00 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 2.833000 -2.128290e+00 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 2.844000 -2.107290e+00 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 2.898000 -2.007290e+00 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 3.270000 -1.386290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 4.711000 5.417104e-01 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 4.688000 1.267104e-01 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 4.688000 1.267104e-01 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 4.688000 1.267104e-01 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 4.688000 1.267104e-01 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 4.689000 1.267104e-01 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 4.689000 1.267104e-01 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 4.689000 1.277104e-01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 4.689000 1.277104e-01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 4.689000 1.287104e-01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 4.691000 1.317104e-01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 4.702000 1.507104e-01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 4.800000 3.217104e-01 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 5.317000 1.161710e+00 -100.00 diff --git a/networks/He-C-Fe-group/55fe-55co_betadecay.dat b/networks/He-C-Fe-group/55fe-55co_betadecay.dat new file mode 100644 index 0000000000..6b66518a29 --- /dev/null +++ b/networks/He-C-Fe-group/55fe-55co_betadecay.dat @@ -0,0 +1,148 @@ +!55fe -> 55co, beta-decay +!Q=2.9403 MeV +! +!Log(rhoY) Log(temp) mu dQ VS Log(beta-decay-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -96.772000 -9.948629e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -52.485000 -5.427829e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -33.018000 -3.484629e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -24.674000 -2.776129e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -17.690000 -2.201029e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -13.998000 -1.891129e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -9.940000 -1.531829e+01 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -6.406000 -1.173529e+01 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -3.762000 -8.319290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -96.772000 -1.004873e+02 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -52.485000 -5.527829e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -33.018000 -3.525929e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -24.674000 -2.778329e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -17.690000 -2.201129e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -13.998000 -1.891129e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -9.940000 -1.531829e+01 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -6.406000 -1.173529e+01 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -3.762000 -8.319290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -96.780000 -1.014913e+02 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -52.488000 -5.627929e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -33.019000 -3.620729e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -24.674000 -2.798929e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -17.690000 -2.202629e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -13.998000 -1.891429e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -9.940000 -1.531929e+01 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -6.406000 -1.173529e+01 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -3.762000 -8.319290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -96.858000 -1.025333e+02 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -52.522000 -5.729529e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -33.028000 -3.721129e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -24.677000 -2.880729e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -17.691000 -2.216429e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -13.998000 -1.894329e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -9.940000 -1.532229e+01 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -6.406000 -1.173529e+01 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -3.762000 -8.319290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -97.567000 -1.039783e+02 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -52.825000 -5.844929e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -33.114000 -3.825929e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -24.710000 -2.980829e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -17.703000 -2.285229e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -14.003000 -1.919329e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -9.942000 -1.535329e+01 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -6.407000 -1.174029e+01 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -3.762000 -8.320290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -54.401000 -6.060929e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -33.677000 -3.964929e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -24.962000 -3.086129e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -17.818000 -2.366429e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -14.070000 -1.982029e+01 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -9.961000 -1.556229e+01 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -6.412000 -1.178529e+01 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -3.763000 -8.328290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 -1.818000 -4.527290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -59.235000 -6.588029e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -35.768000 -4.219829e+01 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -26.201000 -3.251429e+01 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -18.580000 -2.470329e+01 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -14.533000 -2.047229e+01 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -10.152000 -1.592629e+01 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -6.481000 -1.205729e+01 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -3.776000 -8.406290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 -1.819000 -4.530290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 -0.709000 -1.237290e+00 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -72.880000 -7.956929e+01 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -42.934000 -4.942729e+01 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -30.798000 -3.715029e+01 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -21.182000 -2.736129e+01 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -16.256000 -2.232029e+01 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -11.204000 -1.712129e+01 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -7.057000 -1.279529e+01 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -3.940000 -8.962290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 -1.827000 -4.561290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 -0.709000 -1.238290e+00 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 -61.932000 -6.847329e+01 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 -43.926000 -5.031829e+01 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 -29.767000 -3.599629e+01 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 -22.594000 -2.871229e+01 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 -15.315000 -2.128129e+01 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 -9.401000 -1.518829e+01 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 -4.950000 -1.031929e+01 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 -1.920000 -4.853290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 -0.711000 -1.246290e+00 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 -73.707000 -8.010929e+01 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 -49.589000 -5.582629e+01 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 -37.437000 -4.356029e+01 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 -25.181000 -3.114929e+01 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 -15.290000 -2.107529e+01 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 -7.846000 -1.328029e+01 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 -2.660000 -6.053290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 -0.736000 -1.330290e+00 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 -92.618000 -9.885329e+01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 -69.704000 -7.582429e+01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 -46.686000 -5.265029e+01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 -28.188000 -3.396729e+01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 -14.288000 -1.972329e+01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 -4.720000 -8.372290e+00 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 -1.018000 -1.964290e+00 -100.00 diff --git a/networks/He-C-Fe-group/56co-56fe_electroncapture.dat b/networks/He-C-Fe-group/56co-56fe_electroncapture.dat new file mode 100644 index 0000000000..4407bda39e --- /dev/null +++ b/networks/He-C-Fe-group/56co-56fe_electroncapture.dat @@ -0,0 +1,148 @@ +!56co -> 56fe, e- capture +!Q=-4.055 MeV +! +!Log(rhoY) Log(temp) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -9.845000 -1.359829e+01 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -10.330000 -1.360129e+01 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -10.463000 -1.357029e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -10.543000 -1.269229e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -9.823000 -1.190729e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -8.389000 -1.158929e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -7.035000 -1.124329e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -6.195000 -1.068229e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -5.039000 -9.477290e+00 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -3.446000 -8.079290e+00 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -1.241000 -6.190290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 1.752000 -2.941290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -8.866000 -1.357129e+01 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -9.331000 -1.359129e+01 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -9.463000 -1.356429e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -9.543000 -1.269129e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -9.410000 -1.190729e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -8.367000 -1.158929e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -7.034000 -1.124329e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -6.195000 -1.068229e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -5.039000 -9.477290e+00 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -3.446000 -8.079290e+00 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -1.241000 -6.190290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 1.752000 -2.941290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -7.995000 -1.341529e+01 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -8.337000 -1.350629e+01 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -8.465000 -1.350229e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -8.544000 -1.268329e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -8.463000 -1.190529e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -8.161000 -1.158829e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -7.020000 -1.124229e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -6.192000 -1.068229e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -5.039000 -9.477290e+00 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -3.446000 -8.079290e+00 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -1.241000 -6.190290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 1.752000 -2.941290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -7.282000 -1.302429e+01 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -7.388000 -1.309829e+01 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -7.483000 -1.314829e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -7.549000 -1.261229e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -7.465000 -1.188529e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -7.343000 -1.157529e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -6.879000 -1.123529e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -6.161000 -1.067929e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -5.033000 -9.476290e+00 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -3.445000 -8.079290e+00 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -1.241000 -6.190290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 1.752000 -2.941290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -6.561000 -1.240329e+01 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -6.566000 -1.240729e+01 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -6.580000 -1.241729e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -6.584000 -1.223429e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -6.475000 -1.173129e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -6.349000 -1.145429e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -6.159000 -1.114429e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -5.877000 -1.064329e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -4.981000 -9.469290e+00 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -3.437000 -8.077290e+00 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -1.240000 -6.190290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 1.752000 -2.941290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -5.669000 -1.151229e+01 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -5.669000 -1.151029e+01 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -5.666000 -1.150729e+01 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -5.632000 -1.142629e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -5.490000 -1.113829e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -5.347000 -1.091629e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -5.152000 -1.064429e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -4.975000 -1.031029e+01 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -4.556000 -9.385290e+00 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -3.357000 -8.050290e+00 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -1.231000 -6.183290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 1.752000 -2.940290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -4.359000 -1.014129e+01 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -4.358000 -1.014029e+01 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -4.356000 -1.013829e+01 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -4.334000 -1.010029e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -4.236000 -9.941290e+00 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -4.129000 -9.784290e+00 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -3.974000 -9.572290e+00 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -3.829000 -9.359290e+00 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -3.513000 -8.813290e+00 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -2.785000 -7.770290e+00 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -1.145000 -6.111290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 1.755000 -2.937290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 4.567000 3.947104e-01 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -2.447000 -8.087290e+00 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -2.446000 -8.086290e+00 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -2.445000 -8.085290e+00 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -2.438000 -8.073290e+00 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -2.403000 -8.018290e+00 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -2.361000 -7.952290e+00 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -2.289000 -7.849290e+00 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -2.214000 -7.743290e+00 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -2.029000 -7.469290e+00 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -1.539000 -6.764290e+00 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -0.523000 -5.552290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 1.786000 -2.906290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 4.568000 3.957104e-01 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 0.248000 -5.230290e+00 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 0.248000 -5.230290e+00 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 0.249000 -5.229290e+00 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 0.250000 -5.228290e+00 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 0.252000 -5.222290e+00 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 0.256000 -5.213290e+00 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 0.266000 -5.195290e+00 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 0.281000 -5.170290e+00 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 0.324000 -5.099290e+00 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 0.456000 -4.874290e+00 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 0.880000 -4.206290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 2.075000 -2.616290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 4.576000 4.037104e-01 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 2.669000 -2.340290e+00 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 2.669000 -2.340290e+00 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 2.669000 -2.340290e+00 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 2.669000 -2.340290e+00 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 2.669000 -2.340290e+00 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 2.668000 -2.340290e+00 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 2.668000 -2.339290e+00 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 2.669000 -2.337290e+00 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 2.673000 -2.330290e+00 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 2.688000 -2.302290e+00 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 2.759000 -2.169290e+00 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 3.178000 -1.483290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 4.659000 4.867104e-01 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 4.604000 2.371039e-02 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 4.604000 2.371039e-02 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 4.604000 2.371039e-02 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 4.604000 2.371039e-02 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 4.603000 2.371039e-02 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 4.603000 2.271039e-02 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 4.603000 2.271039e-02 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 4.603000 2.271039e-02 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 4.603000 2.371039e-02 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 4.605000 2.771039e-02 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 4.619000 5.271039e-02 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 4.727000 2.397104e-01 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 5.265000 1.107710e+00 -100.00 diff --git a/networks/He-C-Fe-group/56co-56ni_betadecay.dat b/networks/He-C-Fe-group/56co-56ni_betadecay.dat new file mode 100644 index 0000000000..bc7ca8dc68 --- /dev/null +++ b/networks/He-C-Fe-group/56co-56ni_betadecay.dat @@ -0,0 +1,148 @@ +!56co -> 56ni, beta-decay +!Q=1.624 MeV +! +!Log(rhoY) Log(temp) mu dQ VS Log(beta-decay-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -69.759000 -7.612229e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -37.930000 -4.395729e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -24.300000 -2.897729e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -18.824000 -2.366129e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -14.132000 -1.931729e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -11.418000 -1.689029e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -8.606000 -1.416229e+01 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -6.346000 -1.151229e+01 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -4.350000 -8.551290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 -2.008000 -4.678290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -69.759000 -7.612329e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -37.930000 -4.424529e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -24.300000 -2.937629e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -18.824000 -2.368129e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -14.132000 -1.931829e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -11.418000 -1.689129e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -8.606000 -1.416229e+01 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -6.346000 -1.151229e+01 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -4.350000 -8.551290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 -2.008000 -4.678290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -69.760000 -7.612429e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -37.931000 -4.428929e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -24.300000 -3.017529e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -18.824000 -2.387829e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -14.133000 -1.933129e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -11.418000 -1.689329e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -8.606000 -1.416329e+01 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -6.346000 -1.151229e+01 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -4.350000 -8.551290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 -2.008000 -4.678290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -69.773000 -7.614229e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -37.939000 -4.430529e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -24.306000 -3.058529e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -18.827000 -2.458029e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -14.133000 -1.944629e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -11.418000 -1.691229e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -8.607000 -1.416629e+01 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -6.346000 -1.151329e+01 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -4.350000 -8.551290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 -2.008000 -4.678290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -69.870000 -7.627929e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -38.017000 -4.441029e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -24.360000 -3.072629e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -18.864000 -2.506929e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -14.144000 -1.990129e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -11.422000 -1.706829e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -8.608000 -1.419329e+01 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -6.347000 -1.151929e+01 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -4.350000 -8.552290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 -2.008000 -4.678290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -70.529000 -7.717829e+01 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -38.608000 -4.518429e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -24.816000 -3.129129e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -19.180000 -2.548729e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -14.247000 -2.020929e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -11.475000 -1.735229e+01 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -8.633000 -1.437729e+01 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -6.355000 -1.158329e+01 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -4.351000 -8.560290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 -2.008000 -4.679290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -80.670000 -8.774329e+01 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -43.872000 -5.066029e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -27.609000 -3.396729e+01 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -20.521000 -2.667329e+01 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -14.783000 -2.084629e+01 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -11.864000 -1.787129e+01 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -8.894000 -1.480829e+01 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -6.463000 -1.200229e+01 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -4.365000 -8.644290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 -2.009000 -4.682290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 -0.359000 -1.273290e+00 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -57.166000 -6.396229e+01 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -34.496000 -4.105829e+01 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -25.280000 -3.169429e+01 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -17.978000 -2.423329e+01 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -14.249000 -2.039929e+01 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -10.429000 -1.643629e+01 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -7.254000 -1.301329e+01 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -4.537000 -9.249290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 -2.016000 -4.713290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 -0.359000 -1.274290e+00 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 -91.260000 -9.805129e+01 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 -53.829000 -6.038529e+01 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 -38.714000 -4.512229e+01 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 -26.826000 -3.306929e+01 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 -20.801000 -2.693229e+01 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 -14.680000 -2.066129e+01 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 -9.657000 -1.543829e+01 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 -5.530000 -1.070929e+01 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 -2.101000 -5.005290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 -0.361000 -1.283290e+00 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 -96.457000 -1.030123e+02 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 -68.516000 -7.492229e+01 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 -46.653000 -5.289529e+01 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 -35.642000 -4.177129e+01 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 -24.535000 -3.051129e+01 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 -15.521000 -2.129929e+01 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 -8.385000 -1.369229e+01 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 -2.775000 -6.204290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 -0.381000 -1.366290e+00 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 -89.674000 -9.591429e+01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 -67.900000 -7.402629e+01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 -46.031000 -5.200129e+01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 -28.406000 -3.417629e+01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 -14.767000 -2.010129e+01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 -4.615000 -8.507290e+00 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 -0.624000 -2.000290e+00 -100.00 diff --git a/networks/He-C-Fe-group/56fe-56co_betadecay.dat b/networks/He-C-Fe-group/56fe-56co_betadecay.dat new file mode 100644 index 0000000000..630b61dc92 --- /dev/null +++ b/networks/He-C-Fe-group/56fe-56co_betadecay.dat @@ -0,0 +1,148 @@ +!56fe -> 56co, beta-decay +!Q=4.055 MeV +! +!Log(rhoY) Log(temp) mu dQ VS Log(beta-decay-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -66.195000 -6.958329e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -40.317000 -4.373429e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -29.773000 -3.392829e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -21.201000 -2.592829e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -16.597000 -2.162029e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -11.487000 -1.678829e+01 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -6.920000 -1.221529e+01 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -3.437000 -8.200290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -66.195000 -7.058129e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -40.317000 -4.414629e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -29.773000 -3.394929e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -21.201000 -2.592929e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -16.597000 -2.162029e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -11.487000 -1.678829e+01 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -6.920000 -1.221529e+01 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -3.437000 -8.200290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -66.197000 -7.156029e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -40.318000 -4.508829e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -29.773000 -3.415429e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -21.201000 -2.594329e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -16.597000 -2.162329e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -11.487000 -1.678929e+01 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -6.920000 -1.221629e+01 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -3.437000 -8.200290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -66.213000 -7.239829e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -40.327000 -4.603329e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -29.778000 -3.495229e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -21.202000 -2.607829e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -16.597000 -2.165129e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -11.487000 -1.679229e+01 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -6.920000 -1.221629e+01 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -3.437000 -8.200290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -66.363000 -7.293929e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -40.413000 -4.675229e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -29.823000 -3.579129e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -21.219000 -2.672229e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -16.602000 -2.189129e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -11.488000 -1.682529e+01 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -6.920000 -1.222029e+01 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -3.438000 -8.201290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -67.649000 -7.445329e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -41.092000 -4.760029e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -30.179000 -3.646829e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -21.373000 -2.738129e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -16.673000 -2.245629e+01 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -11.505000 -1.704429e+01 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -6.924000 -1.226129e+01 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -3.438000 -8.208290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 -1.450000 -4.328290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -73.046000 -7.985329e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -43.828000 -5.039029e+01 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -31.880000 -3.821729e+01 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -22.204000 -2.828029e+01 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -17.107000 -2.302529e+01 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -11.672000 -1.739629e+01 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -6.975000 -1.248929e+01 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -3.449000 -8.280290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 -1.450000 -4.331290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 -0.583000 -1.107290e+00 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -87.074000 -9.383229e+01 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -51.037000 -5.748829e+01 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -36.358000 -4.265529e+01 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -24.715000 -3.083529e+01 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -18.730000 -2.472029e+01 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -12.543000 -1.837029e+01 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -7.409000 -1.306929e+01 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -3.585000 -8.764290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 -1.458000 -4.362290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 -0.583000 -1.108290e+00 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 -69.155000 -7.570329e+01 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 -48.720000 -5.511629e+01 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 -32.645000 -3.887129e+01 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 -24.497000 -3.060529e+01 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 -16.232000 -2.218229e+01 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 -9.514000 -1.528229e+01 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 -4.522000 -9.984290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 -1.554000 -4.653290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 -0.586000 -1.116290e+00 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 -78.495000 -8.489429e+01 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 -52.454000 -5.868529e+01 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 -39.327000 -4.544229e+01 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 -26.090000 -3.204829e+01 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 -15.401000 -2.117629e+01 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 -7.428000 -1.292829e+01 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 -2.317000 -5.852290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 -0.611000 -1.199290e+00 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 -95.485000 -1.017163e+02 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 -71.597000 -7.771229e+01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 -47.600000 -5.355729e+01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 -28.307000 -3.407929e+01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 -13.887000 -1.938129e+01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 -4.434000 -8.171290e+00 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 -0.899000 -1.833290e+00 -100.00 diff --git a/networks/He-C-Fe-group/56ni-56co_electroncapture.dat b/networks/He-C-Fe-group/56ni-56co_electroncapture.dat new file mode 100644 index 0000000000..71e499bc25 --- /dev/null +++ b/networks/He-C-Fe-group/56ni-56co_electroncapture.dat @@ -0,0 +1,148 @@ +!56ni -> 56co, e- capture +!Q=-1.624 MeV +! +!Log(rhoY) Log(temp) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -8.684000 -1.486129e+01 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -9.164000 -1.533229e+01 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -9.291000 -1.544729e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -9.387000 -1.551729e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -8.777000 -1.485829e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -7.439000 -1.346429e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -6.184000 -1.211329e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -5.406000 -1.124729e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -4.325000 -1.001729e+01 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -2.782000 -8.181290e+00 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -0.691000 -5.723290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 2.011000 -2.678290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -7.705000 -1.388129e+01 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -8.165000 -1.433229e+01 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -8.291000 -1.444829e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -8.387000 -1.451729e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -8.364000 -1.444529e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -7.418000 -1.344329e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -6.182000 -1.211229e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -5.406000 -1.124729e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -4.325000 -1.001729e+01 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -2.782000 -8.181290e+00 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -0.691000 -5.723290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 2.011000 -2.678290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -6.834000 -1.300929e+01 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -7.171000 -1.333829e+01 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -7.293000 -1.344929e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -7.388000 -1.351729e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -7.417000 -1.349729e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -7.212000 -1.323729e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -6.168000 -1.209729e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -5.403000 -1.124429e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -4.324000 -1.001729e+01 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -2.782000 -8.181290e+00 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -0.691000 -5.723290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 2.011000 -2.678290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -6.118000 -1.228929e+01 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -6.220000 -1.238529e+01 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -6.310000 -1.246529e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -6.392000 -1.252029e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -6.418000 -1.249829e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -6.393000 -1.241829e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -6.027000 -1.195629e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -5.372000 -1.121229e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -4.319000 -1.001129e+01 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -2.781000 -8.180290e+00 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -0.691000 -5.723290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 2.011000 -2.678290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -5.384000 -1.153229e+01 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -5.388000 -1.153329e+01 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -5.399000 -1.153829e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -5.421000 -1.153729e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -5.423000 -1.149429e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -5.395000 -1.141429e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -5.305000 -1.123129e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -5.087000 -1.092729e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -4.266000 -9.960290e+00 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -2.773000 -8.174290e+00 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -0.690000 -5.722290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 2.011000 -2.678290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -4.448000 -1.050329e+01 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -4.447000 -1.050129e+01 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -4.444000 -1.049429e+01 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -4.432000 -1.047129e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -4.403000 -1.041229e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -4.363000 -1.033429e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -4.278000 -1.017529e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -4.170000 -9.994290e+00 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -3.834000 -9.531290e+00 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -2.691000 -8.105290e+00 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -0.682000 -5.714290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 2.012000 -2.677290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -3.134000 -8.963290e+00 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -3.134000 -8.962290e+00 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -3.132000 -8.960290e+00 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -3.127000 -8.951290e+00 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -3.113000 -8.927290e+00 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -3.091000 -8.892290e+00 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -3.039000 -8.809290e+00 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -2.964000 -8.700290e+00 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -2.727000 -8.397290e+00 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -2.093000 -7.561290e+00 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -0.595000 -5.637290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 2.015000 -2.674290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 4.728000 5.607104e-01 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -1.311000 -6.966290e+00 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -1.311000 -6.966290e+00 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -1.310000 -6.965290e+00 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -1.305000 -6.960290e+00 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -1.293000 -6.948290e+00 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -1.275000 -6.929290e+00 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -1.232000 -6.883290e+00 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -1.177000 -6.819290e+00 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -1.039000 -6.646290e+00 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -0.719000 -6.191290e+00 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 0.028000 -5.049290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 2.046000 -2.643290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 4.729000 5.607104e-01 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 1.069000 -4.277290e+00 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 1.069000 -4.277290e+00 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 1.069000 -4.277290e+00 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 1.070000 -4.276290e+00 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 1.071000 -4.274290e+00 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 1.073000 -4.270290e+00 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 1.078000 -4.262290e+00 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 1.085000 -4.250290e+00 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 1.104000 -4.217290e+00 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 1.159000 -4.117290e+00 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 1.386000 -3.681290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 2.333000 -2.353290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 4.737000 5.697104e-01 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 3.035000 -1.889290e+00 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 3.034000 -1.889290e+00 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 3.034000 -1.889290e+00 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 3.034000 -1.889290e+00 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 3.035000 -1.888290e+00 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 3.035000 -1.888290e+00 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 3.036000 -1.887290e+00 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 3.037000 -1.885290e+00 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 3.040000 -1.879290e+00 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 3.048000 -1.864290e+00 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 3.084000 -1.782290e+00 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 3.420000 -1.226290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 4.819000 6.527104e-01 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 4.825000 2.827104e-01 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 4.826000 2.827104e-01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 4.826000 2.837104e-01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 4.826000 2.847104e-01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 4.827000 2.867104e-01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 4.831000 2.977104e-01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 4.926000 4.587104e-01 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 5.424000 1.272710e+00 -100.00 diff --git a/networks/He-C-Fe-group/57co-57ni_betadecay.dat b/networks/He-C-Fe-group/57co-57ni_betadecay.dat new file mode 100644 index 0000000000..a61cf7db64 --- /dev/null +++ b/networks/He-C-Fe-group/57co-57ni_betadecay.dat @@ -0,0 +1,148 @@ +!57co -> 57ni, beta-decay +!Q=2.7532 MeV +! +!Log(rhoY) Log(temp) mu dQ VS Log(beta-decay-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -96.775000 -9.530129e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -51.579000 -5.243729e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -32.097000 -3.400129e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -24.151000 -2.730929e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -17.517000 -2.184729e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -13.874000 -1.884529e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -9.905000 -1.529829e+01 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -6.454000 -1.174429e+01 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -3.681000 -8.172290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -96.775000 -9.630129e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -51.579000 -5.343729e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -32.097000 -3.441429e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -24.151000 -2.733029e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -17.517000 -2.184829e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -13.874000 -1.884529e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -9.905000 -1.529829e+01 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -6.454000 -1.174429e+01 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -3.681000 -8.172290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -96.776000 -9.730729e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -51.580000 -5.443929e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -32.098000 -3.536229e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -24.151000 -2.753629e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -17.517000 -2.186229e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -13.875000 -1.884829e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -9.905000 -1.529829e+01 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -6.454000 -1.174429e+01 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -3.681000 -8.172290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -96.793000 -9.836229e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -51.591000 -5.545629e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -32.104000 -3.636529e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -24.155000 -2.835529e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -17.518000 -2.200129e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -13.875000 -1.887629e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -9.905000 -1.530129e+01 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -6.454000 -1.174429e+01 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -3.681000 -8.172290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -96.924000 -9.986529e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -51.686000 -5.661529e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -32.165000 -3.740429e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -24.190000 -2.935429e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -17.530000 -2.268529e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -13.879000 -1.911829e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -9.907000 -1.533329e+01 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -6.454000 -1.174929e+01 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -3.681000 -8.173290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -97.900000 -1.039633e+02 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -52.439000 -5.868429e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -32.666000 -3.875629e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -24.480000 -3.041629e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -17.642000 -2.346829e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -13.936000 -1.968729e+01 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -9.926000 -1.554629e+01 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -6.460000 -1.180029e+01 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -3.682000 -8.181290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 -1.738000 -4.305290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -57.478000 -6.412529e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -35.000000 -4.140829e+01 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -25.767000 -3.203029e+01 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -18.296000 -2.435729e+01 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -14.331000 -2.026929e+01 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -10.130000 -1.594029e+01 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -6.538000 -1.211229e+01 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -3.696000 -8.261290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 -1.739000 -4.308290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 -0.687000 -1.025290e+00 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -70.894000 -7.767829e+01 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -42.039000 -4.854829e+01 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -30.284000 -3.663729e+01 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -20.973000 -2.717229e+01 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -16.218000 -2.231329e+01 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -11.318000 -1.726729e+01 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -7.168000 -1.292229e+01 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -3.867000 -8.831290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 -1.746000 -4.339290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 -0.687000 -1.026290e+00 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 -61.151000 -6.770529e+01 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 -43.563000 -4.996729e+01 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 -29.722000 -3.595829e+01 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 -22.694000 -2.881629e+01 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 -15.514000 -2.148329e+01 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 -9.548000 -1.533329e+01 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 -4.885000 -1.021429e+01 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 -1.837000 -4.631290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 -0.689000 -1.035290e+00 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 -73.334000 -7.973829e+01 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 -49.526000 -5.576429e+01 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 -37.518000 -4.364129e+01 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 -25.359000 -3.132729e+01 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 -15.409000 -2.119129e+01 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 -7.753000 -1.316329e+01 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 -2.554000 -5.832290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 -0.714000 -1.118290e+00 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 -99.999000 -1.057943e+02 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 -92.524000 -9.875729e+01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 -69.750000 -7.586829e+01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 -46.826000 -5.278529e+01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 -28.262000 -3.402729e+01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 -14.133000 -1.954729e+01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 -4.558000 -8.151290e+00 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 -1.004000 -1.753290e+00 -100.00 diff --git a/networks/He-C-Fe-group/57ni-57co_electroncapture.dat b/networks/He-C-Fe-group/57ni-57co_electroncapture.dat new file mode 100644 index 0000000000..6afc604de0 --- /dev/null +++ b/networks/He-C-Fe-group/57ni-57co_electroncapture.dat @@ -0,0 +1,148 @@ +!57ni -> 57co, e- capture +!Q=-2.7532 MeV +! +!Log(rhoY) Log(temp) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -8.322000 -1.175729e+01 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -8.814000 -1.175929e+01 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -8.955000 -1.176029e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -9.083000 -1.176029e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -8.525000 -1.175729e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -7.242000 -1.167529e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -6.073000 -1.107329e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -5.366000 -1.047129e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -4.399000 -9.642290e+00 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -3.016000 -8.268290e+00 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -0.921000 -5.964290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 1.959000 -2.733290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -7.342000 -1.173129e+01 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -7.814000 -1.175029e+01 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -7.955000 -1.175329e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -8.083000 -1.175529e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -8.112000 -1.175429e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -7.221000 -1.167329e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -6.071000 -1.107329e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -5.365000 -1.047129e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -4.399000 -9.642290e+00 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -3.016000 -8.268290e+00 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -0.921000 -5.964290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 1.959000 -2.733290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -6.472000 -1.157729e+01 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -6.821000 -1.166829e+01 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -6.957000 -1.169129e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -7.084000 -1.170729e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -7.165000 -1.171429e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -7.015000 -1.165229e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -6.057000 -1.106929e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -5.362000 -1.047029e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -4.399000 -9.642290e+00 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -3.016000 -8.268290e+00 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -0.921000 -5.964290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 1.959000 -2.733290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -5.763000 -1.119229e+01 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -5.874000 -1.126929e+01 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -5.977000 -1.133529e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -6.090000 -1.140029e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -6.167000 -1.143829e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -6.197000 -1.142429e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -5.916000 -1.102029e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -5.331000 -1.045729e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -4.393000 -9.639290e+00 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -3.015000 -8.267290e+00 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -0.921000 -5.964290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 1.959000 -2.733290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -5.060000 -1.059129e+01 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -5.067000 -1.059829e+01 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -5.087000 -1.061529e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -5.134000 -1.065629e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -5.183000 -1.069429e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -5.207000 -1.070329e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -5.198000 -1.060329e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -5.048000 -1.031329e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -4.341000 -9.605290e+00 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -3.007000 -8.261290e+00 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -0.920000 -5.963290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 1.959000 -2.733290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -4.243000 -9.783290e+00 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -4.243000 -9.783290e+00 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -4.242000 -9.782290e+00 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -4.241000 -9.779290e+00 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -4.239000 -9.772290e+00 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -4.234000 -9.760290e+00 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -4.210000 -9.711290e+00 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -4.156000 -9.610290e+00 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -3.917000 -9.286290e+00 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -2.926000 -8.201290e+00 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -0.911000 -5.956290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 1.959000 -2.732290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -3.181000 -8.674290e+00 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -3.181000 -8.673290e+00 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -3.180000 -8.672290e+00 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -3.178000 -8.669290e+00 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -3.171000 -8.661290e+00 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -3.160000 -8.647290e+00 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -3.128000 -8.607290e+00 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -3.071000 -8.535290e+00 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -2.880000 -8.316290e+00 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -2.338000 -7.703290e+00 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -0.824000 -5.881290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 1.962000 -2.729290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 4.710000 5.407104e-01 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -1.641000 -7.126290e+00 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -1.641000 -7.125290e+00 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -1.640000 -7.125290e+00 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -1.637000 -7.122290e+00 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -1.627000 -7.115290e+00 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -1.613000 -7.104290e+00 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -1.575000 -7.072290e+00 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -1.518000 -7.016290e+00 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -1.362000 -6.847290e+00 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -1.005000 -6.419290e+00 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -0.193000 -5.302290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 1.993000 -2.698290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 4.711000 5.417104e-01 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 0.856000 -4.539290e+00 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 0.856000 -4.539290e+00 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 0.856000 -4.539290e+00 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 0.857000 -4.538290e+00 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 0.858000 -4.535290e+00 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 0.861000 -4.530290e+00 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 0.867000 -4.520290e+00 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 0.874000 -4.506290e+00 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 0.893000 -4.468290e+00 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 0.952000 -4.355290e+00 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 1.217000 -3.895290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 2.281000 -2.408290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 4.720000 5.497104e-01 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 2.953000 -1.999290e+00 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 2.953000 -1.999290e+00 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 2.953000 -1.999290e+00 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 2.953000 -1.999290e+00 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 2.953000 -1.998290e+00 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 2.953000 -1.998290e+00 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 2.954000 -1.997290e+00 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 2.954000 -1.996290e+00 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 2.953000 -1.995290e+00 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 2.952000 -1.987290e+00 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 2.995000 -1.901290e+00 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 3.374000 -1.278290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 4.802000 6.327104e-01 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 4.790000 2.347104e-01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 4.789000 2.337104e-01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 4.786000 2.307104e-01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 4.779000 2.247104e-01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 4.782000 2.357104e-01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 4.894000 4.207104e-01 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 5.407000 1.252710e+00 -100.00 diff --git a/networks/He-C-Fe-group/He-C-Fe-group.png b/networks/He-C-Fe-group/He-C-Fe-group.png new file mode 100644 index 0000000000..6daf1fc36a Binary files /dev/null and b/networks/He-C-Fe-group/He-C-Fe-group.png differ diff --git a/networks/He-C-Fe-group/He-C-Fe-group.py b/networks/He-C-Fe-group/He-C-Fe-group.py new file mode 100644 index 0000000000..e4429b1d1a --- /dev/null +++ b/networks/He-C-Fe-group/He-C-Fe-group.py @@ -0,0 +1,140 @@ +import pynucastro as pyna +from pynucastro.rates import ReacLibRate, TabularRate + +DO_DERIVED_RATES = True + +reaclib_lib = pyna.ReacLibLibrary() +weak_lib = pyna.TabularLibrary() + +# these are the nuclei we have in subch_simple + +all_reactants = ["p", + "he4", "c12", "o16", "ne20", "mg24", "si28", "s32", + "ar36", "ca40", "ti44", "cr48", "fe52", "ni56", + "cu59", "zn60", + "al27", "p31", "cl35", "k39", "sc43", "v47", "mn51", "co55", + "n13", "n14", "f18", "ne21", "na22", "na23"] + +# create a library of ReacLib rates + +core_lib = reaclib_lib.linking_nuclei(all_reactants) + +# in this list, we have the reactants, the actual reactants, +# and modified products that we will use instead + +other_rates = [("c12(c12,n)mg23", "mg24"), + ("o16(o16,n)s31", "s32"), + ("o16(c12,n)si27", "si28")] + +for r, mp in other_rates: + _r = reaclib_lib.get_rate_by_name(r) + _r.modify_products(mp) + core_lib.add_rate(_r) + +# finally, the aprox nets don't include the reverse rates for +# C12+C12, C12+O16, and O16+O16, so remove those + +for r in core_lib.get_rates(): + if sorted(r.products) in [[pyna.Nucleus("c12"), pyna.Nucleus("c12")], + [pyna.Nucleus("c12"), pyna.Nucleus("o16")], + [pyna.Nucleus("o16"), pyna.Nucleus("o16")]]: + core_lib.remove_rate(r) + +# C12+Ne20 and reverse +# (a,g) links between Na23 and Al27 +# (a,g) links between Al27 and P31 + +rates_to_remove = ["p31(p,c12)ne20", + "si28(a,c12)ne20", + "ne20(c12,p)p31", + "ne20(c12,a)si28", + "na23(a,g)al27", + "al27(g,a)na23", + "al27(a,g)p31", + "p31(g,a)al27"] + +for r in rates_to_remove: + print("removing: ", r) + _r = core_lib.get_rate_by_name(r) + core_lib.remove_rate(_r) + +# now create a list of iron group nuclei and find both the +# ReacLib and weak / tabular rates linking these. + +iron_peak = ["n", "p", "he4", + "mn51", "mn55", + "fe52", "fe53", "fe54", "fe55", "fe56", + "co55", "co56", "co57", + "ni56", "ni57", "ni58", + "cu59", "zn60"] + +iron_reaclib = reaclib_lib.linking_nuclei(iron_peak) + +iron_weak_lib = weak_lib.linking_nuclei(iron_peak) + +# add the libraries + +all_lib = core_lib + iron_reaclib + iron_weak_lib + +if DO_DERIVED_RATES: + rates_to_derive = [] + for r in all_lib.get_rates(): + if r.reverse: + # this rate was computed using detailed balance, regardless + # of whether Q < 0 or not. We want to remove it and then + # recompute it + rates_to_derive.append(r) + + # now for each of those derived rates, look to see if the pair exists + + for r in rates_to_derive: + fr = all_lib.get_rate_by_nuclei(r.products, r.reactants) + if fr: + print(f"modifying {r} from {fr}") + all_lib.remove_rate(r) + d = pyna.DerivedRate(rate=fr, compute_Q=False, use_pf=True) + all_lib.add_rate(d) + +# combine all three libraries into a single network + +net = pyna.AmrexAstroCxxNetwork(libraries=[all_lib], + symmetric_screening=False) + +# we will have duplicate rates -- we want to remove any ReacLib rates +# that we have tabular rates for + +dupes = net.find_duplicate_links() + +rates_to_remove = [] +for d in dupes: + for r in d: + if isinstance(r, ReacLibRate): + rates_to_remove.append(r) + +net.remove_rates(rates_to_remove) + +# now we approximate some (alpha, p)(p, gamma) links + +net.make_ap_pg_approx(intermediate_nuclei=["cl35", "k39", "sc43", "v47"]) +net.remove_nuclei(["cl35", "k39", "sc43", "v47"]) + +# let's make a figure + +T = 6.e9 +rho = 9.e7 +comp = pyna.Composition(net.unique_nuclei) +comp.set_all(1.0) +comp.normalize() + +fig = net.plot(rho=rho, T=T, comp=comp, + rotated=True, curved_edges=True, hide_xalpha=True, + size=(1800, 900), + node_size=500, node_shape="s", node_font_size=10) + +fig.savefig("He-C-Fe-group.png") + +print(f"number of nuclei = {len(net.unique_nuclei)}") +print(f"number of ReacLib rates = {len(net.reaclib_rates)}") +print(f"number of tabular rates = {len(net.tabular_rates)}") + +net.write_network() diff --git a/networks/He-C-Fe-group/Make.package b/networks/He-C-Fe-group/Make.package new file mode 100644 index 0000000000..39c65eca7b --- /dev/null +++ b/networks/He-C-Fe-group/Make.package @@ -0,0 +1,14 @@ +CEXE_headers += network_properties.H + +ifeq ($(USE_REACT),TRUE) + CEXE_sources += actual_network_data.cpp + CEXE_headers += actual_network.H + CEXE_headers += tfactors.H + CEXE_headers += partition_functions.H + CEXE_headers += actual_rhs.H + CEXE_headers += reaclib_rates.H + CEXE_headers += table_rates.H + CEXE_sources += table_rates_data.cpp + USE_SCREENING = TRUE + USE_NEUTRINOS = TRUE +endif diff --git a/networks/He-C-Fe-group/README.md b/networks/He-C-Fe-group/README.md new file mode 100644 index 0000000000..66e834cabf --- /dev/null +++ b/networks/He-C-Fe-group/README.md @@ -0,0 +1,7 @@ +# He-C-Fe-group + +This is a network for He and C burning with a heavy emphasis on iron +group. It has the same basic structure as ``subch_approx`` for the +main alpha-chain. At high mass number, a lot of nuclei in the iron +group are added and weak rates from the Langanke tables are used to +link them. Neutrons are only present in the links in the iron group. diff --git a/networks/He-C-Fe-group/_parameters b/networks/He-C-Fe-group/_parameters new file mode 100644 index 0000000000..e7a017d5aa --- /dev/null +++ b/networks/He-C-Fe-group/_parameters @@ -0,0 +1,2 @@ +@namespace: network + diff --git a/networks/He-C-Fe-group/actual_network.H b/networks/He-C-Fe-group/actual_network.H new file mode 100644 index 0000000000..d45a9042df --- /dev/null +++ b/networks/He-C-Fe-group/actual_network.H @@ -0,0 +1,407 @@ +#ifndef actual_network_H +#define actual_network_H + +#include +#include + +#include +#include + +using namespace amrex; + +void actual_network_init(); + +const std::string network_name = "pynucastro-cxx"; + +namespace network +{ + extern AMREX_GPU_MANAGED amrex::Array1D bion; + extern AMREX_GPU_MANAGED amrex::Array1D mion; +} + +namespace Rates +{ + + enum NetworkRates + { + k_p_c12_to_n13 = 1, + k_he4_c12_to_o16 = 2, + k_he4_n14_to_f18 = 3, + k_he4_o16_to_ne20 = 4, + k_he4_f18_to_na22 = 5, + k_he4_ne20_to_mg24 = 6, + k_p_ne21_to_na22 = 7, + k_p_na23_to_mg24 = 8, + k_he4_mg24_to_si28 = 9, + k_p_al27_to_si28 = 10, + k_he4_si28_to_s32 = 11, + k_p_p31_to_s32 = 12, + k_he4_cr48_to_fe52 = 13, + k_p_mn51_to_fe52 = 14, + k_he4_mn51_to_co55 = 15, + k_he4_fe52_to_ni56 = 16, + k_p_co55_to_ni56 = 17, + k_he4_co55_to_cu59 = 18, + k_he4_ni56_to_zn60 = 19, + k_p_cu59_to_zn60 = 20, + k_c12_c12_to_p_na23 = 21, + k_c12_c12_to_he4_ne20 = 22, + k_he4_n13_to_p_o16 = 23, + k_c12_o16_to_p_al27 = 24, + k_c12_o16_to_he4_mg24 = 25, + k_o16_o16_to_p_p31 = 26, + k_o16_o16_to_he4_si28 = 27, + k_he4_f18_to_p_ne21 = 28, + k_p_na23_to_he4_ne20 = 29, + k_p_al27_to_he4_mg24 = 30, + k_p_p31_to_he4_si28 = 31, + k_he4_cr48_to_p_mn51 = 32, + k_he4_fe52_to_p_co55 = 33, + k_p_cu59_to_he4_ni56 = 34, + k_he4_he4_he4_to_c12 = 35, + k_c12_c12_to_mg24_modified = 36, + k_o16_o16_to_s32_modified = 37, + k_c12_o16_to_si28_modified = 38, + k_n_to_p_weak_wc12 = 39, + k_p_mn55_to_fe56 = 40, + k_n_fe52_to_fe53 = 41, + k_n_fe53_to_fe54 = 42, + k_he4_fe53_to_ni57 = 43, + k_n_fe54_to_fe55 = 44, + k_p_fe54_to_co55 = 45, + k_he4_fe54_to_ni58 = 46, + k_n_fe55_to_fe56 = 47, + k_p_fe55_to_co56 = 48, + k_p_fe56_to_co57 = 49, + k_n_co55_to_co56 = 50, + k_n_co56_to_co57 = 51, + k_p_co56_to_ni57 = 52, + k_p_co57_to_ni58 = 53, + k_n_ni56_to_ni57 = 54, + k_n_ni57_to_ni58 = 55, + k_p_ni58_to_cu59 = 56, + k_he4_mn51_to_p_fe54 = 57, + k_he4_fe53_to_p_co56 = 58, + k_n_fe55_to_p_mn55 = 59, + k_n_co55_to_p_fe55 = 60, + k_he4_co55_to_p_ni58 = 61, + k_n_co56_to_p_fe56 = 62, + k_p_co57_to_he4_fe54 = 63, + k_n_ni56_to_p_co56 = 64, + k_n_ni56_to_he4_fe53 = 65, + k_n_ni57_to_p_co57 = 66, + k_n_ni57_to_he4_fe54 = 67, + k_n_ni58_to_he4_fe55 = 68, + k_n_cu59_to_he4_co56 = 69, + k_n_zn60_to_he4_ni57 = 70, + k_he4_s32_to_ar36_removed = 71, + k_p_cl35_to_ar36_removed = 72, + k_p_cl35_to_he4_s32_removed = 73, + k_he4_ar36_to_ca40_removed = 74, + k_p_k39_to_ca40_removed = 75, + k_p_k39_to_he4_ar36_removed = 76, + k_he4_ca40_to_ti44_removed = 77, + k_p_sc43_to_ti44_removed = 78, + k_p_sc43_to_he4_ca40_removed = 79, + k_he4_ti44_to_cr48_removed = 80, + k_he4_ti44_to_p_v47_removed = 81, + k_p_v47_to_cr48_removed = 82, + k_co55_to_fe55 = 83, + k_co56_to_fe56 = 84, + k_co56_to_ni56 = 85, + k_co57_to_ni57 = 86, + k_fe55_to_co55 = 87, + k_fe55_to_mn55 = 88, + k_fe56_to_co56 = 89, + k_mn55_to_fe55 = 90, + k_ni56_to_co56 = 91, + k_ni57_to_co57 = 92, + k_s32_he4_to_ar36_approx = 93, + k_ar36_to_s32_he4_approx = 94, + k_ar36_he4_to_ca40_approx = 95, + k_ca40_to_ar36_he4_approx = 96, + k_ca40_he4_to_ti44_approx = 97, + k_ti44_to_ca40_he4_approx = 98, + k_ti44_he4_to_cr48_approx = 99, + k_cr48_to_ti44_he4_approx = 100, + k_n13_to_p_c12_derived = 101, + k_o16_to_he4_c12_derived = 102, + k_f18_to_he4_n14_derived = 103, + k_ne20_to_he4_o16_derived = 104, + k_na22_to_p_ne21_derived = 105, + k_na22_to_he4_f18_derived = 106, + k_mg24_to_p_na23_derived = 107, + k_mg24_to_he4_ne20_derived = 108, + k_si28_to_p_al27_derived = 109, + k_si28_to_he4_mg24_derived = 110, + k_s32_to_p_p31_derived = 111, + k_s32_to_he4_si28_derived = 112, + k_fe52_to_p_mn51_derived = 113, + k_fe52_to_he4_cr48_derived = 114, + k_co55_to_he4_mn51_derived = 115, + k_ni56_to_p_co55_derived = 116, + k_ni56_to_he4_fe52_derived = 117, + k_cu59_to_he4_co55_derived = 118, + k_zn60_to_p_cu59_derived = 119, + k_zn60_to_he4_ni56_derived = 120, + k_c12_to_he4_he4_he4_derived = 121, + k_p_o16_to_he4_n13_derived = 122, + k_he4_ne20_to_p_na23_derived = 123, + k_p_ne21_to_he4_f18_derived = 124, + k_he4_mg24_to_p_al27_derived = 125, + k_he4_si28_to_p_p31_derived = 126, + k_p_mn51_to_he4_cr48_derived = 127, + k_p_co55_to_he4_fe52_derived = 128, + k_he4_ni56_to_p_cu59_derived = 129, + k_fe53_to_n_fe52_derived = 130, + k_fe54_to_n_fe53_derived = 131, + k_fe55_to_n_fe54_derived = 132, + k_fe56_to_n_fe55_derived = 133, + k_fe56_to_p_mn55_derived = 134, + k_co55_to_p_fe54_derived = 135, + k_co56_to_n_co55_derived = 136, + k_co56_to_p_fe55_derived = 137, + k_co57_to_n_co56_derived = 138, + k_co57_to_p_fe56_derived = 139, + k_ni57_to_n_ni56_derived = 140, + k_ni57_to_p_co56_derived = 141, + k_ni57_to_he4_fe53_derived = 142, + k_ni58_to_n_ni57_derived = 143, + k_ni58_to_p_co57_derived = 144, + k_ni58_to_he4_fe54_derived = 145, + k_cu59_to_p_ni58_derived = 146, + k_p_mn55_to_n_fe55_derived = 147, + k_he4_fe53_to_n_ni56_derived = 148, + k_p_fe54_to_he4_mn51_derived = 149, + k_he4_fe54_to_n_ni57_derived = 150, + k_he4_fe54_to_p_co57_derived = 151, + k_p_fe55_to_n_co55_derived = 152, + k_he4_fe55_to_n_ni58_derived = 153, + k_p_fe56_to_n_co56_derived = 154, + k_p_co56_to_n_ni56_derived = 155, + k_p_co56_to_he4_fe53_derived = 156, + k_he4_co56_to_n_cu59_derived = 157, + k_p_co57_to_n_ni57_derived = 158, + k_he4_ni57_to_n_zn60_derived = 159, + k_p_ni58_to_he4_co55_derived = 160, + k_he4_s32_to_p_cl35_derived_removed = 161, + k_ar36_to_he4_s32_derived_removed = 162, + k_ar36_to_p_cl35_derived_removed = 163, + k_he4_ar36_to_p_k39_derived_removed = 164, + k_ca40_to_he4_ar36_derived_removed = 165, + k_ca40_to_p_k39_derived_removed = 166, + k_he4_ca40_to_p_sc43_derived_removed = 167, + k_ti44_to_he4_ca40_derived_removed = 168, + k_ti44_to_p_sc43_derived_removed = 169, + k_cr48_to_he4_ti44_derived_removed = 170, + k_cr48_to_p_v47_derived_removed = 171, + k_p_v47_to_he4_ti44_derived_removed = 172, + NumRates = k_p_v47_to_he4_ti44_derived_removed + }; + + // number of reaclib rates + + const int NrateReaclib = 154; + + // number of tabular rates + + const int NrateTabular = 10; + + // rate names -- note: the rates are 1-based, not zero-based, so we pad + // this vector with rate_names[0] = "" so the indices line up with the + // NetworkRates enum + + static const std::vector rate_names = { + "", // 0 + "p_c12_to_n13", // 1, + "he4_c12_to_o16", // 2, + "he4_n14_to_f18", // 3, + "he4_o16_to_ne20", // 4, + "he4_f18_to_na22", // 5, + "he4_ne20_to_mg24", // 6, + "p_ne21_to_na22", // 7, + "p_na23_to_mg24", // 8, + "he4_mg24_to_si28", // 9, + "p_al27_to_si28", // 10, + "he4_si28_to_s32", // 11, + "p_p31_to_s32", // 12, + "he4_cr48_to_fe52", // 13, + "p_mn51_to_fe52", // 14, + "he4_mn51_to_co55", // 15, + "he4_fe52_to_ni56", // 16, + "p_co55_to_ni56", // 17, + "he4_co55_to_cu59", // 18, + "he4_ni56_to_zn60", // 19, + "p_cu59_to_zn60", // 20, + "c12_c12_to_p_na23", // 21, + "c12_c12_to_he4_ne20", // 22, + "he4_n13_to_p_o16", // 23, + "c12_o16_to_p_al27", // 24, + "c12_o16_to_he4_mg24", // 25, + "o16_o16_to_p_p31", // 26, + "o16_o16_to_he4_si28", // 27, + "he4_f18_to_p_ne21", // 28, + "p_na23_to_he4_ne20", // 29, + "p_al27_to_he4_mg24", // 30, + "p_p31_to_he4_si28", // 31, + "he4_cr48_to_p_mn51", // 32, + "he4_fe52_to_p_co55", // 33, + "p_cu59_to_he4_ni56", // 34, + "he4_he4_he4_to_c12", // 35, + "c12_c12_to_mg24_modified", // 36, + "o16_o16_to_s32_modified", // 37, + "c12_o16_to_si28_modified", // 38, + "n_to_p_weak_wc12", // 39, + "p_mn55_to_fe56", // 40, + "n_fe52_to_fe53", // 41, + "n_fe53_to_fe54", // 42, + "he4_fe53_to_ni57", // 43, + "n_fe54_to_fe55", // 44, + "p_fe54_to_co55", // 45, + "he4_fe54_to_ni58", // 46, + "n_fe55_to_fe56", // 47, + "p_fe55_to_co56", // 48, + "p_fe56_to_co57", // 49, + "n_co55_to_co56", // 50, + "n_co56_to_co57", // 51, + "p_co56_to_ni57", // 52, + "p_co57_to_ni58", // 53, + "n_ni56_to_ni57", // 54, + "n_ni57_to_ni58", // 55, + "p_ni58_to_cu59", // 56, + "he4_mn51_to_p_fe54", // 57, + "he4_fe53_to_p_co56", // 58, + "n_fe55_to_p_mn55", // 59, + "n_co55_to_p_fe55", // 60, + "he4_co55_to_p_ni58", // 61, + "n_co56_to_p_fe56", // 62, + "p_co57_to_he4_fe54", // 63, + "n_ni56_to_p_co56", // 64, + "n_ni56_to_he4_fe53", // 65, + "n_ni57_to_p_co57", // 66, + "n_ni57_to_he4_fe54", // 67, + "n_ni58_to_he4_fe55", // 68, + "n_cu59_to_he4_co56", // 69, + "n_zn60_to_he4_ni57", // 70, + "he4_s32_to_ar36_removed", // 71, + "p_cl35_to_ar36_removed", // 72, + "p_cl35_to_he4_s32_removed", // 73, + "he4_ar36_to_ca40_removed", // 74, + "p_k39_to_ca40_removed", // 75, + "p_k39_to_he4_ar36_removed", // 76, + "he4_ca40_to_ti44_removed", // 77, + "p_sc43_to_ti44_removed", // 78, + "p_sc43_to_he4_ca40_removed", // 79, + "he4_ti44_to_cr48_removed", // 80, + "he4_ti44_to_p_v47_removed", // 81, + "p_v47_to_cr48_removed", // 82, + "co55_to_fe55", // 83, + "co56_to_fe56", // 84, + "co56_to_ni56", // 85, + "co57_to_ni57", // 86, + "fe55_to_co55", // 87, + "fe55_to_mn55", // 88, + "fe56_to_co56", // 89, + "mn55_to_fe55", // 90, + "ni56_to_co56", // 91, + "ni57_to_co57", // 92, + "s32_he4_to_ar36_approx", // 93, + "ar36_to_s32_he4_approx", // 94, + "ar36_he4_to_ca40_approx", // 95, + "ca40_to_ar36_he4_approx", // 96, + "ca40_he4_to_ti44_approx", // 97, + "ti44_to_ca40_he4_approx", // 98, + "ti44_he4_to_cr48_approx", // 99, + "cr48_to_ti44_he4_approx", // 100, + "n13_to_p_c12_derived", // 101, + "o16_to_he4_c12_derived", // 102, + "f18_to_he4_n14_derived", // 103, + "ne20_to_he4_o16_derived", // 104, + "na22_to_p_ne21_derived", // 105, + "na22_to_he4_f18_derived", // 106, + "mg24_to_p_na23_derived", // 107, + "mg24_to_he4_ne20_derived", // 108, + "si28_to_p_al27_derived", // 109, + "si28_to_he4_mg24_derived", // 110, + "s32_to_p_p31_derived", // 111, + "s32_to_he4_si28_derived", // 112, + "fe52_to_p_mn51_derived", // 113, + "fe52_to_he4_cr48_derived", // 114, + "co55_to_he4_mn51_derived", // 115, + "ni56_to_p_co55_derived", // 116, + "ni56_to_he4_fe52_derived", // 117, + "cu59_to_he4_co55_derived", // 118, + "zn60_to_p_cu59_derived", // 119, + "zn60_to_he4_ni56_derived", // 120, + "c12_to_he4_he4_he4_derived", // 121, + "p_o16_to_he4_n13_derived", // 122, + "he4_ne20_to_p_na23_derived", // 123, + "p_ne21_to_he4_f18_derived", // 124, + "he4_mg24_to_p_al27_derived", // 125, + "he4_si28_to_p_p31_derived", // 126, + "p_mn51_to_he4_cr48_derived", // 127, + "p_co55_to_he4_fe52_derived", // 128, + "he4_ni56_to_p_cu59_derived", // 129, + "fe53_to_n_fe52_derived", // 130, + "fe54_to_n_fe53_derived", // 131, + "fe55_to_n_fe54_derived", // 132, + "fe56_to_n_fe55_derived", // 133, + "fe56_to_p_mn55_derived", // 134, + "co55_to_p_fe54_derived", // 135, + "co56_to_n_co55_derived", // 136, + "co56_to_p_fe55_derived", // 137, + "co57_to_n_co56_derived", // 138, + "co57_to_p_fe56_derived", // 139, + "ni57_to_n_ni56_derived", // 140, + "ni57_to_p_co56_derived", // 141, + "ni57_to_he4_fe53_derived", // 142, + "ni58_to_n_ni57_derived", // 143, + "ni58_to_p_co57_derived", // 144, + "ni58_to_he4_fe54_derived", // 145, + "cu59_to_p_ni58_derived", // 146, + "p_mn55_to_n_fe55_derived", // 147, + "he4_fe53_to_n_ni56_derived", // 148, + "p_fe54_to_he4_mn51_derived", // 149, + "he4_fe54_to_n_ni57_derived", // 150, + "he4_fe54_to_p_co57_derived", // 151, + "p_fe55_to_n_co55_derived", // 152, + "he4_fe55_to_n_ni58_derived", // 153, + "p_fe56_to_n_co56_derived", // 154, + "p_co56_to_n_ni56_derived", // 155, + "p_co56_to_he4_fe53_derived", // 156, + "he4_co56_to_n_cu59_derived", // 157, + "p_co57_to_n_ni57_derived", // 158, + "he4_ni57_to_n_zn60_derived", // 159, + "p_ni58_to_he4_co55_derived", // 160, + "he4_s32_to_p_cl35_derived_removed", // 161, + "ar36_to_he4_s32_derived_removed", // 162, + "ar36_to_p_cl35_derived_removed", // 163, + "he4_ar36_to_p_k39_derived_removed", // 164, + "ca40_to_he4_ar36_derived_removed", // 165, + "ca40_to_p_k39_derived_removed", // 166, + "he4_ca40_to_p_sc43_derived_removed", // 167, + "ti44_to_he4_ca40_derived_removed", // 168, + "ti44_to_p_sc43_derived_removed", // 169, + "cr48_to_he4_ti44_derived_removed", // 170, + "cr48_to_p_v47_derived_removed", // 171, + "p_v47_to_he4_ti44_derived_removed" // 172, + }; + +} + +#ifdef NSE_NET +namespace NSE_INDEX +{ + constexpr int h1_index = 1; + constexpr int n_index = 0; + constexpr int he4_index = 2; + + // Each row corresponds to the rate in NetworkRates enum + // First 3 row indices for reactants, followed by 3 product indices + // last index is the corresponding reverse rate index. + + extern AMREX_GPU_MANAGED amrex::Array2D rate_indices; +} +#endif + +#endif diff --git a/networks/He-C-Fe-group/actual_network_data.cpp b/networks/He-C-Fe-group/actual_network_data.cpp new file mode 100644 index 0000000000..ee6d37c71b --- /dev/null +++ b/networks/He-C-Fe-group/actual_network_data.cpp @@ -0,0 +1,245 @@ +#include + + +namespace network +{ + AMREX_GPU_MANAGED amrex::Array1D bion; + AMREX_GPU_MANAGED amrex::Array1D mion; +} + +#ifdef NSE_NET +namespace NSE_INDEX +{ + AMREX_GPU_MANAGED amrex::Array2D rate_indices { + -1, 1, 3, -1, -1, 4, 101, + -1, 2, 3, -1, -1, 6, 102, + -1, 2, 5, -1, -1, 7, 103, + -1, 2, 6, -1, -1, 8, 104, + -1, 2, 7, -1, -1, 10, 106, + -1, 2, 8, -1, -1, 12, 108, + -1, 1, 9, -1, -1, 10, 105, + -1, 1, 11, -1, -1, 12, 107, + -1, 2, 12, -1, -1, 14, 110, + -1, 1, 13, -1, -1, 14, 109, + -1, 2, 14, -1, -1, 16, 112, + -1, 1, 15, -1, -1, 16, 111, + -1, 2, 20, -1, -1, 23, 114, + -1, 1, 21, -1, -1, 23, 113, + -1, 2, 21, -1, -1, 28, 115, + -1, 2, 23, -1, -1, 31, 117, + -1, 1, 28, -1, -1, 31, 116, + -1, 2, 28, -1, -1, 34, 118, + -1, 2, 31, -1, -1, 35, 120, + -1, 1, 34, -1, -1, 35, 119, + -1, 3, 3, -1, 1, 11, -1, + -1, 3, 3, -1, 2, 8, -1, + -1, 2, 4, -1, 1, 6, 122, + -1, 3, 6, -1, 1, 13, -1, + -1, 3, 6, -1, 2, 12, -1, + -1, 6, 6, -1, 1, 15, -1, + -1, 6, 6, -1, 2, 14, -1, + -1, 2, 7, -1, 1, 9, 124, + -1, 1, 11, -1, 2, 8, 123, + -1, 1, 13, -1, 2, 12, 125, + -1, 1, 15, -1, 2, 14, 126, + -1, 2, 20, -1, 1, 21, 127, + -1, 2, 23, -1, 1, 28, 128, + -1, 1, 34, -1, 2, 31, 129, + 2, 2, 2, -1, -1, 3, 121, + -1, 3, 3, -1, -1, 12, -1, + -1, 6, 6, -1, -1, 16, -1, + -1, 3, 6, -1, -1, 14, -1, + -1, -1, 0, -1, -1, 1, -1, + -1, 1, 22, -1, -1, 27, 134, + -1, 0, 23, -1, -1, 24, 130, + -1, 0, 24, -1, -1, 25, 131, + -1, 2, 24, -1, -1, 32, 142, + -1, 0, 25, -1, -1, 26, 132, + -1, 1, 25, -1, -1, 28, 135, + -1, 2, 25, -1, -1, 33, 145, + -1, 0, 26, -1, -1, 27, 133, + -1, 1, 26, -1, -1, 29, 137, + -1, 1, 27, -1, -1, 30, 139, + -1, 0, 28, -1, -1, 29, 136, + -1, 0, 29, -1, -1, 30, 138, + -1, 1, 29, -1, -1, 32, 141, + -1, 1, 30, -1, -1, 33, 144, + -1, 0, 31, -1, -1, 32, 140, + -1, 0, 32, -1, -1, 33, 143, + -1, 1, 33, -1, -1, 34, 146, + -1, 2, 21, -1, 1, 25, 149, + -1, 2, 24, -1, 1, 29, 156, + -1, 0, 26, -1, 1, 22, 147, + -1, 0, 28, -1, 1, 26, 152, + -1, 2, 28, -1, 1, 33, 160, + -1, 0, 29, -1, 1, 27, 154, + -1, 1, 30, -1, 2, 25, 151, + -1, 0, 31, -1, 1, 29, 155, + -1, 0, 31, -1, 2, 24, 148, + -1, 0, 32, -1, 1, 30, 158, + -1, 0, 32, -1, 2, 25, 150, + -1, 0, 33, -1, 2, 26, 153, + -1, 0, 34, -1, 2, 29, 157, + -1, 0, 35, -1, 2, 32, 159, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, 28, -1, -1, 26, 87, + -1, -1, 29, -1, -1, 27, 89, + -1, -1, 29, -1, -1, 31, -1, + -1, -1, 30, -1, -1, 32, -1, + -1, -1, 26, -1, -1, 28, -1, + -1, -1, 26, -1, -1, 22, 90, + -1, -1, 27, -1, -1, 29, -1, + -1, -1, 22, -1, -1, 26, -1, + -1, -1, 31, -1, -1, 29, 85, + -1, -1, 32, -1, -1, 30, 86, + -1, 2, 16, -1, -1, 17, 94, + -1, -1, 17, -1, 2, 16, -1, + -1, 2, 17, -1, -1, 18, 96, + -1, -1, 18, -1, 2, 17, -1, + -1, 2, 18, -1, -1, 19, 98, + -1, -1, 19, -1, 2, 18, -1, + -1, 2, 19, -1, -1, 20, 100, + -1, -1, 20, -1, 2, 19, -1, + -1, -1, 4, -1, 1, 3, -1, + -1, -1, 6, -1, 2, 3, -1, + -1, -1, 7, -1, 2, 5, -1, + -1, -1, 8, -1, 2, 6, -1, + -1, -1, 10, -1, 1, 9, -1, + -1, -1, 10, -1, 2, 7, -1, + -1, -1, 12, -1, 1, 11, -1, + -1, -1, 12, -1, 2, 8, -1, + -1, -1, 14, -1, 1, 13, -1, + -1, -1, 14, -1, 2, 12, -1, + -1, -1, 16, -1, 1, 15, -1, + -1, -1, 16, -1, 2, 14, -1, + -1, -1, 23, -1, 1, 21, -1, + -1, -1, 23, -1, 2, 20, -1, + -1, -1, 28, -1, 2, 21, -1, + -1, -1, 31, -1, 1, 28, -1, + -1, -1, 31, -1, 2, 23, -1, + -1, -1, 34, -1, 2, 28, -1, + -1, -1, 35, -1, 1, 34, -1, + -1, -1, 35, -1, 2, 31, -1, + -1, -1, 3, 2, 2, 2, -1, + -1, 1, 6, -1, 2, 4, -1, + -1, 2, 8, -1, 1, 11, -1, + -1, 1, 9, -1, 2, 7, -1, + -1, 2, 12, -1, 1, 13, -1, + -1, 2, 14, -1, 1, 15, -1, + -1, 1, 21, -1, 2, 20, -1, + -1, 1, 28, -1, 2, 23, -1, + -1, 2, 31, -1, 1, 34, -1, + -1, -1, 24, -1, 0, 23, -1, + -1, -1, 25, -1, 0, 24, -1, + -1, -1, 26, -1, 0, 25, -1, + -1, -1, 27, -1, 0, 26, -1, + -1, -1, 27, -1, 1, 22, -1, + -1, -1, 28, -1, 1, 25, -1, + -1, -1, 29, -1, 0, 28, -1, + -1, -1, 29, -1, 1, 26, -1, + -1, -1, 30, -1, 0, 29, -1, + -1, -1, 30, -1, 1, 27, -1, + -1, -1, 32, -1, 0, 31, -1, + -1, -1, 32, -1, 1, 29, -1, + -1, -1, 32, -1, 2, 24, -1, + -1, -1, 33, -1, 0, 32, -1, + -1, -1, 33, -1, 1, 30, -1, + -1, -1, 33, -1, 2, 25, -1, + -1, -1, 34, -1, 1, 33, -1, + -1, 1, 22, -1, 0, 26, -1, + -1, 2, 24, -1, 0, 31, -1, + -1, 1, 25, -1, 2, 21, -1, + -1, 2, 25, -1, 0, 32, -1, + -1, 2, 25, -1, 1, 30, -1, + -1, 1, 26, -1, 0, 28, -1, + -1, 2, 26, -1, 0, 33, -1, + -1, 1, 27, -1, 0, 29, -1, + -1, 1, 29, -1, 0, 31, -1, + -1, 1, 29, -1, 2, 24, -1, + -1, 2, 29, -1, 0, 34, -1, + -1, 1, 30, -1, 0, 32, -1, + -1, 2, 32, -1, 0, 35, -1, + -1, 1, 33, -1, 2, 28, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1 + }; +} +#endif + +void actual_network_init() +{ + using namespace Species; + using namespace network; + + // binding energies per nucleon in MeV + amrex::Array1D ebind_per_nucleon; + + ebind_per_nucleon(N) = 0.0_rt; + ebind_per_nucleon(H1) = 0.0_rt; + ebind_per_nucleon(He4) = 7.073915_rt; + ebind_per_nucleon(C12) = 7.680144_rt; + ebind_per_nucleon(N13) = 7.238863_rt; + ebind_per_nucleon(N14) = 7.475613999999999_rt; + ebind_per_nucleon(O16) = 7.976206_rt; + ebind_per_nucleon(F18) = 7.631638_rt; + ebind_per_nucleon(Ne20) = 8.03224_rt; + ebind_per_nucleon(Ne21) = 7.971712999999999_rt; + ebind_per_nucleon(Na22) = 7.915667_rt; + ebind_per_nucleon(Na23) = 8.111493000000001_rt; + ebind_per_nucleon(Mg24) = 8.260709_rt; + ebind_per_nucleon(Al27) = 8.331553_rt; + ebind_per_nucleon(Si28) = 8.447744_rt; + ebind_per_nucleon(P31) = 8.481167_rt; + ebind_per_nucleon(S32) = 8.493129000000001_rt; + ebind_per_nucleon(Ar36) = 8.519909_rt; + ebind_per_nucleon(Ca40) = 8.551303_rt; + ebind_per_nucleon(Ti44) = 8.533520000000001_rt; + ebind_per_nucleon(Cr48) = 8.572269_rt; + ebind_per_nucleon(Mn51) = 8.633772_rt; + ebind_per_nucleon(Mn55) = 8.765022_rt; + ebind_per_nucleon(Fe52) = 8.609574_rt; + ebind_per_nucleon(Fe53) = 8.648799_rt; + ebind_per_nucleon(Fe54) = 8.736381999999999_rt; + ebind_per_nucleon(Fe55) = 8.746595_rt; + ebind_per_nucleon(Fe56) = 8.790353999999999_rt; + ebind_per_nucleon(Co55) = 8.669618_rt; + ebind_per_nucleon(Co56) = 8.694835999999999_rt; + ebind_per_nucleon(Co57) = 8.741882_rt; + ebind_per_nucleon(Ni56) = 8.642779_rt; + ebind_per_nucleon(Ni57) = 8.670933000000002_rt; + ebind_per_nucleon(Ni58) = 8.732059_rt; + ebind_per_nucleon(Cu59) = 8.642_rt; + ebind_per_nucleon(Zn60) = 8.58305_rt; + + // convert to binding energies per nucleus in MeV + for (int i = 1; i <= NumSpec; ++i) { + bion(i) = ebind_per_nucleon(i) * aion[i-1]; + } + + // Set the mass -- this will be in grams + for (int i = 1; i <= NumSpec; ++i) { + mion(i) = (aion[i-1] - zion[i-1]) * C::Legacy::m_n + zion[i-1] * (C::Legacy::m_p + C::Legacy::m_e) - bion(i) * C::Legacy::MeV2gr; + } + +} diff --git a/networks/He-C-Fe-group/actual_rhs.H b/networks/He-C-Fe-group/actual_rhs.H new file mode 100644 index 0000000000..3e0bbfb218 --- /dev/null +++ b/networks/He-C-Fe-group/actual_rhs.H @@ -0,0 +1,2809 @@ +#ifndef actual_rhs_H +#define actual_rhs_H + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace amrex; +using namespace ArrayUtil; + +using namespace Species; +using namespace Rates; + +using namespace rate_tables; + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void ener_gener_rate(T const& dydt, Real& enuc) +{ + + // Computes the instantaneous energy generation rate (from the nuclei) + + // This is basically e = m c**2 + + enuc = 0.0_rt; + + for (int n = 1; n <= NumSpec; ++n) { + enuc += dydt(n) * network::mion(n); + } + + enuc *= C::Legacy::enuc_conv2; +} + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void evaluate_rates(const burn_t& state, T& rate_eval) { + + + // create molar fractions + + Array1D Y; + for (int n = 1; n <= NumSpec; ++n) { + Y(n) = state.xn[n-1] * aion_inv[n-1]; + } + + [[maybe_unused]] Real rhoy = state.rho * state.y_e; + + // Calculate Reaclib rates + + plasma_state_t pstate{}; + fill_plasma_state(pstate, state.T, state.rho, Y); + + tf_t tfactors = evaluate_tfactors(state.T); + + fill_reaclib_rates(tfactors, rate_eval); + + + + // Evaluate screening factors + + Real ratraw, dratraw_dT; + Real scor, dscor_dt; + [[maybe_unused]] Real scor2, dscor2_dt; + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 6.0_rt, 12.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_c12_to_n13); + rate_eval.screened_rates(k_p_c12_to_n13) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_c12_to_n13); + rate_eval.dscreened_rates_dT(k_p_c12_to_n13) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 6.0_rt, 12.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_c12_to_o16); + rate_eval.screened_rates(k_he4_c12_to_o16) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_c12_to_o16); + rate_eval.dscreened_rates_dT(k_he4_c12_to_o16) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 7.0_rt, 14.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_n14_to_f18); + rate_eval.screened_rates(k_he4_n14_to_f18) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_n14_to_f18); + rate_eval.dscreened_rates_dT(k_he4_n14_to_f18) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 8.0_rt, 16.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_o16_to_ne20); + rate_eval.screened_rates(k_he4_o16_to_ne20) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_o16_to_ne20); + rate_eval.dscreened_rates_dT(k_he4_o16_to_ne20) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 9.0_rt, 18.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_f18_to_na22); + rate_eval.screened_rates(k_he4_f18_to_na22) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_f18_to_na22); + rate_eval.dscreened_rates_dT(k_he4_f18_to_na22) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_f18_to_p_ne21); + rate_eval.screened_rates(k_he4_f18_to_p_ne21) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_f18_to_p_ne21); + rate_eval.dscreened_rates_dT(k_he4_f18_to_p_ne21) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 10.0_rt, 20.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ne20_to_mg24); + rate_eval.screened_rates(k_he4_ne20_to_mg24) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ne20_to_mg24); + rate_eval.dscreened_rates_dT(k_he4_ne20_to_mg24) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_ne20_to_p_na23_derived); + rate_eval.screened_rates(k_he4_ne20_to_p_na23_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ne20_to_p_na23_derived); + rate_eval.dscreened_rates_dT(k_he4_ne20_to_p_na23_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 10.0_rt, 21.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_ne21_to_na22); + rate_eval.screened_rates(k_p_ne21_to_na22) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_ne21_to_na22); + rate_eval.dscreened_rates_dT(k_p_ne21_to_na22) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_ne21_to_he4_f18_derived); + rate_eval.screened_rates(k_p_ne21_to_he4_f18_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_ne21_to_he4_f18_derived); + rate_eval.dscreened_rates_dT(k_p_ne21_to_he4_f18_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 11.0_rt, 23.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_na23_to_mg24); + rate_eval.screened_rates(k_p_na23_to_mg24) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_na23_to_mg24); + rate_eval.dscreened_rates_dT(k_p_na23_to_mg24) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_na23_to_he4_ne20); + rate_eval.screened_rates(k_p_na23_to_he4_ne20) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_na23_to_he4_ne20); + rate_eval.dscreened_rates_dT(k_p_na23_to_he4_ne20) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 12.0_rt, 24.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_mg24_to_si28); + rate_eval.screened_rates(k_he4_mg24_to_si28) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_mg24_to_si28); + rate_eval.dscreened_rates_dT(k_he4_mg24_to_si28) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_mg24_to_p_al27_derived); + rate_eval.screened_rates(k_he4_mg24_to_p_al27_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_mg24_to_p_al27_derived); + rate_eval.dscreened_rates_dT(k_he4_mg24_to_p_al27_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 13.0_rt, 27.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_al27_to_si28); + rate_eval.screened_rates(k_p_al27_to_si28) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_al27_to_si28); + rate_eval.dscreened_rates_dT(k_p_al27_to_si28) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_al27_to_he4_mg24); + rate_eval.screened_rates(k_p_al27_to_he4_mg24) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_al27_to_he4_mg24); + rate_eval.dscreened_rates_dT(k_p_al27_to_he4_mg24) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 14.0_rt, 28.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_si28_to_s32); + rate_eval.screened_rates(k_he4_si28_to_s32) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_si28_to_s32); + rate_eval.dscreened_rates_dT(k_he4_si28_to_s32) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_si28_to_p_p31_derived); + rate_eval.screened_rates(k_he4_si28_to_p_p31_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_si28_to_p_p31_derived); + rate_eval.dscreened_rates_dT(k_he4_si28_to_p_p31_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 15.0_rt, 31.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_p31_to_s32); + rate_eval.screened_rates(k_p_p31_to_s32) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_p31_to_s32); + rate_eval.dscreened_rates_dT(k_p_p31_to_s32) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_p31_to_he4_si28); + rate_eval.screened_rates(k_p_p31_to_he4_si28) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_p31_to_he4_si28); + rate_eval.dscreened_rates_dT(k_p_p31_to_he4_si28) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 24.0_rt, 48.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_cr48_to_fe52); + rate_eval.screened_rates(k_he4_cr48_to_fe52) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_cr48_to_fe52); + rate_eval.dscreened_rates_dT(k_he4_cr48_to_fe52) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_cr48_to_p_mn51); + rate_eval.screened_rates(k_he4_cr48_to_p_mn51) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_cr48_to_p_mn51); + rate_eval.dscreened_rates_dT(k_he4_cr48_to_p_mn51) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 25.0_rt, 51.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_mn51_to_fe52); + rate_eval.screened_rates(k_p_mn51_to_fe52) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_mn51_to_fe52); + rate_eval.dscreened_rates_dT(k_p_mn51_to_fe52) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_mn51_to_he4_cr48_derived); + rate_eval.screened_rates(k_p_mn51_to_he4_cr48_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_mn51_to_he4_cr48_derived); + rate_eval.dscreened_rates_dT(k_p_mn51_to_he4_cr48_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 25.0_rt, 51.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_mn51_to_co55); + rate_eval.screened_rates(k_he4_mn51_to_co55) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_mn51_to_co55); + rate_eval.dscreened_rates_dT(k_he4_mn51_to_co55) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_mn51_to_p_fe54); + rate_eval.screened_rates(k_he4_mn51_to_p_fe54) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_mn51_to_p_fe54); + rate_eval.dscreened_rates_dT(k_he4_mn51_to_p_fe54) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 52.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_fe52_to_ni56); + rate_eval.screened_rates(k_he4_fe52_to_ni56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe52_to_ni56); + rate_eval.dscreened_rates_dT(k_he4_fe52_to_ni56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_fe52_to_p_co55); + rate_eval.screened_rates(k_he4_fe52_to_p_co55) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe52_to_p_co55); + rate_eval.dscreened_rates_dT(k_he4_fe52_to_p_co55) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 27.0_rt, 55.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_co55_to_ni56); + rate_eval.screened_rates(k_p_co55_to_ni56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co55_to_ni56); + rate_eval.dscreened_rates_dT(k_p_co55_to_ni56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_co55_to_he4_fe52_derived); + rate_eval.screened_rates(k_p_co55_to_he4_fe52_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co55_to_he4_fe52_derived); + rate_eval.dscreened_rates_dT(k_p_co55_to_he4_fe52_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 27.0_rt, 55.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_co55_to_cu59); + rate_eval.screened_rates(k_he4_co55_to_cu59) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_co55_to_cu59); + rate_eval.dscreened_rates_dT(k_he4_co55_to_cu59) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_co55_to_p_ni58); + rate_eval.screened_rates(k_he4_co55_to_p_ni58) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_co55_to_p_ni58); + rate_eval.dscreened_rates_dT(k_he4_co55_to_p_ni58) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 28.0_rt, 56.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ni56_to_zn60); + rate_eval.screened_rates(k_he4_ni56_to_zn60) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ni56_to_zn60); + rate_eval.dscreened_rates_dT(k_he4_ni56_to_zn60) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_ni56_to_p_cu59_derived); + rate_eval.screened_rates(k_he4_ni56_to_p_cu59_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ni56_to_p_cu59_derived); + rate_eval.dscreened_rates_dT(k_he4_ni56_to_p_cu59_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 29.0_rt, 59.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_cu59_to_zn60); + rate_eval.screened_rates(k_p_cu59_to_zn60) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_cu59_to_zn60); + rate_eval.dscreened_rates_dT(k_p_cu59_to_zn60) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_cu59_to_he4_ni56); + rate_eval.screened_rates(k_p_cu59_to_he4_ni56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_cu59_to_he4_ni56); + rate_eval.dscreened_rates_dT(k_p_cu59_to_he4_ni56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(6.0_rt, 12.0_rt, 6.0_rt, 12.0_rt); + + + static_assert(scn_fac.z1 == 6.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_c12_c12_to_p_na23); + rate_eval.screened_rates(k_c12_c12_to_p_na23) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_c12_to_p_na23); + rate_eval.dscreened_rates_dT(k_c12_c12_to_p_na23) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_c12_c12_to_he4_ne20); + rate_eval.screened_rates(k_c12_c12_to_he4_ne20) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_c12_to_he4_ne20); + rate_eval.dscreened_rates_dT(k_c12_c12_to_he4_ne20) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_c12_c12_to_mg24_modified); + rate_eval.screened_rates(k_c12_c12_to_mg24_modified) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_c12_to_mg24_modified); + rate_eval.dscreened_rates_dT(k_c12_c12_to_mg24_modified) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 7.0_rt, 13.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_n13_to_p_o16); + rate_eval.screened_rates(k_he4_n13_to_p_o16) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_n13_to_p_o16); + rate_eval.dscreened_rates_dT(k_he4_n13_to_p_o16) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(6.0_rt, 12.0_rt, 8.0_rt, 16.0_rt); + + + static_assert(scn_fac.z1 == 6.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_c12_o16_to_p_al27); + rate_eval.screened_rates(k_c12_o16_to_p_al27) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_o16_to_p_al27); + rate_eval.dscreened_rates_dT(k_c12_o16_to_p_al27) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_c12_o16_to_he4_mg24); + rate_eval.screened_rates(k_c12_o16_to_he4_mg24) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_o16_to_he4_mg24); + rate_eval.dscreened_rates_dT(k_c12_o16_to_he4_mg24) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_c12_o16_to_si28_modified); + rate_eval.screened_rates(k_c12_o16_to_si28_modified) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_c12_o16_to_si28_modified); + rate_eval.dscreened_rates_dT(k_c12_o16_to_si28_modified) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(8.0_rt, 16.0_rt, 8.0_rt, 16.0_rt); + + + static_assert(scn_fac.z1 == 8.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_o16_o16_to_p_p31); + rate_eval.screened_rates(k_o16_o16_to_p_p31) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_o16_o16_to_p_p31); + rate_eval.dscreened_rates_dT(k_o16_o16_to_p_p31) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_o16_o16_to_he4_si28); + rate_eval.screened_rates(k_o16_o16_to_he4_si28) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_o16_o16_to_he4_si28); + rate_eval.dscreened_rates_dT(k_o16_o16_to_he4_si28) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_o16_o16_to_s32_modified); + rate_eval.screened_rates(k_o16_o16_to_s32_modified) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_o16_o16_to_s32_modified); + rate_eval.dscreened_rates_dT(k_o16_o16_to_s32_modified) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 2.0_rt, 4.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + + { + constexpr auto scn_fac2 = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 4.0_rt, 8.0_rt); + + + static_assert(scn_fac2.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac2, scor2, dscor2_dt); + + } + + + ratraw = rate_eval.screened_rates(k_he4_he4_he4_to_c12); + rate_eval.screened_rates(k_he4_he4_he4_to_c12) *= scor * scor2; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_he4_he4_to_c12); + rate_eval.dscreened_rates_dT(k_he4_he4_he4_to_c12) = ratraw * (scor * dscor2_dt + dscor_dt * scor2) + dratraw_dT * scor * scor2; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 25.0_rt, 55.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_mn55_to_fe56); + rate_eval.screened_rates(k_p_mn55_to_fe56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_mn55_to_fe56); + rate_eval.dscreened_rates_dT(k_p_mn55_to_fe56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_mn55_to_n_fe55_derived); + rate_eval.screened_rates(k_p_mn55_to_n_fe55_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_mn55_to_n_fe55_derived); + rate_eval.dscreened_rates_dT(k_p_mn55_to_n_fe55_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 53.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_fe53_to_ni57); + rate_eval.screened_rates(k_he4_fe53_to_ni57) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe53_to_ni57); + rate_eval.dscreened_rates_dT(k_he4_fe53_to_ni57) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_fe53_to_p_co56); + rate_eval.screened_rates(k_he4_fe53_to_p_co56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe53_to_p_co56); + rate_eval.dscreened_rates_dT(k_he4_fe53_to_p_co56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_fe53_to_n_ni56_derived); + rate_eval.screened_rates(k_he4_fe53_to_n_ni56_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe53_to_n_ni56_derived); + rate_eval.dscreened_rates_dT(k_he4_fe53_to_n_ni56_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 26.0_rt, 54.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_fe54_to_co55); + rate_eval.screened_rates(k_p_fe54_to_co55) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe54_to_co55); + rate_eval.dscreened_rates_dT(k_p_fe54_to_co55) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_fe54_to_he4_mn51_derived); + rate_eval.screened_rates(k_p_fe54_to_he4_mn51_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe54_to_he4_mn51_derived); + rate_eval.dscreened_rates_dT(k_p_fe54_to_he4_mn51_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 54.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_fe54_to_ni58); + rate_eval.screened_rates(k_he4_fe54_to_ni58) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe54_to_ni58); + rate_eval.dscreened_rates_dT(k_he4_fe54_to_ni58) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_fe54_to_n_ni57_derived); + rate_eval.screened_rates(k_he4_fe54_to_n_ni57_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe54_to_n_ni57_derived); + rate_eval.dscreened_rates_dT(k_he4_fe54_to_n_ni57_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_fe54_to_p_co57_derived); + rate_eval.screened_rates(k_he4_fe54_to_p_co57_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe54_to_p_co57_derived); + rate_eval.dscreened_rates_dT(k_he4_fe54_to_p_co57_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 26.0_rt, 55.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_fe55_to_co56); + rate_eval.screened_rates(k_p_fe55_to_co56) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe55_to_co56); + rate_eval.dscreened_rates_dT(k_p_fe55_to_co56) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_fe55_to_n_co55_derived); + rate_eval.screened_rates(k_p_fe55_to_n_co55_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe55_to_n_co55_derived); + rate_eval.dscreened_rates_dT(k_p_fe55_to_n_co55_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 26.0_rt, 56.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_fe56_to_co57); + rate_eval.screened_rates(k_p_fe56_to_co57) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe56_to_co57); + rate_eval.dscreened_rates_dT(k_p_fe56_to_co57) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_fe56_to_n_co56_derived); + rate_eval.screened_rates(k_p_fe56_to_n_co56_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_fe56_to_n_co56_derived); + rate_eval.dscreened_rates_dT(k_p_fe56_to_n_co56_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 27.0_rt, 56.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_co56_to_ni57); + rate_eval.screened_rates(k_p_co56_to_ni57) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co56_to_ni57); + rate_eval.dscreened_rates_dT(k_p_co56_to_ni57) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_co56_to_n_ni56_derived); + rate_eval.screened_rates(k_p_co56_to_n_ni56_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co56_to_n_ni56_derived); + rate_eval.dscreened_rates_dT(k_p_co56_to_n_ni56_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_co56_to_he4_fe53_derived); + rate_eval.screened_rates(k_p_co56_to_he4_fe53_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co56_to_he4_fe53_derived); + rate_eval.dscreened_rates_dT(k_p_co56_to_he4_fe53_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 27.0_rt, 57.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_co57_to_ni58); + rate_eval.screened_rates(k_p_co57_to_ni58) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co57_to_ni58); + rate_eval.dscreened_rates_dT(k_p_co57_to_ni58) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_co57_to_he4_fe54); + rate_eval.screened_rates(k_p_co57_to_he4_fe54) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co57_to_he4_fe54); + rate_eval.dscreened_rates_dT(k_p_co57_to_he4_fe54) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_co57_to_n_ni57_derived); + rate_eval.screened_rates(k_p_co57_to_n_ni57_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_co57_to_n_ni57_derived); + rate_eval.dscreened_rates_dT(k_p_co57_to_n_ni57_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 28.0_rt, 58.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_ni58_to_cu59); + rate_eval.screened_rates(k_p_ni58_to_cu59) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_ni58_to_cu59); + rate_eval.dscreened_rates_dT(k_p_ni58_to_cu59) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_ni58_to_he4_co55_derived); + rate_eval.screened_rates(k_p_ni58_to_he4_co55_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_ni58_to_he4_co55_derived); + rate_eval.dscreened_rates_dT(k_p_ni58_to_he4_co55_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 8.0_rt, 16.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_o16_to_he4_n13_derived); + rate_eval.screened_rates(k_p_o16_to_he4_n13_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_o16_to_he4_n13_derived); + rate_eval.dscreened_rates_dT(k_p_o16_to_he4_n13_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 26.0_rt, 55.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_fe55_to_n_ni58_derived); + rate_eval.screened_rates(k_he4_fe55_to_n_ni58_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_fe55_to_n_ni58_derived); + rate_eval.dscreened_rates_dT(k_he4_fe55_to_n_ni58_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 27.0_rt, 56.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_co56_to_n_cu59_derived); + rate_eval.screened_rates(k_he4_co56_to_n_cu59_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_co56_to_n_cu59_derived); + rate_eval.dscreened_rates_dT(k_he4_co56_to_n_cu59_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 28.0_rt, 57.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ni57_to_n_zn60_derived); + rate_eval.screened_rates(k_he4_ni57_to_n_zn60_derived) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ni57_to_n_zn60_derived); + rate_eval.dscreened_rates_dT(k_he4_ni57_to_n_zn60_derived) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 16.0_rt, 32.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_s32_to_ar36_removed); + rate_eval.screened_rates(k_he4_s32_to_ar36_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_s32_to_ar36_removed); + rate_eval.dscreened_rates_dT(k_he4_s32_to_ar36_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_s32_to_p_cl35_derived_removed); + rate_eval.screened_rates(k_he4_s32_to_p_cl35_derived_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_s32_to_p_cl35_derived_removed); + rate_eval.dscreened_rates_dT(k_he4_s32_to_p_cl35_derived_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 17.0_rt, 35.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_cl35_to_ar36_removed); + rate_eval.screened_rates(k_p_cl35_to_ar36_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_cl35_to_ar36_removed); + rate_eval.dscreened_rates_dT(k_p_cl35_to_ar36_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_cl35_to_he4_s32_removed); + rate_eval.screened_rates(k_p_cl35_to_he4_s32_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_cl35_to_he4_s32_removed); + rate_eval.dscreened_rates_dT(k_p_cl35_to_he4_s32_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 18.0_rt, 36.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ar36_to_ca40_removed); + rate_eval.screened_rates(k_he4_ar36_to_ca40_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ar36_to_ca40_removed); + rate_eval.dscreened_rates_dT(k_he4_ar36_to_ca40_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_ar36_to_p_k39_derived_removed); + rate_eval.screened_rates(k_he4_ar36_to_p_k39_derived_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ar36_to_p_k39_derived_removed); + rate_eval.dscreened_rates_dT(k_he4_ar36_to_p_k39_derived_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 19.0_rt, 39.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_k39_to_ca40_removed); + rate_eval.screened_rates(k_p_k39_to_ca40_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_k39_to_ca40_removed); + rate_eval.dscreened_rates_dT(k_p_k39_to_ca40_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_k39_to_he4_ar36_removed); + rate_eval.screened_rates(k_p_k39_to_he4_ar36_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_k39_to_he4_ar36_removed); + rate_eval.dscreened_rates_dT(k_p_k39_to_he4_ar36_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 20.0_rt, 40.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ca40_to_ti44_removed); + rate_eval.screened_rates(k_he4_ca40_to_ti44_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ca40_to_ti44_removed); + rate_eval.dscreened_rates_dT(k_he4_ca40_to_ti44_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_ca40_to_p_sc43_derived_removed); + rate_eval.screened_rates(k_he4_ca40_to_p_sc43_derived_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ca40_to_p_sc43_derived_removed); + rate_eval.dscreened_rates_dT(k_he4_ca40_to_p_sc43_derived_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 21.0_rt, 43.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_sc43_to_ti44_removed); + rate_eval.screened_rates(k_p_sc43_to_ti44_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_sc43_to_ti44_removed); + rate_eval.dscreened_rates_dT(k_p_sc43_to_ti44_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_sc43_to_he4_ca40_removed); + rate_eval.screened_rates(k_p_sc43_to_he4_ca40_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_sc43_to_he4_ca40_removed); + rate_eval.dscreened_rates_dT(k_p_sc43_to_he4_ca40_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(2.0_rt, 4.0_rt, 22.0_rt, 44.0_rt); + + + static_assert(scn_fac.z1 == 2.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_he4_ti44_to_cr48_removed); + rate_eval.screened_rates(k_he4_ti44_to_cr48_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ti44_to_cr48_removed); + rate_eval.dscreened_rates_dT(k_he4_ti44_to_cr48_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_he4_ti44_to_p_v47_removed); + rate_eval.screened_rates(k_he4_ti44_to_p_v47_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_he4_ti44_to_p_v47_removed); + rate_eval.dscreened_rates_dT(k_he4_ti44_to_p_v47_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + { + constexpr auto scn_fac = scrn::calculate_screen_factor(1.0_rt, 1.0_rt, 23.0_rt, 47.0_rt); + + + static_assert(scn_fac.z1 == 1.0_rt); + + + actual_screen(pstate, scn_fac, scor, dscor_dt); + } + + + ratraw = rate_eval.screened_rates(k_p_v47_to_cr48_removed); + rate_eval.screened_rates(k_p_v47_to_cr48_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_v47_to_cr48_removed); + rate_eval.dscreened_rates_dT(k_p_v47_to_cr48_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + ratraw = rate_eval.screened_rates(k_p_v47_to_he4_ti44_derived_removed); + rate_eval.screened_rates(k_p_v47_to_he4_ti44_derived_removed) *= scor; + if constexpr (std::is_same::value) { + dratraw_dT = rate_eval.dscreened_rates_dT(k_p_v47_to_he4_ti44_derived_removed); + rate_eval.dscreened_rates_dT(k_p_v47_to_he4_ti44_derived_removed) = ratraw * dscor_dt + dratraw_dT * scor; + } + + + // Fill approximate rates + + fill_approx_rates(tfactors, rate_eval); + + // Calculate tabular rates + + [[maybe_unused]] Real rate, drate_dt, edot_nu, edot_gamma; + + tabular_evaluate(j_co55_fe55_meta, j_co55_fe55_rhoy, j_co55_fe55_temp, j_co55_fe55_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_co55_to_fe55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co55_to_fe55) = drate_dt; + } + rate_eval.add_energy_rate(k_co55_to_fe55) = edot_nu + edot_gamma; + + tabular_evaluate(j_co56_fe56_meta, j_co56_fe56_rhoy, j_co56_fe56_temp, j_co56_fe56_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_co56_to_fe56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co56_to_fe56) = drate_dt; + } + rate_eval.add_energy_rate(k_co56_to_fe56) = edot_nu + edot_gamma; + + tabular_evaluate(j_co56_ni56_meta, j_co56_ni56_rhoy, j_co56_ni56_temp, j_co56_ni56_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_co56_to_ni56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co56_to_ni56) = drate_dt; + } + rate_eval.add_energy_rate(k_co56_to_ni56) = edot_nu + edot_gamma; + + tabular_evaluate(j_co57_ni57_meta, j_co57_ni57_rhoy, j_co57_ni57_temp, j_co57_ni57_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_co57_to_ni57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co57_to_ni57) = drate_dt; + } + rate_eval.add_energy_rate(k_co57_to_ni57) = edot_nu + edot_gamma; + + tabular_evaluate(j_fe55_co55_meta, j_fe55_co55_rhoy, j_fe55_co55_temp, j_fe55_co55_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_fe55_to_co55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe55_to_co55) = drate_dt; + } + rate_eval.add_energy_rate(k_fe55_to_co55) = edot_nu + edot_gamma; + + tabular_evaluate(j_fe55_mn55_meta, j_fe55_mn55_rhoy, j_fe55_mn55_temp, j_fe55_mn55_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_fe55_to_mn55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe55_to_mn55) = drate_dt; + } + rate_eval.add_energy_rate(k_fe55_to_mn55) = edot_nu + edot_gamma; + + tabular_evaluate(j_fe56_co56_meta, j_fe56_co56_rhoy, j_fe56_co56_temp, j_fe56_co56_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_fe56_to_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe56_to_co56) = drate_dt; + } + rate_eval.add_energy_rate(k_fe56_to_co56) = edot_nu + edot_gamma; + + tabular_evaluate(j_mn55_fe55_meta, j_mn55_fe55_rhoy, j_mn55_fe55_temp, j_mn55_fe55_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_mn55_to_fe55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_mn55_to_fe55) = drate_dt; + } + rate_eval.add_energy_rate(k_mn55_to_fe55) = edot_nu + edot_gamma; + + tabular_evaluate(j_ni56_co56_meta, j_ni56_co56_rhoy, j_ni56_co56_temp, j_ni56_co56_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_ni56_to_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni56_to_co56) = drate_dt; + } + rate_eval.add_energy_rate(k_ni56_to_co56) = edot_nu + edot_gamma; + + tabular_evaluate(j_ni57_co57_meta, j_ni57_co57_rhoy, j_ni57_co57_temp, j_ni57_co57_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_ni57_to_co57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni57_to_co57) = drate_dt; + } + rate_eval.add_energy_rate(k_ni57_to_co57) = edot_nu + edot_gamma; + + +} + +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rhs_nuc(const burn_t& state, + Array1D& ydot_nuc, + const Array1D& Y, + const Array1D& screened_rates) { + + using namespace Rates; + + ydot_nuc(N) = + -screened_rates(k_n_to_p_weak_wc12)*Y(N) + + (-screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*Y(N)*state.rho + screened_rates(k_fe53_to_n_fe52_derived)*Y(Fe53)) + + (-screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*Y(N)*state.rho + screened_rates(k_fe54_to_n_fe53_derived)*Y(Fe54)) + + (-screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*Y(N)*state.rho + screened_rates(k_fe55_to_n_fe54_derived)*Y(Fe55)) + + (-screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*Y(N)*state.rho + screened_rates(k_fe56_to_n_fe55_derived)*Y(Fe56)) + + (-screened_rates(k_n_co55_to_co56)*Y(Co55)*Y(N)*state.rho + screened_rates(k_co56_to_n_co55_derived)*Y(Co56)) + + (-screened_rates(k_n_co56_to_co57)*Y(Co56)*Y(N)*state.rho + screened_rates(k_co57_to_n_co56_derived)*Y(Co57)) + + (-screened_rates(k_n_ni56_to_ni57)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_ni57_to_n_ni56_derived)*Y(Ni57)) + + (-screened_rates(k_n_ni57_to_ni58)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_ni58_to_n_ni57_derived)*Y(Ni58)) + + (-screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*Y(N)*state.rho + screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*Y(H1)*state.rho) + + (-screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*Y(N)*state.rho + screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (-screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*Y(N)*state.rho + screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni56_to_p_co56)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*Y(He4)*state.rho) + + (-screened_rates(k_n_ni57_to_p_co57)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (-screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*Y(Ni58)*state.rho + screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*Y(He4)*state.rho) + + (-screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*Y(N)*state.rho + screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*Y(He4)*state.rho) + + (-screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*Y(Zn60)*state.rho + screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*Y(Ni57)*state.rho); + + ydot_nuc(H1) = + (-screened_rates(k_p_c12_to_n13)*Y(C12)*Y(H1)*state.rho + screened_rates(k_n13_to_p_c12_derived)*Y(N13)) + + (-screened_rates(k_p_ne21_to_na22)*Y(Ne21)*Y(H1)*state.rho + screened_rates(k_na22_to_p_ne21_derived)*Y(Na22)) + + (-screened_rates(k_p_na23_to_mg24)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_mg24_to_p_na23_derived)*Y(Mg24)) + + (-screened_rates(k_p_al27_to_si28)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_si28_to_p_al27_derived)*Y(Si28)) + + (-screened_rates(k_p_p31_to_s32)*Y(P31)*Y(H1)*state.rho + screened_rates(k_s32_to_p_p31_derived)*Y(S32)) + + (-screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*Y(H1)*state.rho + screened_rates(k_fe52_to_p_mn51_derived)*Y(Fe52)) + + (-screened_rates(k_p_co55_to_ni56)*Y(Co55)*Y(H1)*state.rho + screened_rates(k_ni56_to_p_co55_derived)*Y(Ni56)) + + (-screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_zn60_to_p_cu59_derived)*Y(Zn60)) + + 0.5*screened_rates(k_c12_c12_to_p_na23)*std::pow(Y(C12), 2)*state.rho + + (screened_rates(k_he4_n13_to_p_o16)*Y(He4)*Y(N13)*state.rho + -screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*Y(H1)*state.rho) + + screened_rates(k_c12_o16_to_p_al27)*Y(C12)*Y(O16)*state.rho + + 0.5*screened_rates(k_o16_o16_to_p_p31)*std::pow(Y(O16), 2)*state.rho + + (screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*Y(He4)*state.rho + -screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*Y(H1)*state.rho) + + (-screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*Y(Ne20)*state.rho) + + (-screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*Y(Mg24)*state.rho) + + (-screened_rates(k_p_p31_to_he4_si28)*Y(P31)*Y(H1)*state.rho + screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*Y(Si28)*state.rho) + + (screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*Y(He4)*state.rho + -screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*Y(H1)*state.rho) + + (screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*Y(He4)*state.rho + -screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (-screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*Y(Ni56)*state.rho) + + screened_rates(k_n_to_p_weak_wc12)*Y(N) + + (-screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*Y(H1)*state.rho + screened_rates(k_fe56_to_p_mn55_derived)*Y(Fe56)) + + (-screened_rates(k_p_fe54_to_co55)*Y(Fe54)*Y(H1)*state.rho + screened_rates(k_co55_to_p_fe54_derived)*Y(Co55)) + + (-screened_rates(k_p_fe55_to_co56)*Y(Fe55)*Y(H1)*state.rho + screened_rates(k_co56_to_p_fe55_derived)*Y(Co56)) + + (-screened_rates(k_p_fe56_to_co57)*Y(Fe56)*Y(H1)*state.rho + screened_rates(k_co57_to_p_fe56_derived)*Y(Co57)) + + (-screened_rates(k_p_co56_to_ni57)*Y(Co56)*Y(H1)*state.rho + screened_rates(k_ni57_to_p_co56_derived)*Y(Ni57)) + + (-screened_rates(k_p_co57_to_ni58)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_ni58_to_p_co57_derived)*Y(Ni58)) + + (-screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*Y(H1)*state.rho + screened_rates(k_cu59_to_p_ni58_derived)*Y(Cu59)) + + (screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*Y(Mn51)*state.rho + -screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*Y(H1)*state.rho) + + (screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*Y(He4)*state.rho + -screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*Y(N)*state.rho + -screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*Y(H1)*state.rho) + + (screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*Y(N)*state.rho + -screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*Y(He4)*state.rho + -screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*Y(N)*state.rho + -screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (-screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_ni56_to_p_co56)*Y(N)*Y(Ni56)*state.rho + -screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_ni57_to_p_co57)*Y(N)*Y(Ni57)*state.rho + -screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*Y(H1)*state.rho); + + ydot_nuc(He4) = + (-screened_rates(k_he4_c12_to_o16)*Y(C12)*Y(He4)*state.rho + screened_rates(k_o16_to_he4_c12_derived)*Y(O16)) + + (-screened_rates(k_he4_n14_to_f18)*Y(He4)*Y(N14)*state.rho + screened_rates(k_f18_to_he4_n14_derived)*Y(F18)) + + (-screened_rates(k_he4_o16_to_ne20)*Y(He4)*Y(O16)*state.rho + screened_rates(k_ne20_to_he4_o16_derived)*Y(Ne20)) + + (-screened_rates(k_he4_f18_to_na22)*Y(F18)*Y(He4)*state.rho + screened_rates(k_na22_to_he4_f18_derived)*Y(Na22)) + + (-screened_rates(k_he4_ne20_to_mg24)*Y(He4)*Y(Ne20)*state.rho + screened_rates(k_mg24_to_he4_ne20_derived)*Y(Mg24)) + + (-screened_rates(k_he4_mg24_to_si28)*Y(He4)*Y(Mg24)*state.rho + screened_rates(k_si28_to_he4_mg24_derived)*Y(Si28)) + + (-screened_rates(k_he4_si28_to_s32)*Y(He4)*Y(Si28)*state.rho + screened_rates(k_s32_to_he4_si28_derived)*Y(S32)) + + (-screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_fe52_to_he4_cr48_derived)*Y(Fe52)) + + (-screened_rates(k_he4_mn51_to_co55)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_co55_to_he4_mn51_derived)*Y(Co55)) + + (-screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_ni56_to_he4_fe52_derived)*Y(Ni56)) + + (-screened_rates(k_he4_co55_to_cu59)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_cu59_to_he4_co55_derived)*Y(Cu59)) + + (-screened_rates(k_he4_ni56_to_zn60)*Y(He4)*Y(Ni56)*state.rho + screened_rates(k_zn60_to_he4_ni56_derived)*Y(Zn60)) + + 0.5*screened_rates(k_c12_c12_to_he4_ne20)*std::pow(Y(C12), 2)*state.rho + + (-screened_rates(k_he4_n13_to_p_o16)*Y(He4)*Y(N13)*state.rho + screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*Y(H1)*state.rho) + + screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*Y(O16)*state.rho + + 0.5*screened_rates(k_o16_o16_to_he4_si28)*std::pow(Y(O16), 2)*state.rho + + (-screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*Y(He4)*state.rho + screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*Y(H1)*state.rho) + + (screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*Y(H1)*state.rho + -screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*Y(Ne20)*state.rho) + + (screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*Y(H1)*state.rho + -screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*Y(Mg24)*state.rho) + + (screened_rates(k_p_p31_to_he4_si28)*Y(P31)*Y(H1)*state.rho + -screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*Y(Si28)*state.rho) + + (-screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*Y(H1)*state.rho) + + (-screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*Y(H1)*state.rho + -screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*Y(Ni56)*state.rho) + + (-0.5*screened_rates(k_he4_he4_he4_to_c12)*std::pow(Y(He4), 3)*std::pow(state.rho, 2) + 3.0*screened_rates(k_c12_to_he4_he4_he4_derived)*Y(C12)) + + (-screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_ni57_to_he4_fe53_derived)*Y(Ni57)) + + (-screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*Y(He4)*state.rho + screened_rates(k_ni58_to_he4_fe54_derived)*Y(Ni58)) + + (-screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*Y(H1)*state.rho) + + (-screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (-screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*Y(H1)*state.rho + -screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*Y(Ni56)*state.rho + -screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*Y(He4)*state.rho) + + (screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*Y(Ni57)*state.rho + -screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*Y(Ni58)*state.rho + -screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*Y(He4)*state.rho) + + (screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*Y(N)*state.rho + -screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*Y(He4)*state.rho) + + (screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*Y(Zn60)*state.rho + -screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*Y(Ni57)*state.rho) + + (-screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*Y(S32)*state.rho + screened_rates(k_ar36_to_s32_he4_approx)*Y(Ar36)) + + (-screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*Y(He4)*state.rho + screened_rates(k_ca40_to_ar36_he4_approx)*Y(Ca40)) + + (-screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*Y(He4)*state.rho + screened_rates(k_ti44_to_ca40_he4_approx)*Y(Ti44)) + + (-screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*Y(Ti44)*state.rho + screened_rates(k_cr48_to_ti44_he4_approx)*Y(Cr48)); + + ydot_nuc(C12) = + (-screened_rates(k_p_c12_to_n13)*Y(C12)*Y(H1)*state.rho + screened_rates(k_n13_to_p_c12_derived)*Y(N13)) + + (-screened_rates(k_he4_c12_to_o16)*Y(C12)*Y(He4)*state.rho + screened_rates(k_o16_to_he4_c12_derived)*Y(O16)) + + -screened_rates(k_c12_c12_to_p_na23)*std::pow(Y(C12), 2)*state.rho + + -screened_rates(k_c12_c12_to_he4_ne20)*std::pow(Y(C12), 2)*state.rho + + -screened_rates(k_c12_o16_to_p_al27)*Y(C12)*Y(O16)*state.rho + + -screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*Y(O16)*state.rho + + (0.16666666666666667*screened_rates(k_he4_he4_he4_to_c12)*std::pow(Y(He4), 3)*std::pow(state.rho, 2) + -screened_rates(k_c12_to_he4_he4_he4_derived)*Y(C12)) + + -screened_rates(k_c12_c12_to_mg24_modified)*std::pow(Y(C12), 2)*state.rho + + -screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*Y(O16)*state.rho; + + ydot_nuc(N13) = + (screened_rates(k_p_c12_to_n13)*Y(C12)*Y(H1)*state.rho + -screened_rates(k_n13_to_p_c12_derived)*Y(N13)) + + (-screened_rates(k_he4_n13_to_p_o16)*Y(He4)*Y(N13)*state.rho + screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*Y(H1)*state.rho); + + ydot_nuc(N14) = + (-screened_rates(k_he4_n14_to_f18)*Y(He4)*Y(N14)*state.rho + screened_rates(k_f18_to_he4_n14_derived)*Y(F18)); + + ydot_nuc(O16) = + (screened_rates(k_he4_c12_to_o16)*Y(C12)*Y(He4)*state.rho + -screened_rates(k_o16_to_he4_c12_derived)*Y(O16)) + + (-screened_rates(k_he4_o16_to_ne20)*Y(He4)*Y(O16)*state.rho + screened_rates(k_ne20_to_he4_o16_derived)*Y(Ne20)) + + (screened_rates(k_he4_n13_to_p_o16)*Y(He4)*Y(N13)*state.rho + -screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*Y(H1)*state.rho) + + -screened_rates(k_c12_o16_to_p_al27)*Y(C12)*Y(O16)*state.rho + + -screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*Y(O16)*state.rho + + -screened_rates(k_o16_o16_to_p_p31)*std::pow(Y(O16), 2)*state.rho + + -screened_rates(k_o16_o16_to_he4_si28)*std::pow(Y(O16), 2)*state.rho + + -screened_rates(k_o16_o16_to_s32_modified)*std::pow(Y(O16), 2)*state.rho + + -screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*Y(O16)*state.rho; + + ydot_nuc(F18) = + (screened_rates(k_he4_n14_to_f18)*Y(He4)*Y(N14)*state.rho + -screened_rates(k_f18_to_he4_n14_derived)*Y(F18)) + + (-screened_rates(k_he4_f18_to_na22)*Y(F18)*Y(He4)*state.rho + screened_rates(k_na22_to_he4_f18_derived)*Y(Na22)) + + (-screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*Y(He4)*state.rho + screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*Y(H1)*state.rho); + + ydot_nuc(Ne20) = + (screened_rates(k_he4_o16_to_ne20)*Y(He4)*Y(O16)*state.rho + -screened_rates(k_ne20_to_he4_o16_derived)*Y(Ne20)) + + (-screened_rates(k_he4_ne20_to_mg24)*Y(He4)*Y(Ne20)*state.rho + screened_rates(k_mg24_to_he4_ne20_derived)*Y(Mg24)) + + 0.5*screened_rates(k_c12_c12_to_he4_ne20)*std::pow(Y(C12), 2)*state.rho + + (screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*Y(H1)*state.rho + -screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*Y(Ne20)*state.rho); + + ydot_nuc(Ne21) = + (-screened_rates(k_p_ne21_to_na22)*Y(Ne21)*Y(H1)*state.rho + screened_rates(k_na22_to_p_ne21_derived)*Y(Na22)) + + (screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*Y(He4)*state.rho + -screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*Y(H1)*state.rho); + + ydot_nuc(Na22) = + (screened_rates(k_he4_f18_to_na22)*Y(F18)*Y(He4)*state.rho + -screened_rates(k_na22_to_he4_f18_derived)*Y(Na22)) + + (screened_rates(k_p_ne21_to_na22)*Y(Ne21)*Y(H1)*state.rho + -screened_rates(k_na22_to_p_ne21_derived)*Y(Na22)); + + ydot_nuc(Na23) = + (-screened_rates(k_p_na23_to_mg24)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_mg24_to_p_na23_derived)*Y(Mg24)) + + 0.5*screened_rates(k_c12_c12_to_p_na23)*std::pow(Y(C12), 2)*state.rho + + (-screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*Y(H1)*state.rho + screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*Y(Ne20)*state.rho); + + ydot_nuc(Mg24) = + (screened_rates(k_he4_ne20_to_mg24)*Y(He4)*Y(Ne20)*state.rho + -screened_rates(k_mg24_to_he4_ne20_derived)*Y(Mg24)) + + (screened_rates(k_p_na23_to_mg24)*Y(Na23)*Y(H1)*state.rho + -screened_rates(k_mg24_to_p_na23_derived)*Y(Mg24)) + + (-screened_rates(k_he4_mg24_to_si28)*Y(He4)*Y(Mg24)*state.rho + screened_rates(k_si28_to_he4_mg24_derived)*Y(Si28)) + + screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*Y(O16)*state.rho + + (screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*Y(H1)*state.rho + -screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*Y(Mg24)*state.rho) + + 0.5*screened_rates(k_c12_c12_to_mg24_modified)*std::pow(Y(C12), 2)*state.rho; + + ydot_nuc(Al27) = + (-screened_rates(k_p_al27_to_si28)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_si28_to_p_al27_derived)*Y(Si28)) + + screened_rates(k_c12_o16_to_p_al27)*Y(C12)*Y(O16)*state.rho + + (-screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*Y(H1)*state.rho + screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*Y(Mg24)*state.rho); + + ydot_nuc(Si28) = + (screened_rates(k_he4_mg24_to_si28)*Y(He4)*Y(Mg24)*state.rho + -screened_rates(k_si28_to_he4_mg24_derived)*Y(Si28)) + + (screened_rates(k_p_al27_to_si28)*Y(Al27)*Y(H1)*state.rho + -screened_rates(k_si28_to_p_al27_derived)*Y(Si28)) + + (-screened_rates(k_he4_si28_to_s32)*Y(He4)*Y(Si28)*state.rho + screened_rates(k_s32_to_he4_si28_derived)*Y(S32)) + + 0.5*screened_rates(k_o16_o16_to_he4_si28)*std::pow(Y(O16), 2)*state.rho + + (screened_rates(k_p_p31_to_he4_si28)*Y(P31)*Y(H1)*state.rho + -screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*Y(Si28)*state.rho) + + screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*Y(O16)*state.rho; + + ydot_nuc(P31) = + (-screened_rates(k_p_p31_to_s32)*Y(P31)*Y(H1)*state.rho + screened_rates(k_s32_to_p_p31_derived)*Y(S32)) + + 0.5*screened_rates(k_o16_o16_to_p_p31)*std::pow(Y(O16), 2)*state.rho + + (-screened_rates(k_p_p31_to_he4_si28)*Y(P31)*Y(H1)*state.rho + screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*Y(Si28)*state.rho); + + ydot_nuc(S32) = + (screened_rates(k_he4_si28_to_s32)*Y(He4)*Y(Si28)*state.rho + -screened_rates(k_s32_to_he4_si28_derived)*Y(S32)) + + (screened_rates(k_p_p31_to_s32)*Y(P31)*Y(H1)*state.rho + -screened_rates(k_s32_to_p_p31_derived)*Y(S32)) + + 0.5*screened_rates(k_o16_o16_to_s32_modified)*std::pow(Y(O16), 2)*state.rho + + (-screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*Y(S32)*state.rho + screened_rates(k_ar36_to_s32_he4_approx)*Y(Ar36)); + + ydot_nuc(Ar36) = + (screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*Y(S32)*state.rho + -screened_rates(k_ar36_to_s32_he4_approx)*Y(Ar36)) + + (-screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*Y(He4)*state.rho + screened_rates(k_ca40_to_ar36_he4_approx)*Y(Ca40)); + + ydot_nuc(Ca40) = + (screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*Y(He4)*state.rho + -screened_rates(k_ca40_to_ar36_he4_approx)*Y(Ca40)) + + (-screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*Y(He4)*state.rho + screened_rates(k_ti44_to_ca40_he4_approx)*Y(Ti44)); + + ydot_nuc(Ti44) = + (screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*Y(He4)*state.rho + -screened_rates(k_ti44_to_ca40_he4_approx)*Y(Ti44)) + + (-screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*Y(Ti44)*state.rho + screened_rates(k_cr48_to_ti44_he4_approx)*Y(Cr48)); + + ydot_nuc(Cr48) = + (-screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_fe52_to_he4_cr48_derived)*Y(Fe52)) + + (-screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*Y(He4)*state.rho + screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*Y(H1)*state.rho) + + (screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*Y(Ti44)*state.rho + -screened_rates(k_cr48_to_ti44_he4_approx)*Y(Cr48)); + + ydot_nuc(Mn51) = + (-screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*Y(H1)*state.rho + screened_rates(k_fe52_to_p_mn51_derived)*Y(Fe52)) + + (-screened_rates(k_he4_mn51_to_co55)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_co55_to_he4_mn51_derived)*Y(Co55)) + + (screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*Y(He4)*state.rho + -screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*Y(H1)*state.rho) + + (-screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*Y(Mn51)*state.rho + screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*Y(H1)*state.rho); + + ydot_nuc(Mn55) = + (-screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*Y(H1)*state.rho + screened_rates(k_fe56_to_p_mn55_derived)*Y(Fe56)) + + (screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*Y(N)*state.rho + -screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*Y(H1)*state.rho) + + (screened_rates(k_fe55_to_mn55)*Y(Fe55) + -screened_rates(k_mn55_to_fe55)*Y(Mn55)); + + ydot_nuc(Fe52) = + (screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*Y(He4)*state.rho + -screened_rates(k_fe52_to_he4_cr48_derived)*Y(Fe52)) + + (screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*Y(H1)*state.rho + -screened_rates(k_fe52_to_p_mn51_derived)*Y(Fe52)) + + (-screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_ni56_to_he4_fe52_derived)*Y(Ni56)) + + (-screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*Y(He4)*state.rho + screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (-screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*Y(N)*state.rho + screened_rates(k_fe53_to_n_fe52_derived)*Y(Fe53)); + + ydot_nuc(Fe53) = + (screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*Y(N)*state.rho + -screened_rates(k_fe53_to_n_fe52_derived)*Y(Fe53)) + + (-screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*Y(N)*state.rho + screened_rates(k_fe54_to_n_fe53_derived)*Y(Fe54)) + + (-screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_ni57_to_he4_fe53_derived)*Y(Ni57)) + + (-screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*Y(He4)*state.rho + screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*Y(Ni56)*state.rho + -screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*Y(He4)*state.rho); + + ydot_nuc(Fe54) = + (screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*Y(N)*state.rho + -screened_rates(k_fe54_to_n_fe53_derived)*Y(Fe54)) + + (-screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*Y(N)*state.rho + screened_rates(k_fe55_to_n_fe54_derived)*Y(Fe55)) + + (-screened_rates(k_p_fe54_to_co55)*Y(Fe54)*Y(H1)*state.rho + screened_rates(k_co55_to_p_fe54_derived)*Y(Co55)) + + (-screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*Y(He4)*state.rho + screened_rates(k_ni58_to_he4_fe54_derived)*Y(Ni58)) + + (screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*Y(Mn51)*state.rho + -screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*Y(H1)*state.rho) + + (screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*Y(H1)*state.rho + -screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*Y(Ni57)*state.rho + -screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*Y(He4)*state.rho); + + ydot_nuc(Fe55) = + (screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*Y(N)*state.rho + -screened_rates(k_fe55_to_n_fe54_derived)*Y(Fe55)) + + (-screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*Y(N)*state.rho + screened_rates(k_fe56_to_n_fe55_derived)*Y(Fe56)) + + (-screened_rates(k_p_fe55_to_co56)*Y(Fe55)*Y(H1)*state.rho + screened_rates(k_co56_to_p_fe55_derived)*Y(Co56)) + + (-screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*Y(N)*state.rho + screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*Y(H1)*state.rho) + + (screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*Y(N)*state.rho + -screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*Y(Ni58)*state.rho + -screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*Y(He4)*state.rho) + + (screened_rates(k_co55_to_fe55)*Y(Co55) + -screened_rates(k_fe55_to_co55)*Y(Fe55)) + + (-screened_rates(k_fe55_to_mn55)*Y(Fe55) + screened_rates(k_mn55_to_fe55)*Y(Mn55)); + + ydot_nuc(Fe56) = + (screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*Y(H1)*state.rho + -screened_rates(k_fe56_to_p_mn55_derived)*Y(Fe56)) + + (screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*Y(N)*state.rho + -screened_rates(k_fe56_to_n_fe55_derived)*Y(Fe56)) + + (-screened_rates(k_p_fe56_to_co57)*Y(Fe56)*Y(H1)*state.rho + screened_rates(k_co57_to_p_fe56_derived)*Y(Co57)) + + (screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*Y(N)*state.rho + -screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (screened_rates(k_co56_to_fe56)*Y(Co56) + -screened_rates(k_fe56_to_co56)*Y(Fe56)); + + ydot_nuc(Co55) = + (screened_rates(k_he4_mn51_to_co55)*Y(He4)*Y(Mn51)*state.rho + -screened_rates(k_co55_to_he4_mn51_derived)*Y(Co55)) + + (-screened_rates(k_p_co55_to_ni56)*Y(Co55)*Y(H1)*state.rho + screened_rates(k_ni56_to_p_co55_derived)*Y(Ni56)) + + (-screened_rates(k_he4_co55_to_cu59)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_cu59_to_he4_co55_derived)*Y(Cu59)) + + (screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*Y(He4)*state.rho + -screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*Y(H1)*state.rho) + + (screened_rates(k_p_fe54_to_co55)*Y(Fe54)*Y(H1)*state.rho + -screened_rates(k_co55_to_p_fe54_derived)*Y(Co55)) + + (-screened_rates(k_n_co55_to_co56)*Y(Co55)*Y(N)*state.rho + screened_rates(k_co56_to_n_co55_derived)*Y(Co56)) + + (-screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*Y(N)*state.rho + screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*Y(H1)*state.rho) + + (-screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*Y(He4)*state.rho + screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (-screened_rates(k_co55_to_fe55)*Y(Co55) + screened_rates(k_fe55_to_co55)*Y(Fe55)); + + ydot_nuc(Co56) = + (screened_rates(k_p_fe55_to_co56)*Y(Fe55)*Y(H1)*state.rho + -screened_rates(k_co56_to_p_fe55_derived)*Y(Co56)) + + (screened_rates(k_n_co55_to_co56)*Y(Co55)*Y(N)*state.rho + -screened_rates(k_co56_to_n_co55_derived)*Y(Co56)) + + (-screened_rates(k_n_co56_to_co57)*Y(Co56)*Y(N)*state.rho + screened_rates(k_co57_to_n_co56_derived)*Y(Co57)) + + (-screened_rates(k_p_co56_to_ni57)*Y(Co56)*Y(H1)*state.rho + screened_rates(k_ni57_to_p_co56_derived)*Y(Ni57)) + + (screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*Y(He4)*state.rho + -screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*Y(H1)*state.rho) + + (-screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*Y(N)*state.rho + screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*Y(H1)*state.rho) + + (screened_rates(k_n_ni56_to_p_co56)*Y(N)*Y(Ni56)*state.rho + -screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*Y(N)*state.rho + -screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*Y(He4)*state.rho) + + (-screened_rates(k_co56_to_fe56)*Y(Co56) + screened_rates(k_fe56_to_co56)*Y(Fe56)) + + (screened_rates(k_ni56_to_co56)*Y(Ni56) + -screened_rates(k_co56_to_ni56)*Y(Co56)); + + ydot_nuc(Co57) = + (screened_rates(k_p_fe56_to_co57)*Y(Fe56)*Y(H1)*state.rho + -screened_rates(k_co57_to_p_fe56_derived)*Y(Co57)) + + (screened_rates(k_n_co56_to_co57)*Y(Co56)*Y(N)*state.rho + -screened_rates(k_co57_to_n_co56_derived)*Y(Co57)) + + (-screened_rates(k_p_co57_to_ni58)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_ni58_to_p_co57_derived)*Y(Ni58)) + + (-screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*Y(H1)*state.rho + screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_ni57_to_p_co57)*Y(N)*Y(Ni57)*state.rho + -screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*Y(H1)*state.rho) + + (screened_rates(k_ni57_to_co57)*Y(Ni57) + -screened_rates(k_co57_to_ni57)*Y(Co57)); + + ydot_nuc(Ni56) = + (screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*Y(He4)*state.rho + -screened_rates(k_ni56_to_he4_fe52_derived)*Y(Ni56)) + + (screened_rates(k_p_co55_to_ni56)*Y(Co55)*Y(H1)*state.rho + -screened_rates(k_ni56_to_p_co55_derived)*Y(Ni56)) + + (-screened_rates(k_he4_ni56_to_zn60)*Y(He4)*Y(Ni56)*state.rho + screened_rates(k_zn60_to_he4_ni56_derived)*Y(Zn60)) + + (screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*Y(H1)*state.rho + -screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*Y(Ni56)*state.rho) + + (-screened_rates(k_n_ni56_to_ni57)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_ni57_to_n_ni56_derived)*Y(Ni57)) + + (-screened_rates(k_n_ni56_to_p_co56)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*Y(Ni56)*state.rho + screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*Y(He4)*state.rho) + + (-screened_rates(k_ni56_to_co56)*Y(Ni56) + screened_rates(k_co56_to_ni56)*Y(Co56)); + + ydot_nuc(Ni57) = + (screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*Y(He4)*state.rho + -screened_rates(k_ni57_to_he4_fe53_derived)*Y(Ni57)) + + (screened_rates(k_p_co56_to_ni57)*Y(Co56)*Y(H1)*state.rho + -screened_rates(k_ni57_to_p_co56_derived)*Y(Ni57)) + + (screened_rates(k_n_ni56_to_ni57)*Y(N)*Y(Ni56)*state.rho + -screened_rates(k_ni57_to_n_ni56_derived)*Y(Ni57)) + + (-screened_rates(k_n_ni57_to_ni58)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_ni58_to_n_ni57_derived)*Y(Ni58)) + + (-screened_rates(k_n_ni57_to_p_co57)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*Y(Ni57)*state.rho + screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*Y(He4)*state.rho) + + (screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*Y(Zn60)*state.rho + -screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*Y(Ni57)*state.rho) + + (-screened_rates(k_ni57_to_co57)*Y(Ni57) + screened_rates(k_co57_to_ni57)*Y(Co57)); + + ydot_nuc(Ni58) = + (screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*Y(He4)*state.rho + -screened_rates(k_ni58_to_he4_fe54_derived)*Y(Ni58)) + + (screened_rates(k_p_co57_to_ni58)*Y(Co57)*Y(H1)*state.rho + -screened_rates(k_ni58_to_p_co57_derived)*Y(Ni58)) + + (screened_rates(k_n_ni57_to_ni58)*Y(N)*Y(Ni57)*state.rho + -screened_rates(k_ni58_to_n_ni57_derived)*Y(Ni58)) + + (-screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*Y(H1)*state.rho + screened_rates(k_cu59_to_p_ni58_derived)*Y(Cu59)) + + (screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*Y(He4)*state.rho + -screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*Y(H1)*state.rho) + + (-screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*Y(Ni58)*state.rho + screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*Y(He4)*state.rho); + + ydot_nuc(Cu59) = + (screened_rates(k_he4_co55_to_cu59)*Y(Co55)*Y(He4)*state.rho + -screened_rates(k_cu59_to_he4_co55_derived)*Y(Cu59)) + + (-screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_zn60_to_p_cu59_derived)*Y(Zn60)) + + (-screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*Y(H1)*state.rho + screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*Y(Ni56)*state.rho) + + (screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*Y(H1)*state.rho + -screened_rates(k_cu59_to_p_ni58_derived)*Y(Cu59)) + + (-screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*Y(N)*state.rho + screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*Y(He4)*state.rho); + + ydot_nuc(Zn60) = + (screened_rates(k_he4_ni56_to_zn60)*Y(He4)*Y(Ni56)*state.rho + -screened_rates(k_zn60_to_he4_ni56_derived)*Y(Zn60)) + + (screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*Y(H1)*state.rho + -screened_rates(k_zn60_to_p_cu59_derived)*Y(Zn60)) + + (-screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*Y(Zn60)*state.rho + screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*Y(Ni57)*state.rho); + +} + + +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void actual_rhs (burn_t& state, Array1D& ydot) +{ + for (int i = 1; i <= neqs; ++i) { + ydot(i) = 0.0_rt; + } + + + // Set molar abundances + Array1D Y; + for (int i = 1; i <= NumSpec; ++i) { + Y(i) = state.xn[i-1] * aion_inv[i-1]; + } + + // build the rates + + rate_t rate_eval; + + constexpr int do_T_derivatives = 0; + evaluate_rates(state, rate_eval); + + rhs_nuc(state, ydot, Y, rate_eval.screened_rates); + + // ion binding energy contributions + + Real enuc; + ener_gener_rate(ydot, enuc); + + // include reaction neutrino losses (non-thermal) and gamma heating + enuc += C::Legacy::n_A * Y(Co55) * rate_eval.add_energy_rate(k_co55_to_fe55); + enuc += C::Legacy::n_A * Y(Co56) * rate_eval.add_energy_rate(k_co56_to_fe56); + enuc += C::Legacy::n_A * Y(Co56) * rate_eval.add_energy_rate(k_co56_to_ni56); + enuc += C::Legacy::n_A * Y(Co57) * rate_eval.add_energy_rate(k_co57_to_ni57); + enuc += C::Legacy::n_A * Y(Fe55) * rate_eval.add_energy_rate(k_fe55_to_co55); + enuc += C::Legacy::n_A * Y(Fe55) * rate_eval.add_energy_rate(k_fe55_to_mn55); + enuc += C::Legacy::n_A * Y(Fe56) * rate_eval.add_energy_rate(k_fe56_to_co56); + enuc += C::Legacy::n_A * Y(Mn55) * rate_eval.add_energy_rate(k_mn55_to_fe55); + enuc += C::Legacy::n_A * Y(Ni56) * rate_eval.add_energy_rate(k_ni56_to_co56); + enuc += C::Legacy::n_A * Y(Ni57) * rate_eval.add_energy_rate(k_ni57_to_co57); + + // Get the thermal neutrino losses + + Real sneut, dsneutdt, dsneutdd, dsnuda, dsnudz; + constexpr int do_derivatives{0}; + sneut5(state.T, state.rho, state.abar, state.zbar, sneut, dsneutdt, dsneutdd, dsnuda, dsnudz); + + // Append the energy equation (this is erg/g/s) + + ydot(net_ienuc) = enuc - sneut; + +} + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void jac_nuc(const burn_t& state, + MatrixType& jac, + const Array1D& Y, + const Array1D& screened_rates) +{ + + Real scratch; + + scratch = -screened_rates(k_n_co55_to_co56)*Y(Co55)*state.rho - screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*state.rho - screened_rates(k_n_co56_to_co57)*Y(Co56)*state.rho - screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*state.rho - screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*state.rho - screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*state.rho - screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*state.rho - screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*state.rho - screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*state.rho - screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*state.rho - screened_rates(k_n_ni56_to_he4_fe53)*Y(Ni56)*state.rho - screened_rates(k_n_ni56_to_ni57)*Y(Ni56)*state.rho - screened_rates(k_n_ni56_to_p_co56)*Y(Ni56)*state.rho - screened_rates(k_n_ni57_to_he4_fe54)*Y(Ni57)*state.rho - screened_rates(k_n_ni57_to_ni58)*Y(Ni57)*state.rho - screened_rates(k_n_ni57_to_p_co57)*Y(Ni57)*state.rho - screened_rates(k_n_ni58_to_he4_fe55)*Y(Ni58)*state.rho - screened_rates(k_n_to_p_weak_wc12) - screened_rates(k_n_zn60_to_he4_ni57)*Y(Zn60)*state.rho; + jac.set(N, N, scratch); + + scratch = screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*state.rho + screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*state.rho + screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*state.rho + screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*state.rho + screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*state.rho; + jac.set(N, H1, scratch); + + scratch = screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*state.rho + screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*state.rho + screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*state.rho + screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*state.rho + screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(Ni57)*state.rho; + jac.set(N, He4, scratch); + + scratch = screened_rates(k_p_mn55_to_n_fe55_derived)*Y(H1)*state.rho; + jac.set(N, Mn55, scratch); + + scratch = -screened_rates(k_n_fe52_to_fe53)*Y(N)*state.rho; + jac.set(N, Fe52, scratch); + + scratch = screened_rates(k_fe53_to_n_fe52_derived) + screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(He4)*state.rho - screened_rates(k_n_fe53_to_fe54)*Y(N)*state.rho; + jac.set(N, Fe53, scratch); + + scratch = screened_rates(k_fe54_to_n_fe53_derived) + screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(He4)*state.rho - screened_rates(k_n_fe54_to_fe55)*Y(N)*state.rho; + jac.set(N, Fe54, scratch); + + scratch = screened_rates(k_fe55_to_n_fe54_derived) + screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(He4)*state.rho - screened_rates(k_n_fe55_to_fe56)*Y(N)*state.rho - screened_rates(k_n_fe55_to_p_mn55)*Y(N)*state.rho + screened_rates(k_p_fe55_to_n_co55_derived)*Y(H1)*state.rho; + jac.set(N, Fe55, scratch); + + scratch = screened_rates(k_fe56_to_n_fe55_derived) + screened_rates(k_p_fe56_to_n_co56_derived)*Y(H1)*state.rho; + jac.set(N, Fe56, scratch); + + scratch = -screened_rates(k_n_co55_to_co56)*Y(N)*state.rho - screened_rates(k_n_co55_to_p_fe55)*Y(N)*state.rho; + jac.set(N, Co55, scratch); + + scratch = screened_rates(k_co56_to_n_co55_derived) + screened_rates(k_he4_co56_to_n_cu59_derived)*Y(He4)*state.rho - screened_rates(k_n_co56_to_co57)*Y(N)*state.rho - screened_rates(k_n_co56_to_p_fe56)*Y(N)*state.rho + screened_rates(k_p_co56_to_n_ni56_derived)*Y(H1)*state.rho; + jac.set(N, Co56, scratch); + + scratch = screened_rates(k_co57_to_n_co56_derived) + screened_rates(k_p_co57_to_n_ni57_derived)*Y(H1)*state.rho; + jac.set(N, Co57, scratch); + + scratch = -screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*state.rho - screened_rates(k_n_ni56_to_ni57)*Y(N)*state.rho - screened_rates(k_n_ni56_to_p_co56)*Y(N)*state.rho; + jac.set(N, Ni56, scratch); + + scratch = screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*state.rho - screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*state.rho - screened_rates(k_n_ni57_to_ni58)*Y(N)*state.rho - screened_rates(k_n_ni57_to_p_co57)*Y(N)*state.rho + screened_rates(k_ni57_to_n_ni56_derived); + jac.set(N, Ni57, scratch); + + scratch = -screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*state.rho + screened_rates(k_ni58_to_n_ni57_derived); + jac.set(N, Ni58, scratch); + + scratch = -screened_rates(k_n_cu59_to_he4_co56)*Y(N)*state.rho; + jac.set(N, Cu59, scratch); + + scratch = -screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*state.rho; + jac.set(N, Zn60, scratch); + + scratch = screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*state.rho + screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*state.rho + screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*state.rho + screened_rates(k_n_ni56_to_p_co56)*Y(Ni56)*state.rho + screened_rates(k_n_ni57_to_p_co57)*Y(Ni57)*state.rho + screened_rates(k_n_to_p_weak_wc12); + jac.set(H1, N, scratch); + + scratch = -screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*state.rho - screened_rates(k_p_al27_to_si28)*Y(Al27)*state.rho - screened_rates(k_p_c12_to_n13)*Y(C12)*state.rho - screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*state.rho - screened_rates(k_p_co55_to_ni56)*Y(Co55)*state.rho - screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*state.rho - screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*state.rho - screened_rates(k_p_co56_to_ni57)*Y(Co56)*state.rho - screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*state.rho - screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*state.rho - screened_rates(k_p_co57_to_ni58)*Y(Co57)*state.rho - screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*state.rho - screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*state.rho - screened_rates(k_p_fe54_to_co55)*Y(Fe54)*state.rho - screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*state.rho - screened_rates(k_p_fe55_to_co56)*Y(Fe55)*state.rho - screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*state.rho - screened_rates(k_p_fe56_to_co57)*Y(Fe56)*state.rho - screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*state.rho - screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*state.rho - screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*state.rho - screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*state.rho - screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*state.rho - screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*state.rho - screened_rates(k_p_na23_to_mg24)*Y(Na23)*state.rho - screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*state.rho - screened_rates(k_p_ne21_to_na22)*Y(Ne21)*state.rho - screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*state.rho - screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*state.rho - screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*state.rho - screened_rates(k_p_p31_to_he4_si28)*Y(P31)*state.rho - screened_rates(k_p_p31_to_s32)*Y(P31)*state.rho; + jac.set(H1, H1, scratch); + + scratch = screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*state.rho + screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*state.rho + screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*state.rho + screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*state.rho + screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*state.rho + screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*state.rho + screened_rates(k_he4_mg24_to_p_al27_derived)*Y(Mg24)*state.rho + screened_rates(k_he4_mn51_to_p_fe54)*Y(Mn51)*state.rho + screened_rates(k_he4_n13_to_p_o16)*Y(N13)*state.rho + screened_rates(k_he4_ne20_to_p_na23_derived)*Y(Ne20)*state.rho + screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(Ni56)*state.rho + screened_rates(k_he4_si28_to_p_p31_derived)*Y(Si28)*state.rho; + jac.set(H1, He4, scratch); + + scratch = 1.0*screened_rates(k_c12_c12_to_p_na23)*Y(C12)*state.rho + screened_rates(k_c12_o16_to_p_al27)*Y(O16)*state.rho - screened_rates(k_p_c12_to_n13)*Y(H1)*state.rho; + jac.set(H1, C12, scratch); + + scratch = screened_rates(k_he4_n13_to_p_o16)*Y(He4)*state.rho + screened_rates(k_n13_to_p_c12_derived); + jac.set(H1, N13, scratch); + + scratch = screened_rates(k_c12_o16_to_p_al27)*Y(C12)*state.rho + 1.0*screened_rates(k_o16_o16_to_p_p31)*Y(O16)*state.rho - screened_rates(k_p_o16_to_he4_n13_derived)*Y(H1)*state.rho; + jac.set(H1, O16, scratch); + + scratch = screened_rates(k_he4_f18_to_p_ne21)*Y(He4)*state.rho; + jac.set(H1, F18, scratch); + + scratch = screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*state.rho; + jac.set(H1, Ne20, scratch); + + scratch = -screened_rates(k_p_ne21_to_he4_f18_derived)*Y(H1)*state.rho - screened_rates(k_p_ne21_to_na22)*Y(H1)*state.rho; + jac.set(H1, Ne21, scratch); + + scratch = screened_rates(k_na22_to_p_ne21_derived); + jac.set(H1, Na22, scratch); + + scratch = -screened_rates(k_p_na23_to_he4_ne20)*Y(H1)*state.rho - screened_rates(k_p_na23_to_mg24)*Y(H1)*state.rho; + jac.set(H1, Na23, scratch); + + scratch = screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*state.rho + screened_rates(k_mg24_to_p_na23_derived); + jac.set(H1, Mg24, scratch); + + scratch = -screened_rates(k_p_al27_to_he4_mg24)*Y(H1)*state.rho - screened_rates(k_p_al27_to_si28)*Y(H1)*state.rho; + jac.set(H1, Al27, scratch); + + scratch = screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*state.rho + screened_rates(k_si28_to_p_al27_derived); + jac.set(H1, Si28, scratch); + + scratch = -screened_rates(k_p_p31_to_he4_si28)*Y(H1)*state.rho - screened_rates(k_p_p31_to_s32)*Y(H1)*state.rho; + jac.set(H1, P31, scratch); + + scratch = screened_rates(k_s32_to_p_p31_derived); + jac.set(H1, S32, scratch); + + scratch = screened_rates(k_he4_cr48_to_p_mn51)*Y(He4)*state.rho; + jac.set(H1, Cr48, scratch); + + scratch = screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*state.rho - screened_rates(k_p_mn51_to_fe52)*Y(H1)*state.rho - screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(H1)*state.rho; + jac.set(H1, Mn51, scratch); + + scratch = -screened_rates(k_p_mn55_to_fe56)*Y(H1)*state.rho - screened_rates(k_p_mn55_to_n_fe55_derived)*Y(H1)*state.rho; + jac.set(H1, Mn55, scratch); + + scratch = screened_rates(k_fe52_to_p_mn51_derived) + screened_rates(k_he4_fe52_to_p_co55)*Y(He4)*state.rho; + jac.set(H1, Fe52, scratch); + + scratch = screened_rates(k_he4_fe53_to_p_co56)*Y(He4)*state.rho; + jac.set(H1, Fe53, scratch); + + scratch = screened_rates(k_he4_fe54_to_p_co57_derived)*Y(He4)*state.rho - screened_rates(k_p_fe54_to_co55)*Y(H1)*state.rho - screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(H1)*state.rho; + jac.set(H1, Fe54, scratch); + + scratch = screened_rates(k_n_fe55_to_p_mn55)*Y(N)*state.rho - screened_rates(k_p_fe55_to_co56)*Y(H1)*state.rho - screened_rates(k_p_fe55_to_n_co55_derived)*Y(H1)*state.rho; + jac.set(H1, Fe55, scratch); + + scratch = screened_rates(k_fe56_to_p_mn55_derived) - screened_rates(k_p_fe56_to_co57)*Y(H1)*state.rho - screened_rates(k_p_fe56_to_n_co56_derived)*Y(H1)*state.rho; + jac.set(H1, Fe56, scratch); + + scratch = screened_rates(k_co55_to_p_fe54_derived) + screened_rates(k_he4_co55_to_p_ni58)*Y(He4)*state.rho + screened_rates(k_n_co55_to_p_fe55)*Y(N)*state.rho - screened_rates(k_p_co55_to_he4_fe52_derived)*Y(H1)*state.rho - screened_rates(k_p_co55_to_ni56)*Y(H1)*state.rho; + jac.set(H1, Co55, scratch); + + scratch = screened_rates(k_co56_to_p_fe55_derived) + screened_rates(k_n_co56_to_p_fe56)*Y(N)*state.rho - screened_rates(k_p_co56_to_he4_fe53_derived)*Y(H1)*state.rho - screened_rates(k_p_co56_to_n_ni56_derived)*Y(H1)*state.rho - screened_rates(k_p_co56_to_ni57)*Y(H1)*state.rho; + jac.set(H1, Co56, scratch); + + scratch = screened_rates(k_co57_to_p_fe56_derived) - screened_rates(k_p_co57_to_he4_fe54)*Y(H1)*state.rho - screened_rates(k_p_co57_to_n_ni57_derived)*Y(H1)*state.rho - screened_rates(k_p_co57_to_ni58)*Y(H1)*state.rho; + jac.set(H1, Co57, scratch); + + scratch = screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*state.rho + screened_rates(k_n_ni56_to_p_co56)*Y(N)*state.rho + screened_rates(k_ni56_to_p_co55_derived); + jac.set(H1, Ni56, scratch); + + scratch = screened_rates(k_n_ni57_to_p_co57)*Y(N)*state.rho + screened_rates(k_ni57_to_p_co56_derived); + jac.set(H1, Ni57, scratch); + + scratch = screened_rates(k_ni58_to_p_co57_derived) - screened_rates(k_p_ni58_to_cu59)*Y(H1)*state.rho - screened_rates(k_p_ni58_to_he4_co55_derived)*Y(H1)*state.rho; + jac.set(H1, Ni58, scratch); + + scratch = screened_rates(k_cu59_to_p_ni58_derived) - screened_rates(k_p_cu59_to_he4_ni56)*Y(H1)*state.rho - screened_rates(k_p_cu59_to_zn60)*Y(H1)*state.rho; + jac.set(H1, Cu59, scratch); + + scratch = screened_rates(k_zn60_to_p_cu59_derived); + jac.set(H1, Zn60, scratch); + + scratch = screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*state.rho + screened_rates(k_n_ni56_to_he4_fe53)*Y(Ni56)*state.rho + screened_rates(k_n_ni57_to_he4_fe54)*Y(Ni57)*state.rho + screened_rates(k_n_ni58_to_he4_fe55)*Y(Ni58)*state.rho + screened_rates(k_n_zn60_to_he4_ni57)*Y(Zn60)*state.rho; + jac.set(He4, N, scratch); + + scratch = screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*state.rho + screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*state.rho + screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*state.rho + screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*state.rho + screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*state.rho + screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*state.rho + screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*state.rho + screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*state.rho + screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*state.rho + screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*state.rho + screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*state.rho + screened_rates(k_p_p31_to_he4_si28)*Y(P31)*state.rho; + jac.set(He4, H1, scratch); + + scratch = -screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*state.rho - screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*state.rho - screened_rates(k_he4_c12_to_o16)*Y(C12)*state.rho - screened_rates(k_he4_co55_to_cu59)*Y(Co55)*state.rho - screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*state.rho - screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*state.rho - screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*state.rho - screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*state.rho - screened_rates(k_he4_f18_to_na22)*Y(F18)*state.rho - screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*state.rho - screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*state.rho - screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*state.rho - screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*state.rho - screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*state.rho - screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*state.rho - screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*state.rho - screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*state.rho - screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*state.rho - screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*state.rho - 1.5*screened_rates(k_he4_he4_he4_to_c12)*std::pow(Y(He4), 2)*std::pow(state.rho, 2) - screened_rates(k_he4_mg24_to_p_al27_derived)*Y(Mg24)*state.rho - screened_rates(k_he4_mg24_to_si28)*Y(Mg24)*state.rho - screened_rates(k_he4_mn51_to_co55)*Y(Mn51)*state.rho - screened_rates(k_he4_mn51_to_p_fe54)*Y(Mn51)*state.rho - screened_rates(k_he4_n13_to_p_o16)*Y(N13)*state.rho - screened_rates(k_he4_n14_to_f18)*Y(N14)*state.rho - screened_rates(k_he4_ne20_to_mg24)*Y(Ne20)*state.rho - screened_rates(k_he4_ne20_to_p_na23_derived)*Y(Ne20)*state.rho - screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(Ni56)*state.rho - screened_rates(k_he4_ni56_to_zn60)*Y(Ni56)*state.rho - screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(Ni57)*state.rho - screened_rates(k_he4_o16_to_ne20)*Y(O16)*state.rho - screened_rates(k_he4_si28_to_p_p31_derived)*Y(Si28)*state.rho - screened_rates(k_he4_si28_to_s32)*Y(Si28)*state.rho - screened_rates(k_s32_he4_to_ar36_approx)*Y(S32)*state.rho - screened_rates(k_ti44_he4_to_cr48_approx)*Y(Ti44)*state.rho; + jac.set(He4, He4, scratch); + + scratch = 1.0*screened_rates(k_c12_c12_to_he4_ne20)*Y(C12)*state.rho + screened_rates(k_c12_o16_to_he4_mg24)*Y(O16)*state.rho + 3.0*screened_rates(k_c12_to_he4_he4_he4_derived) - screened_rates(k_he4_c12_to_o16)*Y(He4)*state.rho; + jac.set(He4, C12, scratch); + + scratch = -screened_rates(k_he4_n13_to_p_o16)*Y(He4)*state.rho; + jac.set(He4, N13, scratch); + + scratch = -screened_rates(k_he4_n14_to_f18)*Y(He4)*state.rho; + jac.set(He4, N14, scratch); + + scratch = screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*state.rho - screened_rates(k_he4_o16_to_ne20)*Y(He4)*state.rho + 1.0*screened_rates(k_o16_o16_to_he4_si28)*Y(O16)*state.rho + screened_rates(k_o16_to_he4_c12_derived) + screened_rates(k_p_o16_to_he4_n13_derived)*Y(H1)*state.rho; + jac.set(He4, O16, scratch); + + scratch = screened_rates(k_f18_to_he4_n14_derived) - screened_rates(k_he4_f18_to_na22)*Y(He4)*state.rho - screened_rates(k_he4_f18_to_p_ne21)*Y(He4)*state.rho; + jac.set(He4, F18, scratch); + + scratch = -screened_rates(k_he4_ne20_to_mg24)*Y(He4)*state.rho - screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*state.rho + screened_rates(k_ne20_to_he4_o16_derived); + jac.set(He4, Ne20, scratch); + + scratch = screened_rates(k_p_ne21_to_he4_f18_derived)*Y(H1)*state.rho; + jac.set(He4, Ne21, scratch); + + scratch = screened_rates(k_na22_to_he4_f18_derived); + jac.set(He4, Na22, scratch); + + scratch = screened_rates(k_p_na23_to_he4_ne20)*Y(H1)*state.rho; + jac.set(He4, Na23, scratch); + + scratch = -screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*state.rho - screened_rates(k_he4_mg24_to_si28)*Y(He4)*state.rho + screened_rates(k_mg24_to_he4_ne20_derived); + jac.set(He4, Mg24, scratch); + + scratch = screened_rates(k_p_al27_to_he4_mg24)*Y(H1)*state.rho; + jac.set(He4, Al27, scratch); + + scratch = -screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*state.rho - screened_rates(k_he4_si28_to_s32)*Y(He4)*state.rho + screened_rates(k_si28_to_he4_mg24_derived); + jac.set(He4, Si28, scratch); + + scratch = screened_rates(k_p_p31_to_he4_si28)*Y(H1)*state.rho; + jac.set(He4, P31, scratch); + + scratch = -screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*state.rho + screened_rates(k_s32_to_he4_si28_derived); + jac.set(He4, S32, scratch); + + scratch = -screened_rates(k_ar36_he4_to_ca40_approx)*Y(He4)*state.rho + screened_rates(k_ar36_to_s32_he4_approx); + jac.set(He4, Ar36, scratch); + + scratch = -screened_rates(k_ca40_he4_to_ti44_approx)*Y(He4)*state.rho + screened_rates(k_ca40_to_ar36_he4_approx); + jac.set(He4, Ca40, scratch); + + scratch = -screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*state.rho + screened_rates(k_ti44_to_ca40_he4_approx); + jac.set(He4, Ti44, scratch); + + scratch = screened_rates(k_cr48_to_ti44_he4_approx) - screened_rates(k_he4_cr48_to_fe52)*Y(He4)*state.rho - screened_rates(k_he4_cr48_to_p_mn51)*Y(He4)*state.rho; + jac.set(He4, Cr48, scratch); + + scratch = -screened_rates(k_he4_mn51_to_co55)*Y(He4)*state.rho - screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*state.rho + screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(H1)*state.rho; + jac.set(He4, Mn51, scratch); + + scratch = screened_rates(k_fe52_to_he4_cr48_derived) - screened_rates(k_he4_fe52_to_ni56)*Y(He4)*state.rho - screened_rates(k_he4_fe52_to_p_co55)*Y(He4)*state.rho; + jac.set(He4, Fe52, scratch); + + scratch = -screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(He4)*state.rho - screened_rates(k_he4_fe53_to_ni57)*Y(He4)*state.rho - screened_rates(k_he4_fe53_to_p_co56)*Y(He4)*state.rho; + jac.set(He4, Fe53, scratch); + + scratch = -screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(He4)*state.rho - screened_rates(k_he4_fe54_to_ni58)*Y(He4)*state.rho - screened_rates(k_he4_fe54_to_p_co57_derived)*Y(He4)*state.rho + screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(H1)*state.rho; + jac.set(He4, Fe54, scratch); + + scratch = -screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(He4)*state.rho; + jac.set(He4, Fe55, scratch); + + scratch = screened_rates(k_co55_to_he4_mn51_derived) - screened_rates(k_he4_co55_to_cu59)*Y(He4)*state.rho - screened_rates(k_he4_co55_to_p_ni58)*Y(He4)*state.rho + screened_rates(k_p_co55_to_he4_fe52_derived)*Y(H1)*state.rho; + jac.set(He4, Co55, scratch); + + scratch = -screened_rates(k_he4_co56_to_n_cu59_derived)*Y(He4)*state.rho + screened_rates(k_p_co56_to_he4_fe53_derived)*Y(H1)*state.rho; + jac.set(He4, Co56, scratch); + + scratch = screened_rates(k_p_co57_to_he4_fe54)*Y(H1)*state.rho; + jac.set(He4, Co57, scratch); + + scratch = -screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*state.rho - screened_rates(k_he4_ni56_to_zn60)*Y(He4)*state.rho + screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*state.rho + screened_rates(k_ni56_to_he4_fe52_derived); + jac.set(He4, Ni56, scratch); + + scratch = -screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*state.rho + screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*state.rho + screened_rates(k_ni57_to_he4_fe53_derived); + jac.set(He4, Ni57, scratch); + + scratch = screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*state.rho + screened_rates(k_ni58_to_he4_fe54_derived) + screened_rates(k_p_ni58_to_he4_co55_derived)*Y(H1)*state.rho; + jac.set(He4, Ni58, scratch); + + scratch = screened_rates(k_cu59_to_he4_co55_derived) + screened_rates(k_n_cu59_to_he4_co56)*Y(N)*state.rho + screened_rates(k_p_cu59_to_he4_ni56)*Y(H1)*state.rho; + jac.set(He4, Cu59, scratch); + + scratch = screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*state.rho + screened_rates(k_zn60_to_he4_ni56_derived); + jac.set(He4, Zn60, scratch); + + scratch = -screened_rates(k_p_c12_to_n13)*Y(C12)*state.rho; + jac.set(C12, H1, scratch); + + scratch = -screened_rates(k_he4_c12_to_o16)*Y(C12)*state.rho + 0.5*screened_rates(k_he4_he4_he4_to_c12)*std::pow(Y(He4), 2)*std::pow(state.rho, 2); + jac.set(C12, He4, scratch); + + scratch = -2.0*screened_rates(k_c12_c12_to_he4_ne20)*Y(C12)*state.rho - 2.0*screened_rates(k_c12_c12_to_mg24_modified)*Y(C12)*state.rho - 2.0*screened_rates(k_c12_c12_to_p_na23)*Y(C12)*state.rho - screened_rates(k_c12_o16_to_he4_mg24)*Y(O16)*state.rho - screened_rates(k_c12_o16_to_p_al27)*Y(O16)*state.rho - screened_rates(k_c12_o16_to_si28_modified)*Y(O16)*state.rho - screened_rates(k_c12_to_he4_he4_he4_derived) - screened_rates(k_he4_c12_to_o16)*Y(He4)*state.rho - screened_rates(k_p_c12_to_n13)*Y(H1)*state.rho; + jac.set(C12, C12, scratch); + + scratch = screened_rates(k_n13_to_p_c12_derived); + jac.set(C12, N13, scratch); + + scratch = -screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*state.rho - screened_rates(k_c12_o16_to_p_al27)*Y(C12)*state.rho - screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*state.rho + screened_rates(k_o16_to_he4_c12_derived); + jac.set(C12, O16, scratch); + + scratch = screened_rates(k_p_c12_to_n13)*Y(C12)*state.rho + screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*state.rho; + jac.set(N13, H1, scratch); + + scratch = -screened_rates(k_he4_n13_to_p_o16)*Y(N13)*state.rho; + jac.set(N13, He4, scratch); + + scratch = screened_rates(k_p_c12_to_n13)*Y(H1)*state.rho; + jac.set(N13, C12, scratch); + + scratch = -screened_rates(k_he4_n13_to_p_o16)*Y(He4)*state.rho - screened_rates(k_n13_to_p_c12_derived); + jac.set(N13, N13, scratch); + + scratch = screened_rates(k_p_o16_to_he4_n13_derived)*Y(H1)*state.rho; + jac.set(N13, O16, scratch); + + scratch = -screened_rates(k_he4_n14_to_f18)*Y(N14)*state.rho; + jac.set(N14, He4, scratch); + + scratch = -screened_rates(k_he4_n14_to_f18)*Y(He4)*state.rho; + jac.set(N14, N14, scratch); + + scratch = screened_rates(k_f18_to_he4_n14_derived); + jac.set(N14, F18, scratch); + + scratch = -screened_rates(k_p_o16_to_he4_n13_derived)*Y(O16)*state.rho; + jac.set(O16, H1, scratch); + + scratch = screened_rates(k_he4_c12_to_o16)*Y(C12)*state.rho + screened_rates(k_he4_n13_to_p_o16)*Y(N13)*state.rho - screened_rates(k_he4_o16_to_ne20)*Y(O16)*state.rho; + jac.set(O16, He4, scratch); + + scratch = -screened_rates(k_c12_o16_to_he4_mg24)*Y(O16)*state.rho - screened_rates(k_c12_o16_to_p_al27)*Y(O16)*state.rho - screened_rates(k_c12_o16_to_si28_modified)*Y(O16)*state.rho + screened_rates(k_he4_c12_to_o16)*Y(He4)*state.rho; + jac.set(O16, C12, scratch); + + scratch = screened_rates(k_he4_n13_to_p_o16)*Y(He4)*state.rho; + jac.set(O16, N13, scratch); + + scratch = -screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*state.rho - screened_rates(k_c12_o16_to_p_al27)*Y(C12)*state.rho - screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*state.rho - screened_rates(k_he4_o16_to_ne20)*Y(He4)*state.rho - 2.0*screened_rates(k_o16_o16_to_he4_si28)*Y(O16)*state.rho - 2.0*screened_rates(k_o16_o16_to_p_p31)*Y(O16)*state.rho - 2.0*screened_rates(k_o16_o16_to_s32_modified)*Y(O16)*state.rho - screened_rates(k_o16_to_he4_c12_derived) - screened_rates(k_p_o16_to_he4_n13_derived)*Y(H1)*state.rho; + jac.set(O16, O16, scratch); + + scratch = screened_rates(k_ne20_to_he4_o16_derived); + jac.set(O16, Ne20, scratch); + + scratch = screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*state.rho; + jac.set(F18, H1, scratch); + + scratch = -screened_rates(k_he4_f18_to_na22)*Y(F18)*state.rho - screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*state.rho + screened_rates(k_he4_n14_to_f18)*Y(N14)*state.rho; + jac.set(F18, He4, scratch); + + scratch = screened_rates(k_he4_n14_to_f18)*Y(He4)*state.rho; + jac.set(F18, N14, scratch); + + scratch = -screened_rates(k_f18_to_he4_n14_derived) - screened_rates(k_he4_f18_to_na22)*Y(He4)*state.rho - screened_rates(k_he4_f18_to_p_ne21)*Y(He4)*state.rho; + jac.set(F18, F18, scratch); + + scratch = screened_rates(k_p_ne21_to_he4_f18_derived)*Y(H1)*state.rho; + jac.set(F18, Ne21, scratch); + + scratch = screened_rates(k_na22_to_he4_f18_derived); + jac.set(F18, Na22, scratch); + + scratch = screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*state.rho; + jac.set(Ne20, H1, scratch); + + scratch = -screened_rates(k_he4_ne20_to_mg24)*Y(Ne20)*state.rho - screened_rates(k_he4_ne20_to_p_na23_derived)*Y(Ne20)*state.rho + screened_rates(k_he4_o16_to_ne20)*Y(O16)*state.rho; + jac.set(Ne20, He4, scratch); + + scratch = 1.0*screened_rates(k_c12_c12_to_he4_ne20)*Y(C12)*state.rho; + jac.set(Ne20, C12, scratch); + + scratch = screened_rates(k_he4_o16_to_ne20)*Y(He4)*state.rho; + jac.set(Ne20, O16, scratch); + + scratch = -screened_rates(k_he4_ne20_to_mg24)*Y(He4)*state.rho - screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*state.rho - screened_rates(k_ne20_to_he4_o16_derived); + jac.set(Ne20, Ne20, scratch); + + scratch = screened_rates(k_p_na23_to_he4_ne20)*Y(H1)*state.rho; + jac.set(Ne20, Na23, scratch); + + scratch = screened_rates(k_mg24_to_he4_ne20_derived); + jac.set(Ne20, Mg24, scratch); + + scratch = -screened_rates(k_p_ne21_to_he4_f18_derived)*Y(Ne21)*state.rho - screened_rates(k_p_ne21_to_na22)*Y(Ne21)*state.rho; + jac.set(Ne21, H1, scratch); + + scratch = screened_rates(k_he4_f18_to_p_ne21)*Y(F18)*state.rho; + jac.set(Ne21, He4, scratch); + + scratch = screened_rates(k_he4_f18_to_p_ne21)*Y(He4)*state.rho; + jac.set(Ne21, F18, scratch); + + scratch = -screened_rates(k_p_ne21_to_he4_f18_derived)*Y(H1)*state.rho - screened_rates(k_p_ne21_to_na22)*Y(H1)*state.rho; + jac.set(Ne21, Ne21, scratch); + + scratch = screened_rates(k_na22_to_p_ne21_derived); + jac.set(Ne21, Na22, scratch); + + scratch = screened_rates(k_p_ne21_to_na22)*Y(Ne21)*state.rho; + jac.set(Na22, H1, scratch); + + scratch = screened_rates(k_he4_f18_to_na22)*Y(F18)*state.rho; + jac.set(Na22, He4, scratch); + + scratch = screened_rates(k_he4_f18_to_na22)*Y(He4)*state.rho; + jac.set(Na22, F18, scratch); + + scratch = screened_rates(k_p_ne21_to_na22)*Y(H1)*state.rho; + jac.set(Na22, Ne21, scratch); + + scratch = -screened_rates(k_na22_to_he4_f18_derived) - screened_rates(k_na22_to_p_ne21_derived); + jac.set(Na22, Na22, scratch); + + scratch = -screened_rates(k_p_na23_to_he4_ne20)*Y(Na23)*state.rho - screened_rates(k_p_na23_to_mg24)*Y(Na23)*state.rho; + jac.set(Na23, H1, scratch); + + scratch = screened_rates(k_he4_ne20_to_p_na23_derived)*Y(Ne20)*state.rho; + jac.set(Na23, He4, scratch); + + scratch = 1.0*screened_rates(k_c12_c12_to_p_na23)*Y(C12)*state.rho; + jac.set(Na23, C12, scratch); + + scratch = screened_rates(k_he4_ne20_to_p_na23_derived)*Y(He4)*state.rho; + jac.set(Na23, Ne20, scratch); + + scratch = -screened_rates(k_p_na23_to_he4_ne20)*Y(H1)*state.rho - screened_rates(k_p_na23_to_mg24)*Y(H1)*state.rho; + jac.set(Na23, Na23, scratch); + + scratch = screened_rates(k_mg24_to_p_na23_derived); + jac.set(Na23, Mg24, scratch); + + scratch = screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*state.rho + screened_rates(k_p_na23_to_mg24)*Y(Na23)*state.rho; + jac.set(Mg24, H1, scratch); + + scratch = -screened_rates(k_he4_mg24_to_p_al27_derived)*Y(Mg24)*state.rho - screened_rates(k_he4_mg24_to_si28)*Y(Mg24)*state.rho + screened_rates(k_he4_ne20_to_mg24)*Y(Ne20)*state.rho; + jac.set(Mg24, He4, scratch); + + scratch = 1.0*screened_rates(k_c12_c12_to_mg24_modified)*Y(C12)*state.rho + screened_rates(k_c12_o16_to_he4_mg24)*Y(O16)*state.rho; + jac.set(Mg24, C12, scratch); + + scratch = screened_rates(k_c12_o16_to_he4_mg24)*Y(C12)*state.rho; + jac.set(Mg24, O16, scratch); + + scratch = screened_rates(k_he4_ne20_to_mg24)*Y(He4)*state.rho; + jac.set(Mg24, Ne20, scratch); + + scratch = screened_rates(k_p_na23_to_mg24)*Y(H1)*state.rho; + jac.set(Mg24, Na23, scratch); + + scratch = -screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*state.rho - screened_rates(k_he4_mg24_to_si28)*Y(He4)*state.rho - screened_rates(k_mg24_to_he4_ne20_derived) - screened_rates(k_mg24_to_p_na23_derived); + jac.set(Mg24, Mg24, scratch); + + scratch = screened_rates(k_p_al27_to_he4_mg24)*Y(H1)*state.rho; + jac.set(Mg24, Al27, scratch); + + scratch = screened_rates(k_si28_to_he4_mg24_derived); + jac.set(Mg24, Si28, scratch); + + scratch = -screened_rates(k_p_al27_to_he4_mg24)*Y(Al27)*state.rho - screened_rates(k_p_al27_to_si28)*Y(Al27)*state.rho; + jac.set(Al27, H1, scratch); + + scratch = screened_rates(k_he4_mg24_to_p_al27_derived)*Y(Mg24)*state.rho; + jac.set(Al27, He4, scratch); + + scratch = screened_rates(k_c12_o16_to_p_al27)*Y(O16)*state.rho; + jac.set(Al27, C12, scratch); + + scratch = screened_rates(k_c12_o16_to_p_al27)*Y(C12)*state.rho; + jac.set(Al27, O16, scratch); + + scratch = screened_rates(k_he4_mg24_to_p_al27_derived)*Y(He4)*state.rho; + jac.set(Al27, Mg24, scratch); + + scratch = -screened_rates(k_p_al27_to_he4_mg24)*Y(H1)*state.rho - screened_rates(k_p_al27_to_si28)*Y(H1)*state.rho; + jac.set(Al27, Al27, scratch); + + scratch = screened_rates(k_si28_to_p_al27_derived); + jac.set(Al27, Si28, scratch); + + scratch = screened_rates(k_p_al27_to_si28)*Y(Al27)*state.rho + screened_rates(k_p_p31_to_he4_si28)*Y(P31)*state.rho; + jac.set(Si28, H1, scratch); + + scratch = screened_rates(k_he4_mg24_to_si28)*Y(Mg24)*state.rho - screened_rates(k_he4_si28_to_p_p31_derived)*Y(Si28)*state.rho - screened_rates(k_he4_si28_to_s32)*Y(Si28)*state.rho; + jac.set(Si28, He4, scratch); + + scratch = screened_rates(k_c12_o16_to_si28_modified)*Y(O16)*state.rho; + jac.set(Si28, C12, scratch); + + scratch = screened_rates(k_c12_o16_to_si28_modified)*Y(C12)*state.rho + 1.0*screened_rates(k_o16_o16_to_he4_si28)*Y(O16)*state.rho; + jac.set(Si28, O16, scratch); + + scratch = screened_rates(k_he4_mg24_to_si28)*Y(He4)*state.rho; + jac.set(Si28, Mg24, scratch); + + scratch = screened_rates(k_p_al27_to_si28)*Y(H1)*state.rho; + jac.set(Si28, Al27, scratch); + + scratch = -screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*state.rho - screened_rates(k_he4_si28_to_s32)*Y(He4)*state.rho - screened_rates(k_si28_to_he4_mg24_derived) - screened_rates(k_si28_to_p_al27_derived); + jac.set(Si28, Si28, scratch); + + scratch = screened_rates(k_p_p31_to_he4_si28)*Y(H1)*state.rho; + jac.set(Si28, P31, scratch); + + scratch = screened_rates(k_s32_to_he4_si28_derived); + jac.set(Si28, S32, scratch); + + scratch = -screened_rates(k_p_p31_to_he4_si28)*Y(P31)*state.rho - screened_rates(k_p_p31_to_s32)*Y(P31)*state.rho; + jac.set(P31, H1, scratch); + + scratch = screened_rates(k_he4_si28_to_p_p31_derived)*Y(Si28)*state.rho; + jac.set(P31, He4, scratch); + + scratch = 1.0*screened_rates(k_o16_o16_to_p_p31)*Y(O16)*state.rho; + jac.set(P31, O16, scratch); + + scratch = screened_rates(k_he4_si28_to_p_p31_derived)*Y(He4)*state.rho; + jac.set(P31, Si28, scratch); + + scratch = -screened_rates(k_p_p31_to_he4_si28)*Y(H1)*state.rho - screened_rates(k_p_p31_to_s32)*Y(H1)*state.rho; + jac.set(P31, P31, scratch); + + scratch = screened_rates(k_s32_to_p_p31_derived); + jac.set(P31, S32, scratch); + + scratch = screened_rates(k_p_p31_to_s32)*Y(P31)*state.rho; + jac.set(S32, H1, scratch); + + scratch = screened_rates(k_he4_si28_to_s32)*Y(Si28)*state.rho - screened_rates(k_s32_he4_to_ar36_approx)*Y(S32)*state.rho; + jac.set(S32, He4, scratch); + + scratch = 1.0*screened_rates(k_o16_o16_to_s32_modified)*Y(O16)*state.rho; + jac.set(S32, O16, scratch); + + scratch = screened_rates(k_he4_si28_to_s32)*Y(He4)*state.rho; + jac.set(S32, Si28, scratch); + + scratch = screened_rates(k_p_p31_to_s32)*Y(H1)*state.rho; + jac.set(S32, P31, scratch); + + scratch = -screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*state.rho - screened_rates(k_s32_to_he4_si28_derived) - screened_rates(k_s32_to_p_p31_derived); + jac.set(S32, S32, scratch); + + scratch = screened_rates(k_ar36_to_s32_he4_approx); + jac.set(S32, Ar36, scratch); + + scratch = -screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*state.rho + screened_rates(k_s32_he4_to_ar36_approx)*Y(S32)*state.rho; + jac.set(Ar36, He4, scratch); + + scratch = screened_rates(k_s32_he4_to_ar36_approx)*Y(He4)*state.rho; + jac.set(Ar36, S32, scratch); + + scratch = -screened_rates(k_ar36_he4_to_ca40_approx)*Y(He4)*state.rho - screened_rates(k_ar36_to_s32_he4_approx); + jac.set(Ar36, Ar36, scratch); + + scratch = screened_rates(k_ca40_to_ar36_he4_approx); + jac.set(Ar36, Ca40, scratch); + + scratch = screened_rates(k_ar36_he4_to_ca40_approx)*Y(Ar36)*state.rho - screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*state.rho; + jac.set(Ca40, He4, scratch); + + scratch = screened_rates(k_ar36_he4_to_ca40_approx)*Y(He4)*state.rho; + jac.set(Ca40, Ar36, scratch); + + scratch = -screened_rates(k_ca40_he4_to_ti44_approx)*Y(He4)*state.rho - screened_rates(k_ca40_to_ar36_he4_approx); + jac.set(Ca40, Ca40, scratch); + + scratch = screened_rates(k_ti44_to_ca40_he4_approx); + jac.set(Ca40, Ti44, scratch); + + scratch = screened_rates(k_ca40_he4_to_ti44_approx)*Y(Ca40)*state.rho - screened_rates(k_ti44_he4_to_cr48_approx)*Y(Ti44)*state.rho; + jac.set(Ti44, He4, scratch); + + scratch = screened_rates(k_ca40_he4_to_ti44_approx)*Y(He4)*state.rho; + jac.set(Ti44, Ca40, scratch); + + scratch = -screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*state.rho - screened_rates(k_ti44_to_ca40_he4_approx); + jac.set(Ti44, Ti44, scratch); + + scratch = screened_rates(k_cr48_to_ti44_he4_approx); + jac.set(Ti44, Cr48, scratch); + + scratch = screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*state.rho; + jac.set(Cr48, H1, scratch); + + scratch = -screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*state.rho - screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*state.rho + screened_rates(k_ti44_he4_to_cr48_approx)*Y(Ti44)*state.rho; + jac.set(Cr48, He4, scratch); + + scratch = screened_rates(k_ti44_he4_to_cr48_approx)*Y(He4)*state.rho; + jac.set(Cr48, Ti44, scratch); + + scratch = -screened_rates(k_cr48_to_ti44_he4_approx) - screened_rates(k_he4_cr48_to_fe52)*Y(He4)*state.rho - screened_rates(k_he4_cr48_to_p_mn51)*Y(He4)*state.rho; + jac.set(Cr48, Cr48, scratch); + + scratch = screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(H1)*state.rho; + jac.set(Cr48, Mn51, scratch); + + scratch = screened_rates(k_fe52_to_he4_cr48_derived); + jac.set(Cr48, Fe52, scratch); + + scratch = screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*state.rho - screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*state.rho - screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(Mn51)*state.rho; + jac.set(Mn51, H1, scratch); + + scratch = screened_rates(k_he4_cr48_to_p_mn51)*Y(Cr48)*state.rho - screened_rates(k_he4_mn51_to_co55)*Y(Mn51)*state.rho - screened_rates(k_he4_mn51_to_p_fe54)*Y(Mn51)*state.rho; + jac.set(Mn51, He4, scratch); + + scratch = screened_rates(k_he4_cr48_to_p_mn51)*Y(He4)*state.rho; + jac.set(Mn51, Cr48, scratch); + + scratch = -screened_rates(k_he4_mn51_to_co55)*Y(He4)*state.rho - screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*state.rho - screened_rates(k_p_mn51_to_fe52)*Y(H1)*state.rho - screened_rates(k_p_mn51_to_he4_cr48_derived)*Y(H1)*state.rho; + jac.set(Mn51, Mn51, scratch); + + scratch = screened_rates(k_fe52_to_p_mn51_derived); + jac.set(Mn51, Fe52, scratch); + + scratch = screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(H1)*state.rho; + jac.set(Mn51, Fe54, scratch); + + scratch = screened_rates(k_co55_to_he4_mn51_derived); + jac.set(Mn51, Co55, scratch); + + scratch = screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*state.rho; + jac.set(Mn55, N, scratch); + + scratch = -screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*state.rho - screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*state.rho; + jac.set(Mn55, H1, scratch); + + scratch = -screened_rates(k_mn55_to_fe55) - screened_rates(k_p_mn55_to_fe56)*Y(H1)*state.rho - screened_rates(k_p_mn55_to_n_fe55_derived)*Y(H1)*state.rho; + jac.set(Mn55, Mn55, scratch); + + scratch = screened_rates(k_fe55_to_mn55) + screened_rates(k_n_fe55_to_p_mn55)*Y(N)*state.rho; + jac.set(Mn55, Fe55, scratch); + + scratch = screened_rates(k_fe56_to_p_mn55_derived); + jac.set(Mn55, Fe56, scratch); + + scratch = -screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*state.rho; + jac.set(Fe52, N, scratch); + + scratch = screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*state.rho + screened_rates(k_p_mn51_to_fe52)*Y(Mn51)*state.rho; + jac.set(Fe52, H1, scratch); + + scratch = screened_rates(k_he4_cr48_to_fe52)*Y(Cr48)*state.rho - screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*state.rho - screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*state.rho; + jac.set(Fe52, He4, scratch); + + scratch = screened_rates(k_he4_cr48_to_fe52)*Y(He4)*state.rho; + jac.set(Fe52, Cr48, scratch); + + scratch = screened_rates(k_p_mn51_to_fe52)*Y(H1)*state.rho; + jac.set(Fe52, Mn51, scratch); + + scratch = -screened_rates(k_fe52_to_he4_cr48_derived) - screened_rates(k_fe52_to_p_mn51_derived) - screened_rates(k_he4_fe52_to_ni56)*Y(He4)*state.rho - screened_rates(k_he4_fe52_to_p_co55)*Y(He4)*state.rho - screened_rates(k_n_fe52_to_fe53)*Y(N)*state.rho; + jac.set(Fe52, Fe52, scratch); + + scratch = screened_rates(k_fe53_to_n_fe52_derived); + jac.set(Fe52, Fe53, scratch); + + scratch = screened_rates(k_p_co55_to_he4_fe52_derived)*Y(H1)*state.rho; + jac.set(Fe52, Co55, scratch); + + scratch = screened_rates(k_ni56_to_he4_fe52_derived); + jac.set(Fe52, Ni56, scratch); + + scratch = screened_rates(k_n_fe52_to_fe53)*Y(Fe52)*state.rho - screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*state.rho + screened_rates(k_n_ni56_to_he4_fe53)*Y(Ni56)*state.rho; + jac.set(Fe53, N, scratch); + + scratch = screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*state.rho; + jac.set(Fe53, H1, scratch); + + scratch = -screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*state.rho - screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*state.rho - screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*state.rho; + jac.set(Fe53, He4, scratch); + + scratch = screened_rates(k_n_fe52_to_fe53)*Y(N)*state.rho; + jac.set(Fe53, Fe52, scratch); + + scratch = -screened_rates(k_fe53_to_n_fe52_derived) - screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(He4)*state.rho - screened_rates(k_he4_fe53_to_ni57)*Y(He4)*state.rho - screened_rates(k_he4_fe53_to_p_co56)*Y(He4)*state.rho - screened_rates(k_n_fe53_to_fe54)*Y(N)*state.rho; + jac.set(Fe53, Fe53, scratch); + + scratch = screened_rates(k_fe54_to_n_fe53_derived); + jac.set(Fe53, Fe54, scratch); + + scratch = screened_rates(k_p_co56_to_he4_fe53_derived)*Y(H1)*state.rho; + jac.set(Fe53, Co56, scratch); + + scratch = screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*state.rho; + jac.set(Fe53, Ni56, scratch); + + scratch = screened_rates(k_ni57_to_he4_fe53_derived); + jac.set(Fe53, Ni57, scratch); + + scratch = screened_rates(k_n_fe53_to_fe54)*Y(Fe53)*state.rho - screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*state.rho + screened_rates(k_n_ni57_to_he4_fe54)*Y(Ni57)*state.rho; + jac.set(Fe54, N, scratch); + + scratch = screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*state.rho - screened_rates(k_p_fe54_to_co55)*Y(Fe54)*state.rho - screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(Fe54)*state.rho; + jac.set(Fe54, H1, scratch); + + scratch = -screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*state.rho - screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*state.rho - screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*state.rho + screened_rates(k_he4_mn51_to_p_fe54)*Y(Mn51)*state.rho; + jac.set(Fe54, He4, scratch); + + scratch = screened_rates(k_he4_mn51_to_p_fe54)*Y(He4)*state.rho; + jac.set(Fe54, Mn51, scratch); + + scratch = screened_rates(k_n_fe53_to_fe54)*Y(N)*state.rho; + jac.set(Fe54, Fe53, scratch); + + scratch = -screened_rates(k_fe54_to_n_fe53_derived) - screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(He4)*state.rho - screened_rates(k_he4_fe54_to_ni58)*Y(He4)*state.rho - screened_rates(k_he4_fe54_to_p_co57_derived)*Y(He4)*state.rho - screened_rates(k_n_fe54_to_fe55)*Y(N)*state.rho - screened_rates(k_p_fe54_to_co55)*Y(H1)*state.rho - screened_rates(k_p_fe54_to_he4_mn51_derived)*Y(H1)*state.rho; + jac.set(Fe54, Fe54, scratch); + + scratch = screened_rates(k_fe55_to_n_fe54_derived); + jac.set(Fe54, Fe55, scratch); + + scratch = screened_rates(k_co55_to_p_fe54_derived); + jac.set(Fe54, Co55, scratch); + + scratch = screened_rates(k_p_co57_to_he4_fe54)*Y(H1)*state.rho; + jac.set(Fe54, Co57, scratch); + + scratch = screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*state.rho; + jac.set(Fe54, Ni57, scratch); + + scratch = screened_rates(k_ni58_to_he4_fe54_derived); + jac.set(Fe54, Ni58, scratch); + + scratch = screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*state.rho + screened_rates(k_n_fe54_to_fe55)*Y(Fe54)*state.rho - screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*state.rho - screened_rates(k_n_fe55_to_p_mn55)*Y(Fe55)*state.rho + screened_rates(k_n_ni58_to_he4_fe55)*Y(Ni58)*state.rho; + jac.set(Fe55, N, scratch); + + scratch = -screened_rates(k_p_fe55_to_co56)*Y(Fe55)*state.rho - screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*state.rho + screened_rates(k_p_mn55_to_n_fe55_derived)*Y(Mn55)*state.rho; + jac.set(Fe55, H1, scratch); + + scratch = -screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*state.rho; + jac.set(Fe55, He4, scratch); + + scratch = screened_rates(k_mn55_to_fe55) + screened_rates(k_p_mn55_to_n_fe55_derived)*Y(H1)*state.rho; + jac.set(Fe55, Mn55, scratch); + + scratch = screened_rates(k_n_fe54_to_fe55)*Y(N)*state.rho; + jac.set(Fe55, Fe54, scratch); + + scratch = -screened_rates(k_fe55_to_co55) - screened_rates(k_fe55_to_mn55) - screened_rates(k_fe55_to_n_fe54_derived) - screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(He4)*state.rho - screened_rates(k_n_fe55_to_fe56)*Y(N)*state.rho - screened_rates(k_n_fe55_to_p_mn55)*Y(N)*state.rho - screened_rates(k_p_fe55_to_co56)*Y(H1)*state.rho - screened_rates(k_p_fe55_to_n_co55_derived)*Y(H1)*state.rho; + jac.set(Fe55, Fe55, scratch); + + scratch = screened_rates(k_fe56_to_n_fe55_derived); + jac.set(Fe55, Fe56, scratch); + + scratch = screened_rates(k_co55_to_fe55) + screened_rates(k_n_co55_to_p_fe55)*Y(N)*state.rho; + jac.set(Fe55, Co55, scratch); + + scratch = screened_rates(k_co56_to_p_fe55_derived); + jac.set(Fe55, Co56, scratch); + + scratch = screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*state.rho; + jac.set(Fe55, Ni58, scratch); + + scratch = screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*state.rho + screened_rates(k_n_fe55_to_fe56)*Y(Fe55)*state.rho; + jac.set(Fe56, N, scratch); + + scratch = -screened_rates(k_p_fe56_to_co57)*Y(Fe56)*state.rho - screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*state.rho + screened_rates(k_p_mn55_to_fe56)*Y(Mn55)*state.rho; + jac.set(Fe56, H1, scratch); + + scratch = screened_rates(k_p_mn55_to_fe56)*Y(H1)*state.rho; + jac.set(Fe56, Mn55, scratch); + + scratch = screened_rates(k_n_fe55_to_fe56)*Y(N)*state.rho; + jac.set(Fe56, Fe55, scratch); + + scratch = -screened_rates(k_fe56_to_co56) - screened_rates(k_fe56_to_n_fe55_derived) - screened_rates(k_fe56_to_p_mn55_derived) - screened_rates(k_p_fe56_to_co57)*Y(H1)*state.rho - screened_rates(k_p_fe56_to_n_co56_derived)*Y(H1)*state.rho; + jac.set(Fe56, Fe56, scratch); + + scratch = screened_rates(k_co56_to_fe56) + screened_rates(k_n_co56_to_p_fe56)*Y(N)*state.rho; + jac.set(Fe56, Co56, scratch); + + scratch = screened_rates(k_co57_to_p_fe56_derived); + jac.set(Fe56, Co57, scratch); + + scratch = -screened_rates(k_n_co55_to_co56)*Y(Co55)*state.rho - screened_rates(k_n_co55_to_p_fe55)*Y(Co55)*state.rho; + jac.set(Co55, N, scratch); + + scratch = -screened_rates(k_p_co55_to_he4_fe52_derived)*Y(Co55)*state.rho - screened_rates(k_p_co55_to_ni56)*Y(Co55)*state.rho + screened_rates(k_p_fe54_to_co55)*Y(Fe54)*state.rho + screened_rates(k_p_fe55_to_n_co55_derived)*Y(Fe55)*state.rho + screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*state.rho; + jac.set(Co55, H1, scratch); + + scratch = -screened_rates(k_he4_co55_to_cu59)*Y(Co55)*state.rho - screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*state.rho + screened_rates(k_he4_fe52_to_p_co55)*Y(Fe52)*state.rho + screened_rates(k_he4_mn51_to_co55)*Y(Mn51)*state.rho; + jac.set(Co55, He4, scratch); + + scratch = screened_rates(k_he4_mn51_to_co55)*Y(He4)*state.rho; + jac.set(Co55, Mn51, scratch); + + scratch = screened_rates(k_he4_fe52_to_p_co55)*Y(He4)*state.rho; + jac.set(Co55, Fe52, scratch); + + scratch = screened_rates(k_p_fe54_to_co55)*Y(H1)*state.rho; + jac.set(Co55, Fe54, scratch); + + scratch = screened_rates(k_fe55_to_co55) + screened_rates(k_p_fe55_to_n_co55_derived)*Y(H1)*state.rho; + jac.set(Co55, Fe55, scratch); + + scratch = -screened_rates(k_co55_to_fe55) - screened_rates(k_co55_to_he4_mn51_derived) - screened_rates(k_co55_to_p_fe54_derived) - screened_rates(k_he4_co55_to_cu59)*Y(He4)*state.rho - screened_rates(k_he4_co55_to_p_ni58)*Y(He4)*state.rho - screened_rates(k_n_co55_to_co56)*Y(N)*state.rho - screened_rates(k_n_co55_to_p_fe55)*Y(N)*state.rho - screened_rates(k_p_co55_to_he4_fe52_derived)*Y(H1)*state.rho - screened_rates(k_p_co55_to_ni56)*Y(H1)*state.rho; + jac.set(Co55, Co55, scratch); + + scratch = screened_rates(k_co56_to_n_co55_derived); + jac.set(Co55, Co56, scratch); + + scratch = screened_rates(k_ni56_to_p_co55_derived); + jac.set(Co55, Ni56, scratch); + + scratch = screened_rates(k_p_ni58_to_he4_co55_derived)*Y(H1)*state.rho; + jac.set(Co55, Ni58, scratch); + + scratch = screened_rates(k_cu59_to_he4_co55_derived); + jac.set(Co55, Cu59, scratch); + + scratch = screened_rates(k_n_co55_to_co56)*Y(Co55)*state.rho - screened_rates(k_n_co56_to_co57)*Y(Co56)*state.rho - screened_rates(k_n_co56_to_p_fe56)*Y(Co56)*state.rho + screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*state.rho + screened_rates(k_n_ni56_to_p_co56)*Y(Ni56)*state.rho; + jac.set(Co56, N, scratch); + + scratch = -screened_rates(k_p_co56_to_he4_fe53_derived)*Y(Co56)*state.rho - screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*state.rho - screened_rates(k_p_co56_to_ni57)*Y(Co56)*state.rho + screened_rates(k_p_fe55_to_co56)*Y(Fe55)*state.rho + screened_rates(k_p_fe56_to_n_co56_derived)*Y(Fe56)*state.rho; + jac.set(Co56, H1, scratch); + + scratch = -screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*state.rho + screened_rates(k_he4_fe53_to_p_co56)*Y(Fe53)*state.rho; + jac.set(Co56, He4, scratch); + + scratch = screened_rates(k_he4_fe53_to_p_co56)*Y(He4)*state.rho; + jac.set(Co56, Fe53, scratch); + + scratch = screened_rates(k_p_fe55_to_co56)*Y(H1)*state.rho; + jac.set(Co56, Fe55, scratch); + + scratch = screened_rates(k_fe56_to_co56) + screened_rates(k_p_fe56_to_n_co56_derived)*Y(H1)*state.rho; + jac.set(Co56, Fe56, scratch); + + scratch = screened_rates(k_n_co55_to_co56)*Y(N)*state.rho; + jac.set(Co56, Co55, scratch); + + scratch = -screened_rates(k_co56_to_fe56) - screened_rates(k_co56_to_n_co55_derived) - screened_rates(k_co56_to_ni56) - screened_rates(k_co56_to_p_fe55_derived) - screened_rates(k_he4_co56_to_n_cu59_derived)*Y(He4)*state.rho - screened_rates(k_n_co56_to_co57)*Y(N)*state.rho - screened_rates(k_n_co56_to_p_fe56)*Y(N)*state.rho - screened_rates(k_p_co56_to_he4_fe53_derived)*Y(H1)*state.rho - screened_rates(k_p_co56_to_n_ni56_derived)*Y(H1)*state.rho - screened_rates(k_p_co56_to_ni57)*Y(H1)*state.rho; + jac.set(Co56, Co56, scratch); + + scratch = screened_rates(k_co57_to_n_co56_derived); + jac.set(Co56, Co57, scratch); + + scratch = screened_rates(k_n_ni56_to_p_co56)*Y(N)*state.rho + screened_rates(k_ni56_to_co56); + jac.set(Co56, Ni56, scratch); + + scratch = screened_rates(k_ni57_to_p_co56_derived); + jac.set(Co56, Ni57, scratch); + + scratch = screened_rates(k_n_cu59_to_he4_co56)*Y(N)*state.rho; + jac.set(Co56, Cu59, scratch); + + scratch = screened_rates(k_n_co56_to_co57)*Y(Co56)*state.rho + screened_rates(k_n_ni57_to_p_co57)*Y(Ni57)*state.rho; + jac.set(Co57, N, scratch); + + scratch = -screened_rates(k_p_co57_to_he4_fe54)*Y(Co57)*state.rho - screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*state.rho - screened_rates(k_p_co57_to_ni58)*Y(Co57)*state.rho + screened_rates(k_p_fe56_to_co57)*Y(Fe56)*state.rho; + jac.set(Co57, H1, scratch); + + scratch = screened_rates(k_he4_fe54_to_p_co57_derived)*Y(Fe54)*state.rho; + jac.set(Co57, He4, scratch); + + scratch = screened_rates(k_he4_fe54_to_p_co57_derived)*Y(He4)*state.rho; + jac.set(Co57, Fe54, scratch); + + scratch = screened_rates(k_p_fe56_to_co57)*Y(H1)*state.rho; + jac.set(Co57, Fe56, scratch); + + scratch = screened_rates(k_n_co56_to_co57)*Y(N)*state.rho; + jac.set(Co57, Co56, scratch); + + scratch = -screened_rates(k_co57_to_n_co56_derived) - screened_rates(k_co57_to_ni57) - screened_rates(k_co57_to_p_fe56_derived) - screened_rates(k_p_co57_to_he4_fe54)*Y(H1)*state.rho - screened_rates(k_p_co57_to_n_ni57_derived)*Y(H1)*state.rho - screened_rates(k_p_co57_to_ni58)*Y(H1)*state.rho; + jac.set(Co57, Co57, scratch); + + scratch = screened_rates(k_n_ni57_to_p_co57)*Y(N)*state.rho + screened_rates(k_ni57_to_co57); + jac.set(Co57, Ni57, scratch); + + scratch = screened_rates(k_ni58_to_p_co57_derived); + jac.set(Co57, Ni58, scratch); + + scratch = -screened_rates(k_n_ni56_to_he4_fe53)*Y(Ni56)*state.rho - screened_rates(k_n_ni56_to_ni57)*Y(Ni56)*state.rho - screened_rates(k_n_ni56_to_p_co56)*Y(Ni56)*state.rho; + jac.set(Ni56, N, scratch); + + scratch = screened_rates(k_p_co55_to_ni56)*Y(Co55)*state.rho + screened_rates(k_p_co56_to_n_ni56_derived)*Y(Co56)*state.rho + screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*state.rho; + jac.set(Ni56, H1, scratch); + + scratch = screened_rates(k_he4_fe52_to_ni56)*Y(Fe52)*state.rho + screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(Fe53)*state.rho - screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(Ni56)*state.rho - screened_rates(k_he4_ni56_to_zn60)*Y(Ni56)*state.rho; + jac.set(Ni56, He4, scratch); + + scratch = screened_rates(k_he4_fe52_to_ni56)*Y(He4)*state.rho; + jac.set(Ni56, Fe52, scratch); + + scratch = screened_rates(k_he4_fe53_to_n_ni56_derived)*Y(He4)*state.rho; + jac.set(Ni56, Fe53, scratch); + + scratch = screened_rates(k_p_co55_to_ni56)*Y(H1)*state.rho; + jac.set(Ni56, Co55, scratch); + + scratch = screened_rates(k_co56_to_ni56) + screened_rates(k_p_co56_to_n_ni56_derived)*Y(H1)*state.rho; + jac.set(Ni56, Co56, scratch); + + scratch = -screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*state.rho - screened_rates(k_he4_ni56_to_zn60)*Y(He4)*state.rho - screened_rates(k_n_ni56_to_he4_fe53)*Y(N)*state.rho - screened_rates(k_n_ni56_to_ni57)*Y(N)*state.rho - screened_rates(k_n_ni56_to_p_co56)*Y(N)*state.rho - screened_rates(k_ni56_to_co56) - screened_rates(k_ni56_to_he4_fe52_derived) - screened_rates(k_ni56_to_p_co55_derived); + jac.set(Ni56, Ni56, scratch); + + scratch = screened_rates(k_ni57_to_n_ni56_derived); + jac.set(Ni56, Ni57, scratch); + + scratch = screened_rates(k_p_cu59_to_he4_ni56)*Y(H1)*state.rho; + jac.set(Ni56, Cu59, scratch); + + scratch = screened_rates(k_zn60_to_he4_ni56_derived); + jac.set(Ni56, Zn60, scratch); + + scratch = screened_rates(k_n_ni56_to_ni57)*Y(Ni56)*state.rho - screened_rates(k_n_ni57_to_he4_fe54)*Y(Ni57)*state.rho - screened_rates(k_n_ni57_to_ni58)*Y(Ni57)*state.rho - screened_rates(k_n_ni57_to_p_co57)*Y(Ni57)*state.rho + screened_rates(k_n_zn60_to_he4_ni57)*Y(Zn60)*state.rho; + jac.set(Ni57, N, scratch); + + scratch = screened_rates(k_p_co56_to_ni57)*Y(Co56)*state.rho + screened_rates(k_p_co57_to_n_ni57_derived)*Y(Co57)*state.rho; + jac.set(Ni57, H1, scratch); + + scratch = screened_rates(k_he4_fe53_to_ni57)*Y(Fe53)*state.rho + screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(Fe54)*state.rho - screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(Ni57)*state.rho; + jac.set(Ni57, He4, scratch); + + scratch = screened_rates(k_he4_fe53_to_ni57)*Y(He4)*state.rho; + jac.set(Ni57, Fe53, scratch); + + scratch = screened_rates(k_he4_fe54_to_n_ni57_derived)*Y(He4)*state.rho; + jac.set(Ni57, Fe54, scratch); + + scratch = screened_rates(k_p_co56_to_ni57)*Y(H1)*state.rho; + jac.set(Ni57, Co56, scratch); + + scratch = screened_rates(k_co57_to_ni57) + screened_rates(k_p_co57_to_n_ni57_derived)*Y(H1)*state.rho; + jac.set(Ni57, Co57, scratch); + + scratch = screened_rates(k_n_ni56_to_ni57)*Y(N)*state.rho; + jac.set(Ni57, Ni56, scratch); + + scratch = -screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*state.rho - screened_rates(k_n_ni57_to_he4_fe54)*Y(N)*state.rho - screened_rates(k_n_ni57_to_ni58)*Y(N)*state.rho - screened_rates(k_n_ni57_to_p_co57)*Y(N)*state.rho - screened_rates(k_ni57_to_co57) - screened_rates(k_ni57_to_he4_fe53_derived) - screened_rates(k_ni57_to_n_ni56_derived) - screened_rates(k_ni57_to_p_co56_derived); + jac.set(Ni57, Ni57, scratch); + + scratch = screened_rates(k_ni58_to_n_ni57_derived); + jac.set(Ni57, Ni58, scratch); + + scratch = screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*state.rho; + jac.set(Ni57, Zn60, scratch); + + scratch = screened_rates(k_n_ni57_to_ni58)*Y(Ni57)*state.rho - screened_rates(k_n_ni58_to_he4_fe55)*Y(Ni58)*state.rho; + jac.set(Ni58, N, scratch); + + scratch = screened_rates(k_p_co57_to_ni58)*Y(Co57)*state.rho - screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*state.rho - screened_rates(k_p_ni58_to_he4_co55_derived)*Y(Ni58)*state.rho; + jac.set(Ni58, H1, scratch); + + scratch = screened_rates(k_he4_co55_to_p_ni58)*Y(Co55)*state.rho + screened_rates(k_he4_fe54_to_ni58)*Y(Fe54)*state.rho + screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(Fe55)*state.rho; + jac.set(Ni58, He4, scratch); + + scratch = screened_rates(k_he4_fe54_to_ni58)*Y(He4)*state.rho; + jac.set(Ni58, Fe54, scratch); + + scratch = screened_rates(k_he4_fe55_to_n_ni58_derived)*Y(He4)*state.rho; + jac.set(Ni58, Fe55, scratch); + + scratch = screened_rates(k_he4_co55_to_p_ni58)*Y(He4)*state.rho; + jac.set(Ni58, Co55, scratch); + + scratch = screened_rates(k_p_co57_to_ni58)*Y(H1)*state.rho; + jac.set(Ni58, Co57, scratch); + + scratch = screened_rates(k_n_ni57_to_ni58)*Y(N)*state.rho; + jac.set(Ni58, Ni57, scratch); + + scratch = -screened_rates(k_n_ni58_to_he4_fe55)*Y(N)*state.rho - screened_rates(k_ni58_to_he4_fe54_derived) - screened_rates(k_ni58_to_n_ni57_derived) - screened_rates(k_ni58_to_p_co57_derived) - screened_rates(k_p_ni58_to_cu59)*Y(H1)*state.rho - screened_rates(k_p_ni58_to_he4_co55_derived)*Y(H1)*state.rho; + jac.set(Ni58, Ni58, scratch); + + scratch = screened_rates(k_cu59_to_p_ni58_derived); + jac.set(Ni58, Cu59, scratch); + + scratch = -screened_rates(k_n_cu59_to_he4_co56)*Y(Cu59)*state.rho; + jac.set(Cu59, N, scratch); + + scratch = -screened_rates(k_p_cu59_to_he4_ni56)*Y(Cu59)*state.rho - screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*state.rho + screened_rates(k_p_ni58_to_cu59)*Y(Ni58)*state.rho; + jac.set(Cu59, H1, scratch); + + scratch = screened_rates(k_he4_co55_to_cu59)*Y(Co55)*state.rho + screened_rates(k_he4_co56_to_n_cu59_derived)*Y(Co56)*state.rho + screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(Ni56)*state.rho; + jac.set(Cu59, He4, scratch); + + scratch = screened_rates(k_he4_co55_to_cu59)*Y(He4)*state.rho; + jac.set(Cu59, Co55, scratch); + + scratch = screened_rates(k_he4_co56_to_n_cu59_derived)*Y(He4)*state.rho; + jac.set(Cu59, Co56, scratch); + + scratch = screened_rates(k_he4_ni56_to_p_cu59_derived)*Y(He4)*state.rho; + jac.set(Cu59, Ni56, scratch); + + scratch = screened_rates(k_p_ni58_to_cu59)*Y(H1)*state.rho; + jac.set(Cu59, Ni58, scratch); + + scratch = -screened_rates(k_cu59_to_he4_co55_derived) - screened_rates(k_cu59_to_p_ni58_derived) - screened_rates(k_n_cu59_to_he4_co56)*Y(N)*state.rho - screened_rates(k_p_cu59_to_he4_ni56)*Y(H1)*state.rho - screened_rates(k_p_cu59_to_zn60)*Y(H1)*state.rho; + jac.set(Cu59, Cu59, scratch); + + scratch = screened_rates(k_zn60_to_p_cu59_derived); + jac.set(Cu59, Zn60, scratch); + + scratch = -screened_rates(k_n_zn60_to_he4_ni57)*Y(Zn60)*state.rho; + jac.set(Zn60, N, scratch); + + scratch = screened_rates(k_p_cu59_to_zn60)*Y(Cu59)*state.rho; + jac.set(Zn60, H1, scratch); + + scratch = screened_rates(k_he4_ni56_to_zn60)*Y(Ni56)*state.rho + screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(Ni57)*state.rho; + jac.set(Zn60, He4, scratch); + + scratch = screened_rates(k_he4_ni56_to_zn60)*Y(He4)*state.rho; + jac.set(Zn60, Ni56, scratch); + + scratch = screened_rates(k_he4_ni57_to_n_zn60_derived)*Y(He4)*state.rho; + jac.set(Zn60, Ni57, scratch); + + scratch = screened_rates(k_p_cu59_to_zn60)*Y(H1)*state.rho; + jac.set(Zn60, Cu59, scratch); + + scratch = -screened_rates(k_n_zn60_to_he4_ni57)*Y(N)*state.rho - screened_rates(k_zn60_to_he4_ni56_derived) - screened_rates(k_zn60_to_p_cu59_derived); + jac.set(Zn60, Zn60, scratch); + + +} + + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void actual_jac(const burn_t& state, MatrixType& jac) +{ + + // Set molar abundances + Array1D Y; + for (int i = 1; i <= NumSpec; ++i) { + Y(i) = state.xn[i-1] * aion_inv[i-1]; + } + + + jac.zero(); + + rate_derivs_t rate_eval; + + constexpr int do_T_derivatives = 1; + evaluate_rates(state, rate_eval); + + // Species Jacobian elements with respect to other species + + jac_nuc(state, jac, Y, rate_eval.screened_rates); + + // Energy generation rate Jacobian elements with respect to species + + for (int j = 1; j <= NumSpec; ++j) { + auto jac_slice_2 = [&](int i) -> Real { return jac.get(i, j); }; + ener_gener_rate(jac_slice_2, jac(net_ienuc,j)); + } + + // Account for the thermal neutrino losses + + Real sneut, dsneutdt, dsneutdd, dsnuda, dsnudz; + constexpr int do_derivatives{1}; + sneut5(state.T, state.rho, state.abar, state.zbar, sneut, dsneutdt, dsneutdd, dsnuda, dsnudz); + + for (int j = 1; j <= NumSpec; ++j) { + Real b1 = (-state.abar * state.abar * dsnuda + (zion[j-1] - state.zbar) * state.abar * dsnudz); + jac.add(net_ienuc, j, -b1); + } + + + // Evaluate the Jacobian elements with respect to energy by + // calling the RHS using d(rate) / dT and then transform them + // to our energy integration variable. + + Array1D yderivs; + + rhs_nuc(state, yderivs, Y, rate_eval.dscreened_rates_dT); + + for (int k = 1; k <= NumSpec; k++) { + jac.set(k, net_ienuc, temperature_to_energy_jacobian(state, yderivs(k))); + } + + + // finally, d(de/dt)/de + + Real jac_e_T; + ener_gener_rate(yderivs, jac_e_T); + jac_e_T -= dsneutdt; + jac.set(net_ienuc, net_ienuc, temperature_to_energy_jacobian(state, jac_e_T)); + +} + + +AMREX_INLINE +void actual_rhs_init () { + + init_tabular(); + +} + + +#endif diff --git a/networks/He-C-Fe-group/inputs.burn_cell.VODE b/networks/He-C-Fe-group/inputs.burn_cell.VODE new file mode 100644 index 0000000000..320d26fb4d --- /dev/null +++ b/networks/He-C-Fe-group/inputs.burn_cell.VODE @@ -0,0 +1,62 @@ +unit_test.run_prefix = "react_pynucastro_" + +unit_test.small_temp = 1e5 +unit_test.small_dens = 1e5 + +integrator.burner_verbose = 0 + +# Set which jacobian to use +# 1 = analytic jacobian +# 2 = numerical jacobian +integrator.jacobian = 1 + +integrator.renormalize_abundances = 0 + +integrator.rtol_spec = 1.0e-6 +integrator.rtol_enuc = 1.0e-6 +integrator.atol_spec = 1.0e-6 +integrator.atol_enuc = 1.0e-6 + + +unit_test.tmax = 1.0 +unit_test.nsteps = 1000 + +unit_test.density = 1.0e7 +unit_test.temperature = 1.0e8 + +unit_test.X1 = 1.0 +unit_test.X2 = 0.0 +unit_test.X3 = 0.0 +unit_test.X4 = 0.0 +unit_test.X5 = 0.0 +unit_test.X6 = 0.0 +unit_test.X7 = 0.0 +unit_test.X8 = 0.0 +unit_test.X9 = 0.0 +unit_test.X10 = 0.0 +unit_test.X11 = 0.0 +unit_test.X12 = 0.0 +unit_test.X13 = 0.0 +unit_test.X14 = 0.0 +unit_test.X15 = 0.0 +unit_test.X16 = 0.0 +unit_test.X17 = 0.0 +unit_test.X18 = 0.0 +unit_test.X19 = 0.0 +unit_test.X20 = 0.0 +unit_test.X21 = 0.0 +unit_test.X22 = 0.0 +unit_test.X23 = 0.0 +unit_test.X24 = 0.0 +unit_test.X25 = 0.0 +unit_test.X26 = 0.0 +unit_test.X27 = 0.0 +unit_test.X28 = 0.0 +unit_test.X29 = 0.0 +unit_test.X30 = 0.0 +unit_test.X31 = 0.0 +unit_test.X32 = 0.0 +unit_test.X33 = 0.0 +unit_test.X34 = 0.0 +unit_test.X35 = 0.0 +unit_test.X36 = 0.0 diff --git a/networks/He-C-Fe-group/partition_functions.H b/networks/He-C-Fe-group/partition_functions.H new file mode 100644 index 0000000000..03c1db628a --- /dev/null +++ b/networks/He-C-Fe-group/partition_functions.H @@ -0,0 +1,1011 @@ +#ifndef PARTITION_FUNCTIONS_H +#define PARTITION_FUNCTIONS_H + +#include +#include + +#include +#include +#include + +using namespace amrex; +using namespace Species; + +namespace part_fun { + + constexpr int npts_1 = 72; + + // this is T9 + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real temp_array_1[npts_1] = { + 0.01, 0.15, 0.2, 0.3, 0.4, + 0.5, 0.6, 0.7, 0.8, 0.9, + 1.0, 1.5, 2.0, 2.5, 3.0, + 3.5, 4.0, 4.5, 5.0, 6.0, + 7.0, 8.0, 9.0, 10.0, 12.0, + 14.0, 16.0, 18.0, 20.0, 22.0, + 24.0, 26.0, 28.0, 30.0, 35.0, + 40.0, 45.0, 50.0, 55.0, 60.0, + 65.0, 70.0, 75.0, 80.0, 85.0, + 90.0, 95.0, 100.0, 105.0, 110.0, + 115.0, 120.0, 125.0, 130.0, 135.0, + 140.0, 145.0, 150.0, 155.0, 160.0, + 165.0, 170.0, 175.0, 180.0, 190.0, + 200.0, 210.0, 220.0, 230.0, 240.0, + 250.0, 275.0, + }; + + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real o16_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.012837224705172217, + 0.03742649794062367, 0.07188200730612536, 0.1205739312058499, 0.1846914308175988, 0.26245108973042947, + 0.3463529744506387, 0.437750562820388, 0.534026106056135, 0.6344772701607315, 0.8981764834976765, + 1.1760912590556813, 1.4668676203541096, 1.7641761323903307, 2.0644579892269186, 2.367355921026019, + 2.667452952889954, 2.9656719712201065, 3.2624510897304293, 3.555094448578319, 3.845098040014257, + 4.133538908370218, 4.419955748489758, 4.704150516839799, 4.986771734266245, 5.267171728403014, + 5.547774705387822, 5.8267225201689925, 6.103803720955957, 6.380211241711606, 6.6551384348113825, + 6.929929560084588, 7.204119982655925, 7.477121254719663, 7.748962861256161, 8.021189299069938, + 8.292256071356476, 8.562292864456476, 8.832508912706237, 9.100370545117563, 9.640481436970422, + 10.178976947293169, 10.714329759745233, 11.250420002308894, 11.785329835010767, 12.320146286111054, + 12.856124444242301, 14.195899652409233, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real f18_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.008600171761917567, 0.02530586526477026, 0.04921802267018165, + 0.08635983067474821, 0.12385164096708583, 0.16731733474817606, 0.20682587603184974, 0.28330122870354957, + 0.35024801833416286, 0.4065401804339551, 0.45331834004703764, 0.4941545940184428, 0.6646419755561255, + 0.756636108245848, 0.8419848045901139, 0.9232440186302765, 1.0043213737826426, 1.08278537031645, + 1.1643528557844371, 1.250420002308894, 1.3384564936046048, 1.429752280002408, 1.6748611407378116, + 1.9405164849325671, 2.220108088040055, 2.505149978319906, 2.79309160017658, 3.0827853703164503, + 3.369215857410143, 3.6570558528571038, 3.9434945159061026, 4.230448921378274, 4.514547752660286, + 4.800029359244134, 5.086359830674748, 5.371067862271737, 5.657055852857104, 5.94299959336604, + 6.230448921378274, 6.515873843711679, 6.803457115648414, 7.089905111439398, 7.378397900948138, + 7.6674529528899535, 7.956168430475364, 8.24551266781415, 8.534026106056135, 8.823474229170301, + 9.113943352306837, 9.403120521175818, 9.69460519893357, 9.984977126415494, 10.568201724066995, + 11.152288344383056, 11.73798732633343, 12.324282455297693, 12.913813852383717, 13.503790683057181, + 14.096910013008056, 15.584331224367531, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ne20_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 6.948656121358244e-06, 0.00016586881316040883, 0.0011034421778731533, 0.003892457497077877, + 0.00954097493969645, 0.01859524021829981, 0.03107544483336982, 0.04661767038571622, 0.0846241727916796, + 0.12822183093465686, 0.174311933665943, 0.22124805254602342, 0.2683385291343481, 0.36172783601759284, + 0.456366033129043, 0.5514499979728752, 0.6483600109809317, 0.7466341989375788, 0.8481891169913987, + 0.9532763366673044, 1.0644579892269186, 1.1789769472931695, 1.3031960574204888, 1.6434526764861874, + 2.0170333392987803, 2.4099331233312946, 2.8068580295188172, 3.2013971243204513, 3.5899496013257077, + 3.9731278535996988, 4.352182518111363, 4.725911632295048, 5.096910013008056, 5.465382851448418, + 5.830588668685144, 6.193124598354461, 6.556302500767288, 6.916980047320382, 7.276461804173244, + 7.6344772701607315, 7.991669007379948, 8.34830486304816, 8.703291378118662, 9.056904851336473, + 9.411619705963231, 9.763427993562937, 10.117271295655764, 10.46686762035411, 10.818225893613956, + 11.170261715394957, 11.519827993775719, 11.869231719730976, 12.217483944213907, 12.916453948549925, + 13.613841821876068, 14.3096301674259, 15.004321373782643, 15.702430536445526, 16.399673721481037, + 17.096910013008056, 18.838849090737256, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ne21_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 8.685880952436747e-07, 2.4754079983896385e-05, + 0.0001901793368385613, 0.0007372402163824667, 0.0019404293040471109, 0.0040039218205739505, 0.007021925578680666, + 0.010986057727319889, 0.04118891376750491, 0.0777722105539352, 0.11230632139519969, 0.14260436993417835, + 0.16888829052162926, 0.19197861038694294, 0.2126999294489824, 0.23172922294680384, 0.2666728249346414, + 0.2996105757244402, 0.3321030146619489, 0.3650139334448046, 0.3988146649899236, 0.46982201597816303, + 0.546542663478131, 0.6283889300503115, 0.7176705030022621, 0.8142475957319202, 0.9180303367848801, + 1.0293837776852097, 1.14921911265538, 1.276461804173244, 1.4082399653118496, 1.760422483423212, + 2.1271047983648077, 2.499687082618404, 2.870403905279027, 3.2380461031287955, 3.603144372620182, + 3.9656719712201065, 4.326335860928752, 4.683947130751513, 5.041392685158225, 5.396199347095736, + 5.752048447819439, 6.107209969647869, 6.4623979978989565, 6.817565369559781, 7.173186268412274, + 7.5276299008713385, 7.8819549713396, 8.23552844690755, 8.5910646070265, 8.944975908412047, + 9.298853076409706, 9.653212513775344, 10.008600171761918, 10.361727836017593, 10.716837723299525, + 11.071882007306126, 11.424881636631067, 11.780317312140152, 12.133538908370218, 12.84447717574568, + 13.55509444857832, 14.267171728403014, 14.979548374704095, 15.693726948923647, 16.40823996531185, + 17.123851640967086, 18.923244018630278, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real na22_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 4.342942647204277e-07, 2.605759074128604e-06, 1.3028639028478182e-05, 4.559852671908958e-05, 0.00011984873864003521, + 0.0002626687122755098, 0.0029928105843703536, 0.010836979076306525, 0.02428653620880802, 0.04242704733870039, + 0.06402310268617777, 0.08796765614200239, 0.11338308526345184, 0.13961150376071624, 0.19275584832811385, + 0.2451455832343637, 0.2958922043442712, 0.3448263511644293, 0.39212883410565064, 0.48287358360875376, + 0.5717088318086876, 0.6627578316815741, 0.756636108245848, 0.8561244442423004, 0.9633155113861113, + 1.0791812460476249, 1.2013971243204515, 1.3283796034387378, 1.4638929889859074, 1.8215135284047732, + 2.1931245983544616, 2.5705429398818973, 2.9474337218870508, 3.322219294733919, 3.6954816764901977, + 4.068185861746161, 4.4361626470407565, 4.804820678721162, 5.173186268412274, 5.540329474790874, + 5.907411360774586, 6.27415784926368, 6.642464520242122, 7.008600171761918, 7.378397900948138, + 7.746634198937579, 8.113943352306837, 8.482873583608754, 8.851258348719075, 9.220108088040055, + 9.588831725594208, 9.957607287060096, 10.32633586092875, 10.695481676490198, 11.064457989226918, + 11.4345689040342, 11.80413943233535, 12.173186268412273, 12.544068044350276, 13.285557309007773, + 14.02938377768521, 14.773054693364262, 15.518513939877888, 16.264817823009537, 17.012837224705173, + 17.76492298464989, 19.64933485871214, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real na23_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 1.7371744532199383e-06, + 2.3885539658322847e-05, 0.00013113713282427166, 0.0004423207528904243, 0.0010999766245234136, 0.002232173197636284, + 0.003929471989446119, 0.021128907257497758, 0.0479649055541949, 0.07726249885377771, 0.10525805048344757, + 0.13079227003361296, 0.15390201926318714, 0.17503899265296466, 0.19472325248715508, 0.23147162936712465, + 0.26668504599022796, 0.3016913566252569, 0.33713446730536967, 0.37335950050705796, 0.4487063199050799, + 0.5314789170422551, 0.6211762817750351, 0.7218106152125465, 0.8344207036815325, 0.9590413923210935, + 1.0934216851622351, 1.2405492482825997, 1.3926969532596658, 1.5514499979728753, 1.9628426812012425, + 2.383815365980431, 2.803457115648414, 3.220108088040055, 3.6344772701607315, 4.045322978786658, + 4.453318340047038, 4.857935264719429, 5.26245108973043, 5.664641975556125, 6.064457989226918, + 6.466867620354109, 6.867467487859051, 7.267171728403014, 7.666517980554881, 8.064457989226918, + 8.463892988985908, 8.861534410859038, 9.260071387985075, 9.656098202012831, 10.05307844348342, + 10.450249108319362, 10.846337112129806, 11.243038048686294, 11.638489256954637, 12.03342375548695, + 12.429752280002408, 12.826074802700827, 13.222716471147583, 13.6170003411209, 14.40823996531185, + 15.20139712432045, 15.993876914941211, 16.787460474518415, 17.582063362911708, 18.378397900948137, + 19.17609125905568, 21.173186268412273, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real mg24_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 4.342942647204277e-07, 5.471765757979972e-05, 0.0007714899373308071, 0.0037633124724497633, 0.010764115210255056, + 0.022625058328435317, 0.039160607597355665, 0.05951911533271758, 0.08262238957783377, 0.13324118689139802, + 0.185518640557017, 0.2370005304649223, 0.2870228837145503, 0.3357157930198095, 0.43136376415898736, + 0.5263392773898441, 0.6253124509616739, 0.7307822756663892, 0.8463371121298052, 0.9749719942980689, + 1.1172712956557642, 1.2741578492636798, 1.4424797690644486, 1.6232492903979006, 2.103803720955957, + 2.598790506763115, 3.089905111439398, 3.577491799837225, 4.05307844348342, 4.52244423350632, + 4.984527313343793, 5.440909082065217, 5.894869656745253, 6.344392273685111, 6.791690649020118, + 7.235528446907549, 7.6785183790401135, 8.12057393120585, 8.558708570533165, 8.99563519459755, + 9.431363764158988, 9.866287339084195, 10.301029995663981, 10.732393759822969, 11.164352855784436, + 11.594392550375426, 12.02530586526477, 12.453318340047037, 12.881384656770573, 13.3096301674259, + 13.736396502276643, 14.161368002234974, 14.588831725594208, 15.012837224705173, 15.86569605991607, + 16.715167357848458, 17.56466606425209, 18.413299764081252, 19.26245108973043, 20.113943352306837, + 20.96284268120124, 23.089905111439396, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real al27_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 8.685880952436747e-07, 3.4743419578801875e-06, + 1.0422942490878872e-05, 0.00032429686817590634, 0.0018833542475028369, 0.005477808032249925, 0.011239204769804155, + 0.01890428637893266, 0.028126564553716336, 0.03862016194970278, 0.05018673657450416, 0.07608019569340022, + 0.10530099179798431, 0.13774106877747655, 0.1734986149135784, 0.21278880583973628, 0.30319605742048883, + 0.4099331233312945, 0.5352941200427705, 0.6794278966121189, 0.8394780473741984, 1.0128372247051722, + 1.1958996524092338, 1.3873898263387294, 1.5843312243675307, 1.783903579272735, 2.287801729930226, + 2.7944880466591697, 3.296665190261531, 3.7944880466591697, 4.2878017299302265, 4.779596491257824, + 5.269512944217916, 5.7558748556724915, 6.2405492482825995, 6.725094521081469, 7.209515014542631, + 7.691081492122969, 8.173186268412275, 8.653212513775344, 9.133538908370218, 9.611723308007342, + 10.089905111439398, 10.568201724066995, 11.045322978786658, 11.521138083704036, 11.997386384397313, + 12.472756449317213, 12.947923619831727, 13.423245873936807, 13.89707700320942, 14.371067862271737, + 14.845098040014257, 15.320146286111054, 15.79309160017658, 16.267171728403014, 17.214843848047696, + 18.161368002234976, 19.110589710299248, 20.060697840353612, 21.012837224705173, 21.96284268120124, + 22.915927211697117, 25.305351369446623, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real si28_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 2.1714669808675565e-06, 7.12184552784347e-05, 0.0005624812393818785, 0.002223099674110693, + 0.0059171580771474625, 0.012282407118825528, 0.02157709561709228, 0.03370716078346824, 0.06502557053071237, + 0.1027522772573885, 0.14387160800291654, 0.1866035043986153, 0.2302807913268337, 0.3222192947339193, + 0.42324587393680785, 0.541579243946581, 0.6839471307515121, 0.8518696007297664, 1.041392685158225, + 1.250420002308894, 1.4727564493172123, 1.7024305364455252, 1.9375178920173466, 2.531478917042255, + 3.12057393120585, 3.7024305364455254, 4.271841606536499, 4.834420703681532, 5.389166084364533, + 5.937517892017347, 6.481442628502305, 7.021189299069938, 7.557507201905658, 8.089905111439398, + 8.622214022966295, 9.14921911265538, 9.675778341674086, 10.198657086954423, 10.721810615212547, + 11.2405492482826, 11.75966784468963, 12.276461804173245, 12.791690649020119, 13.305351369446624, + 13.818225893613956, 14.330413773349191, 14.840733234611807, 15.350248018334163, 15.85913829729453, + 16.367355921026018, 16.8750612633917, 17.38201704257487, 17.88874096068289, 18.90036712865647, + 19.911157608739977, 20.921166050637737, 21.9304395947667, 22.93951925261862, 23.948901760970212, + 24.958563883221967, 27.48572142648158, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real p31_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 4.342942647204277e-07, 4.820401221806151e-05, 0.0005624812393818785, 0.002468018295084159, 0.006670091319158333, + 0.013688955408210905, 0.023674199668938998, 0.03655105068012579, 0.05215275629691826, 0.09085986215557586, + 0.13887811232360858, 0.19608052467040618, 0.26289299085539924, 0.33982852740425823, 0.5237464668115644, + 0.7419390777291989, 0.9827233876685453, 1.235528446907549, 1.4899584794248346, 1.7442929831226763, + 1.9960736544852753, 2.24551266781415, 2.4913616938342726, 2.733999286538387, 3.330413773349191, + 3.9132839017604186, 4.48572142648158, 5.049218022670182, 5.608526033577194, 6.164352855784437, + 6.714329759745233, 7.264817823009537, 7.812913356642856, 8.359835482339887, 8.90687353472207, + 9.453318340047037, 9.997823080745725, 10.54282542695918, 11.086359830674748, 11.629409599102718, + 12.170261715394957, 12.712649701627212, 13.255272505103306, 13.79448804665917, 14.334453751150932, + 14.874481817699467, 15.414973347970818, 15.953276336667304, 16.492760389026838, 17.029383777685208, + 17.570542939881896, 18.10720996964787, 18.64738297011462, 19.187520720836464, 20.264817823009537, + 21.342422680822207, 22.42160392686983, 23.503790683057183, 24.5854607295085, 25.66931688056611, + 26.75511226639507, 29.477121254719663, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real s32_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 5.211502513843472e-06, 6.948155872801059e-05, 0.0003893875360542875, + 0.001336870159627728, 0.003378232401258555, 0.006963377556787149, 0.012456734172197398, 0.03011415790845077, + 0.057484285853877215, 0.0950053699501746, 0.14295136988131382, 0.20165707691270435, 0.3521825181113625, + 0.5502283530550941, 0.787460474518415, 1.0569048513364727, 1.3404441148401183, 1.631443769013172, + 1.92272545799326, 2.2121876044039577, 2.4955443375464483, 2.7737864449811935, 3.44870631990508, + 4.096910013008056, 4.726727209026572, 5.3404441148401185, 5.944975908412048, 6.541579243946581, + 7.133538908370218, 7.720985744153739, 8.305351369446624, 8.888740960682892, 9.469822015978163, + 10.049218022670182, 10.628388930050312, 11.20682587603185, 11.78175537465247, 12.356025857193123, + 12.9304395947667, 13.502427119984432, 14.075546961392531, 14.645422269349092, 15.214843848047698, + 15.783903579272735, 16.352182518111363, 16.920123326290724, 17.487138375477187, 18.053078443483418, + 18.621176281775035, 19.187520720836464, 19.753583058892907, 20.318063334962762, 21.450249108319362, + 22.580924975675618, 23.71264970162721, 24.84385542262316, 25.976808337338067, 27.110589710299248, + 28.24551266781415, 31.08635983067475, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real cl35_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 1.8239985202970884e-05, 0.00020710907627919203, 0.0009431313908907785, 0.002698987769012708, + 0.005906875936599731, 0.010907713111778477, 0.017957319425972694, 0.027253766962590423, 0.0532486689285615, + 0.09021853774459236, 0.13964204799692437, 0.20296975189964023, 0.28111453407611076, 0.48000694295715063, + 0.7234556720351858, 0.9934362304976116, 1.2741578492636798, 1.5587085705331658, 1.841984804590114, + 2.123851640967086, 2.401400540781544, 2.678518379040114, 2.951823035315912, 3.6263403673750423, + 4.2878017299302265, 4.942008053022313, 5.588831725594207, 6.230448921378274, 6.870988813760575, + 7.509202522331103, 8.146128035678238, 8.781036938621131, 9.414973347970818, 10.049218022670182, + 10.681241237375588, 11.313867220369154, 11.943988875073773, 12.574031267727719, 13.204119982655925, + 13.831229693867064, 14.457881896733992, 15.086359830674748, 15.710963118995275, 16.33645973384853, + 16.96189547366785, 17.586587304671756, 18.212187604403958, 18.835056101720117, 19.45939248775923, + 20.08278537031645, 20.705863712283918, 21.33041377334919, 21.95375969173323, 23.20139712432045, + 24.450249108319362, 25.699837725867244, 26.950364854376122, 28.20139712432045, 29.456366033129044, + 30.71264970162721, 33.862131379313034, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ar36_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 4.342942647204277e-07, 2.3451268844214655e-05, 0.00023141729162330258, 0.0010622869460975197, + 0.0031540913067783544, 0.007135153007315866, 0.013474284663478431, 0.02245187936733961, 0.048771089883939175, + 0.08643600351808534, 0.13560900039779808, 0.1965840257248699, 0.2696980636423851, 0.45331834004703764, + 0.6848453616444125, 0.9585638832219674, 1.2624510897304295, 1.5809249756756194, 1.9057958803678685, + 2.230448921378274, 2.550228353055094, 2.8662873390841948, 3.1760912590556813, 3.929418925714293, + 4.657055852857104, 5.365487984890899, 6.060697840353612, 6.746634198937579, 7.426511261364575, + 8.100370545117563, 8.773054693364262, 9.442479769064448, 10.11058971029925, 10.77451696572855, + 11.437750562820387, 12.100370545117563, 12.758911892397974, 13.41664050733828, 14.071882007306126, + 14.727541257028557, 15.38201704257487, 16.03342375548695, 16.684845361644413, 17.33445375115093, + 17.983626287124533, 18.63144376901317, 19.27875360095283, 19.92582757462474, 20.57170883180869, + 21.217483944213907, 21.863322860120455, 22.50785587169583, 23.152288344383056, 24.440909082065218, + 25.72916478969277, 27.01703333929878, 28.305351369446623, 29.595496221825574, 30.885926339801433, + 32.17897694729317, 35.41329976408125, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real k39_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 3.908632748276029e-06, 3.4307908925770636e-05, + 0.00016282990201490303, 0.0005394928156396339, 0.0014074368520356395, 0.0031075244141559894, 0.010846721573671135, + 0.028297088943748088, 0.06095682921468604, 0.11414775667614005, 0.1912997955319451, 0.4132997640812518, + 0.7015679850559274, 1.0170333392987803, 1.3384564936046048, 1.6599162000698502, 1.9772662124272926, + 2.292256071356476, 2.6020599913279625, 2.910090545594068, 3.214843848047698, 3.9684829485539352, + 4.710963118995275, 5.444044795918076, 6.173186268412274, 6.897627091290442, 7.619093330626742, + 8.338456493604605, 9.056904851336473, 9.771587480881255, 10.48572142648158, 11.198657086954423, + 11.907948521612273, 12.6170003411209, 13.324282455297693, 14.02938377768521, 14.733999286538387, + 15.437750562820389, 16.139879086401237, 16.839478047374197, 17.539076098792776, 18.238046103128795, + 18.936513742478894, 19.633468455579585, 20.33041377334919, 21.02530586526477, 21.723455672035186, + 22.418301291319747, 23.113943352306837, 23.809559714635267, 24.505149978319906, 25.89542254603941, + 27.285557309007775, 28.678518379040113, 30.071882007306126, 31.465382851448418, 32.860936620700095, + 34.25767857486918, 37.761927838420526, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ca40_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 3.4743419578801875e-06, + 2.6056887215373325e-05, 0.00012419046343446514, 0.0004254001802063995, 0.0011532564515138494, 0.005324252203746658, + 0.016451245325404363, 0.03938040551055626, 0.07909980819723089, 0.13972800117379408, 0.33041377334919086, + 0.6063813651106049, 0.9385197251764918, 1.2988530764097066, 1.6693168805661123, 2.037426497940624, + 2.403120521175818, 2.761927838420529, 3.113943352306837, 3.459392487759231, 4.301029995663981, + 5.117271295655764, 5.9148718175400505, 6.701567985055927, 7.478566495593843, 8.250420002308894, + 9.01703333929878, 9.781036938621131, 10.540329474790873, 11.296665190261532, 12.049218022670182, + 12.801403710017356, 13.549003262025789, 14.294466226161592, 15.037426497940624, 15.779596491257825, + 16.518513939877888, 17.255272505103306, 17.99211148778695, 18.72591163229505, 19.45939248775923, + 20.19033169817029, 20.920645001406786, 21.650307523131936, 22.378397900948137, 23.10720996964787, + 23.832508912706235, 24.558708570533167, 25.285557309007775, 26.008600171761916, 27.45939248775923, + 28.907948521612273, 30.356025857193124, 31.804820678721164, 33.25285303097989, 34.704150516839796, + 36.15533603746506, 39.78816837114117, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real sc43_pf_array[npts_1] = { + 0.0, 1.7371744532199383e-06, 3.2136602621167924e-05, 0.0006088881229004689, 0.0026394223512168323, + 0.006348788305828209, 0.011375876688411647, 0.017242084547645732, 0.02355944464942603, 0.03006796257543875, + 0.03661053325876141, 0.06810122175372875, 0.09804672309111766, 0.12848424511267922, 0.16058766813472455, + 0.1946644458530261, 0.23055748142930874, 0.26792627543589265, 0.3064134462100847, 0.3856843680943845, + 0.4672642331672854, 0.5514418243762168, 0.6393550853495756, 0.732465412501299, 0.9380190974762103, + 1.1760912590556813, 1.4456042032735976, 1.7371926427047373, 2.0453229787866576, 2.359835482339888, + 2.678518379040114, 3.0, 3.322219294733919, 3.6424645202421213, 4.439332693830263, + 5.230448921378274, 6.017033339298781, 6.8020892578817325, 7.585460729508501, 8.36735592102602, + 9.14921911265538, 9.929418925714293, 10.710117365111817, 11.489958479424836, 12.267171728403014, + 13.045322978786658, 13.822168079368018, 14.597695185925513, 15.371067862271737, 16.146128035678238, + 16.916453948549925, 17.687528961214635, 18.45788189673399, 19.227886704613674, 19.99694924849538, + 20.76492298464989, 21.532754378992497, 22.30102999566398, 23.068185861746162, 23.835690571492425, + 24.602059991327963, 25.369215857410143, 26.136720567156406, 26.903632516084237, 28.439332693830263, + 29.97497199429807, 31.511883360978874, 33.05307844348342, 34.59217675739587, 36.13672056715641, + 37.68214507637383, 41.55870857053316, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ti44_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 4.342942647204277e-07, 1.7371744532199383e-06, + 7.382943437485089e-06, 0.0004987179011085028, 0.004043078170724821, 0.01413521502778782, 0.032426549056877405, + 0.05856115101668825, 0.09131586357749837, 0.1294359425571275, 0.17190802974603506, 0.2667731684215763, + 0.37035022176288673, 0.47788465213962983, 0.5860935485551829, 0.693748838923791, 0.9116901587538612, + 1.1522883443830565, 1.4409090820652177, 1.7788744720027396, 2.1522883443830563, 2.5415792439465807, + 2.9334872878487053, 3.322219294733919, 3.7041505168397992, 4.079181246047625, 4.996073654485276, + 5.885361220031512, 6.757396028793024, 7.619093330626742, 8.472756449317213, 9.32221929473392, + 10.167317334748176, 11.008600171761918, 11.85003325768977, 12.687528961214634, 13.52244423350632, + 14.354108439147401, 15.1846914308176, 16.012837224705173, 16.836956737059552, 17.65991620006985, + 18.481442628502304, 19.298853076409706, 20.117271295655765, 20.9329808219232, 21.746634198937578, + 22.559906625036113, 23.371067862271737, 24.181843587944773, 24.991226075692495, 25.799340549453582, + 26.60745502321467, 27.414973347970818, 28.220108088040057, 29.02530586526477, 30.63748972951251, + 32.247973266361804, 33.8561244442423, 35.46538285144842, 37.07554696139253, 38.68484536164441, + 40.29666519026153, 44.33041377334919, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real v47_pf_array[npts_1] = { + 2.518834949526704e-05, 0.0007584840322833457, 0.004226764680268442, 0.024475815916759104, 0.05998274311239668, + 0.10280266491559079, 0.14672973694476377, 0.1885209834473098, 0.22688178294786615, 0.2615226538586488, + 0.29260868165003595, 0.4071409645052156, 0.48021742410342627, 0.5329079468954852, 0.5750746363992424, + 0.6115960803783954, 0.6450760714077263, 0.6770396273057074, 0.708482088001612, 0.7725618227871047, + 0.8417322779915452, 0.9194240819892174, 1.0083997539725875, 1.110602503281611, 1.3560258571931227, + 1.651278013998144, 1.9813655090785445, 2.330413773349191, 2.6884198220027105, 3.0492180226701815, + 3.41161970596323, 3.7708520116421442, 4.127104798364807, 4.484299839346786, 5.365487984890899, + 6.238046103128795, 7.103803720955957, 7.967547976218862, 8.830588668685145, 9.69460519893357, + 10.557507201905658, 11.421603926869832, 12.285557309007773, 13.146128035678238, 14.008600171761918, + 14.869231719730976, 15.728353782021228, 16.586587304671756, 17.442479769064448, 18.298853076409706, + 19.152288344383056, 20.00432137378264, 20.85793526471943, 21.70926996097583, 22.559906625036113, + 23.409933123331296, 24.260071387985075, 25.10720996964787, 25.956648579205204, 26.804820678721164, + 27.652246341003323, 28.50105926221775, 29.34830486304816, 30.195899652409235, 31.891537457672566, + 33.588831725594204, 35.28555730900777, 36.985875357308394, 38.68752896121463, 40.39093510710338, + 42.096910013008056, 46.372912002970104, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real cr48_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 8.685880952436747e-07, 8.251516766996927e-06, 3.951899976600419e-05, 0.00013330794422173613, + 0.00035120219371925, 0.006401856055765157, 0.02685304570895992, 0.06215311825135839, 0.10696594975266842, + 0.15598699109465686, 0.205815844445829, 0.25471214514215257, 0.30198352738731143, 0.39152612205819926, + 0.47640596203905256, 0.5602400543128645, 0.6474755901642433, 0.7433846322638775, 0.983175072037813, + 1.3096301674258988, 1.7067177823367587, 2.1398790864012365, 2.577491799837225, 3.012837224705172, + 3.437750562820388, 3.8549130223078554, 4.264817823009537, 4.666517980554881, 5.648360010980932, + 6.606381365110605, 7.550228353055094, 8.484299839346786, 9.414973347970818, 10.340444114840118, + 11.264817823009537, 12.1846914308176, 13.103803720955957, 14.021189299069938, 14.935003151453655, + 15.846337112129806, 16.75511226639507, 17.66181268553726, 18.565847818673518, 19.468347330412158, + 20.369215857410143, 21.267171728403014, 22.161368002234976, 23.056904851336473, 23.94939000664491, + 24.840733234611807, 25.73078227566639, 26.619093330626743, 27.50785587169583, 28.394451680826215, + 29.281033367247726, 30.164352855784436, 31.049218022670182, 31.934498451243567, 33.70156798505593, + 35.46834733041216, 37.23299611039215, 38.99913054128737, 40.764922984649886, 42.5327543789925, + 44.30102999566398, 48.727541257028555, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real mn51_pf_array[npts_1] = { + 0.0, 0.0, 4.342942647204277e-07, 6.0362737871404116e-05, 0.0005954436481690331, + 0.002352703452491265, 0.0058636025937444025, 0.011219737158250306, 0.018191443590229183, 0.026405776501228783, + 0.035473365577059296, 0.08393991903492294, 0.12694077261184436, 0.16267998396542166, 0.19356340377635362, + 0.22185561141496238, 0.2491212785730439, 0.27638918590325057, 0.30436276263857276, 0.36442247019537943, + 0.4326074417788097, 0.5117005179251304, 0.6041057952026397, 0.7115562776994953, 0.9717395908877782, + 1.287801729930226, 1.640481436970422, 2.0170333392987803, 2.403120521175818, 2.7944880466591697, + 3.1903316981702914, 3.5854607295085006, 3.9827233876685453, 4.380211241711606, 5.372912002970106, + 6.363611979892144, 7.354108439147401, 8.342422680822207, 9.328379603438737, 10.311753861055754, + 11.292256071356476, 12.269512944217917, 13.24551266781415, 14.214843848047698, 15.1846914308176, + 16.14921911265538, 17.110589710299248, 18.071882007306126, 19.029383777685208, 19.985426474083003, + 20.93851972517649, 21.88986172125819, 22.839478047374197, 23.787460474518415, 24.73399928653839, + 25.67942789661212, 26.6232492903979, 27.56702636615906, 28.5092025223311, 29.45178643552429, + 30.392696953259666, 31.33445375115093, 32.27415784926368, 33.2148438480477, 35.093421685162234, + 36.97451169273733, 38.8555191556678, 40.737192642704734, 42.620136054973756, 44.505149978319906, + 46.392696953259666, 51.12057393120585, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real mn55_pf_array[npts_1] = { + 4.342942647204277e-07, 3.387364853334388e-05, 0.00038895363056868775, 0.004419831370155497, 0.014756522503960728, + 0.030096733930175052, 0.04796879437078968, 0.06646457923244158, 0.08445866292767418, 0.10139372238408119, + 0.1170521039752435, 0.17736880968990507, 0.2173557426191723, 0.247461626286143, 0.27333907966395066, + 0.29784648633228855, 0.3224882671969808, 0.3481517618665124, 0.3754616886642864, 0.43708831382108987, + 0.5113111854322745, 0.6017866255084809, 0.7113195335442632, 0.8411244873729985, 1.1553360374650619, + 1.5289167002776547, 1.931457870689005, 2.3502480183341627, 2.7781512503836434, 3.2068258760318495, + 3.639486489268586, 4.071882007306125, 4.505149978319906, 4.937016107464814, 6.017033339298781, + 7.096910013008056, 8.176091259055681, 9.252853030979892, 10.324282455297693, 11.394451680826217, + 12.460897842756548, 13.523746466811565, 14.583198773968622, 15.638489256954637, 16.69108149212297, + 17.73878055848437, 18.783903579272735, 19.826074802700827, 20.864511081058392, 21.90091306773767, + 22.935003151453653, 23.966610986681935, 24.996073654485276, 26.02530586526477, 27.049218022670182, + 28.07554696139253, 29.096910013008056, 30.12057393120585, 31.139879086401237, 32.16136800223497, + 33.18184358794477, 34.20139712432045, 35.22010808804006, 36.238046103128795, 38.27415784926368, + 40.311753861055756, 42.34830486304816, 44.38560627359831, 46.426511261364574, 48.46686762035411, + 50.51054501020661, 55.632457292184725, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real fe52_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 1.7371744532199383e-06, 9.554373504133797e-06, 3.778197643341552e-05, + 0.00011333607006293108, 0.0030242952161453874, 0.015422212189991184, 0.040215337130588114, 0.07478865660777631, + 0.11488541698288196, 0.15714990338033966, 0.19960737134331175, 0.24132628928072955, 0.3217032118192907, + 0.3993396534463543, 0.4778337814344742, 0.5623989859221217, 0.6594581913549248, 0.9153998352122699, + 1.2695129442179163, 1.6910814921229684, 2.143014800254095, 2.6009728956867484, 3.0569048513364727, + 3.503790683057181, 3.946452265013073, 4.383815365980431, 4.818225893613955, 5.888740960682893, + 6.944482672150168, 7.989894563718773, 9.02938377768521, 10.060697840353612, 11.086359830674748, + 12.11058971029925, 13.127104798364808, 14.139879086401237, 15.14921911265538, 16.152288344383056, + 17.152288344383056, 18.14921911265538, 19.143014800254097, 20.133538908370216, 21.12057393120585, + 22.103803720955955, 23.08635983067475, 24.06445798922692, 25.041392685158225, 26.01703333929878, + 26.989449817666692, 27.960946195733833, 28.930949031167522, 29.899273187317604, 30.8668778143375, + 31.833784374656478, 32.79934054945358, 33.76417613239033, 34.72835378202123, 36.655138434811384, + 38.58092497567562, 40.505149978319906, 42.42975228000241, 44.3541084391474, 46.28103336724773, + 48.20682587603185, 53.02938377768521, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real fe53_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 1.3028814913777444e-06, 6.080080186165502e-06, 2.0411360986187104e-05, + 5.384917717601842e-05, 0.00099773035779373, 0.004491618246634796, 0.011583129716232713, 0.02260939259680282, + 0.037536053829818145, 0.056184239286028684, 0.07836255359576534, 0.10393433162264984, 0.16508072986206487, + 0.2398955676994077, 0.3292351155694239, 0.43390673907557786, 0.5541592859186848, 0.8375884382355113, + 1.1702617153949575, 1.5314789170422551, 1.9148718175400503, 2.3096301674258988, 2.710963118995276, + 3.1172712956557644, 3.5276299008713385, 3.940516484932567, 4.3560258571931225, 5.396199347095736, + 6.440909082065217, 7.48572142648158, 8.52762990087134, 9.564666064252089, 10.597695185925513, + 11.626340367375043, 12.650307523131936, 13.669316880566113, 14.683947130751513, 15.69460519893357, + 16.700703717145018, 17.7041505168398, 18.70329137811866, 19.699837725867244, 20.693726948923647, + 21.684845361644413, 22.67394199863409, 23.65991620006985, 24.64542226934909, 25.62838893005031, + 26.60959440922522, 27.589949601325706, 28.569373909615045, 29.547774705387823, 30.525044807036846, + 31.50105926221775, 32.47712125471966, 33.45331834004704, 34.428134794028786, 36.37839790094814, + 38.32837960343874, 40.27875360095283, 42.230448921378276, 44.1846914308176, 46.13987908640124, + 48.096910013008056, 52.99956548822598, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real fe54_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 4.038750882690593e-05, 0.0006153933644858295, 0.0031795285189803882, 0.009608097244673557, + 0.021489478918632662, 0.039963481298721557, 0.06578505049986659, 0.09933285917375559, 0.18904568529064877, + 0.30450216050560097, 0.4386136969546961, 0.5858349639065905, 0.7435112541834851, 1.089905111439398, + 1.4727564493172123, 1.8864907251724818, 2.320146286111054, 2.760422483423212, 3.204119982655925, + 3.6503075231319366, 4.093421685162235, 4.539076098792776, 4.982271233039568, 6.089905111439398, + 7.190331698170292, 8.287801729930226, 9.378397900948137, 10.462397997898956, 11.539076098792776, + 12.61066016308988, 13.675778341674086, 14.734799829588846, 15.789580712164426, 16.838219221907625, + 17.88252453795488, 18.922206277439017, 19.957607287060096, 20.989449817666692, 22.01703333929878, + 23.041392685158225, 24.06445798922692, 25.08278537031645, 26.100370545117563, 27.113943352306837, + 28.127104798364808, 29.136720567156406, 30.146128035678238, 31.155336037465062, 32.16136800223497, + 33.164352855784436, 34.17026171539496, 35.17318626841227, 36.17609125905568, 38.17897694729317, + 40.18184358794477, 42.18184358794477, 44.18184358794477, 46.1846914308176, 48.1846914308176, + 50.18752072083646, 55.204119982655925, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real fe55_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 1.3028814913777444e-06, + 1.5634319932414176e-05, 7.599488497457784e-05, 0.0002370600756061832, 0.0005564089438241259, 0.0010813488014597976, + 0.0018431377713960377, 0.009434322601068017, 0.022947317188587973, 0.04207202183227031, 0.06669370834774807, + 0.09644559083435453, 0.13073538555922604, 0.1689268514992448, 0.210470482925873, 0.30216484315823844, + 0.40437472924396634, 0.5173772341350337, 0.6421575367181118, 0.7795497407641858, 1.089905111439398, + 1.4471580313422192, 1.8312296938670634, 2.2355284469075487, 2.649334858712142, 3.0718820073061255, + 3.496929648073215, 3.926856708949692, 4.359835482339888, 4.79309160017658, 5.8819549713396, + 6.973589623427257, 8.064457989226918, 9.14921911265538, 10.232996110392154, 11.307496037913213, + 12.378397900948137, 13.444044795918076, 14.503790683057181, 15.558708570533165, 16.608526033577196, + 17.65417654187796, 18.69635638873333, 19.73399928653839, 20.768638101247614, 21.800029359244135, + 22.82865989653532, 23.854913022307855, 24.878521795501207, 25.899820502427097, 26.91960102378411, + 27.937517892017347, 28.954242509439325, 29.96941591235398, 30.983626287124533, 31.99694924849538, + 33.00860017176192, 34.02118929906994, 35.03342375548695, 36.04532297878666, 38.064457989226916, + 40.086359830674745, 42.10720996964787, 44.127104798364805, 46.15228834438306, 48.17609125905568, + 50.20139712432045, 55.28103336724773, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real fe56_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 1.7371744532199383e-06, 9.988658214691801e-06, 3.951899976600419e-05, + 0.00011724368292883856, 0.0030902761496993327, 0.0156878675130911, 0.04089651650139037, 0.07635858866725904, + 0.11828391003740016, 0.16392102383975418, 0.21196213905930564, 0.2621108778253895, 0.36964919324674056, + 0.4887648498436591, 0.6206486780522652, 0.76578080127876, 0.924731337394998, 1.2855573090077739, + 1.6972293427597176, 2.143014800254095, 2.606381365110605, 3.0718820073061255, 3.5403294747908736, + 4.004321373782642, 4.468347330412158, 4.928395852256714, 5.38738982633873, 6.5276299008713385, + 7.660865478003869, 8.788168371141168, 9.909556029241175, 11.02530586526477, 12.136720567156408, + 13.2405492482826, 14.340444114840118, 15.432969290874405, 16.52244423350632, 17.606381365110604, + 18.686636269262294, 19.76192783842053, 20.833147111912787, 21.90036712865647, 22.96473092105363, + 24.02530586526477, 25.08278537031645, 26.139879086401237, 27.193124598354462, 28.243038048686294, + 29.292256071356476, 30.338456493604603, 31.383815365980432, 32.428134794028786, 33.46982201597816, + 34.51188336097887, 35.552668216112195, 36.59217675739587, 37.631443769013174, 39.70842090013471, + 41.78390357927273, 43.85913829729453, 45.93449845124357, 48.00860017176192, 50.086359830674745, + 52.164352855784436, 57.37106786227174, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real co55_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 8.685880952436747e-07, 1.4331481434642371e-05, 9.336327741651445e-05, + 0.00038114325769492564, 0.001151090732337307, 0.0028275866787247843, 0.0059861278100218065, 0.019727612600003865, + 0.049238961363648255, 0.10167663281566902, 0.18228879723157643, 0.29243817096179087, 0.5865873046717549, + 0.9449759084120479, 1.3324384599156054, 1.7363965022766423, 2.1492191126553797, 2.56702636615906, + 2.991226075692495, 3.419955748489758, 3.851869600729766, 4.2878017299302265, 5.382017042574868, + 6.482873583608754, 7.5820633629117085, 8.677606952720494, 9.767155866082181, 10.85003325768977, + 11.927370363039023, 12.998695158311655, 14.064457989226918, 15.127104798364808, 16.181843587944773, + 17.232996110392154, 18.281033367247726, 19.32428245529769, 20.3654879848909, 21.401400540781545, + 22.436162647040756, 23.468347330412158, 24.4983105537896, 25.525044807036846, 26.550228353055093, + 27.57403126772772, 28.59659709562646, 29.6170003411209, 30.636487896353366, 31.65609820201283, + 32.673941998634085, 33.69108149212297, 34.70757017609794, 35.72427586960079, 37.75587485567249, + 39.786751422145564, 41.818225893613956, 43.850033257689766, 45.88309335857569, 47.91750550955255, + 49.954242509439325, 55.05690485133647, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real co56_pf_array[npts_1] = { + 0.0, 1.7371744532199383e-06, 3.4307908925770636e-05, 0.0007363730997827178, 0.003397192878964486, + 0.008467734331585224, 0.01550645173957485, 0.0238164702394971, 0.03279759856010612, 0.04203693696495622, + 0.05128645751287552, 0.09519865223967466, 0.13622861655702886, 0.176714169466867, 0.21729965897649603, + 0.2578772011708393, 0.2983265845453606, 0.3387098245578885, 0.3792523836931725, 0.46216521358362883, + 0.5500314690476197, 0.6456769741905006, 0.7513340033440492, 0.8684365267163909, 1.1367205671564067, + 1.4517864355242902, 1.7986506454452689, 2.1702617153949575, 2.5599066250361124, 2.9614210940664485, + 3.3729120029701067, 3.7902851640332416, 4.214843848047698, 4.6414741105041, 5.723455672035186, + 6.814913181275074, 7.9084850188786495, 9.0, 10.089905111439398, 11.173186268412275, + 12.250420002308894, 13.32633586092875, 14.394451680826217, 15.459392487759231, 16.521138083704038, + 17.577491799837226, 18.630427875025024, 19.680335513414562, 20.727541257028555, 21.77232170672292, + 22.81358098856819, 23.853089529851864, 24.890979596989688, 25.926856708949693, 26.960946195733833, + 27.99387691494121, 29.02530586526477, 30.056904851336473, 31.08635983067475, 32.11727129565576, + 33.14612803567824, 34.17318626841227, 35.20139712432045, 36.230448921378276, 38.28555730900777, + 40.3424226808222, 42.39967372148104, 44.45939248775923, 46.52113808370404, 48.5854607295085, + 50.651278013998144, 55.831229693867066, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real co57_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 4.342942647204277e-07, 4.994099386680048e-05, 0.0005963110461953748, 0.0027783956198411766, 0.008035647971175024, + 0.017613403025029208, 0.03234391616743567, 0.05264970241280307, 0.07864673504318612, 0.14731854080928636, + 0.23700682147881122, 0.34629017327562855, 0.47392017252998775, 0.6185154181425263, 0.9503648543761231, + 1.3263358609287514, 1.7299742856995557, 2.1492191126553797, 2.57978359661681, 3.0170333392987803, + 3.456366033129043, 3.900913067737669, 4.348304863048161, 4.795880017344075, 5.922206277439017, + 7.05307844348342, 8.178976947293169, 9.30319605742049, 10.423245873936807, 11.537819095073274, + 12.64640372622307, 13.751279103983343, 14.850646235183067, 15.94546858513182, 17.037426497940622, + 18.12057393120585, 19.204119982655925, 20.28330122870355, 21.357934847000454, 22.431363764158988, + 23.50105926221775, 24.568201724066995, 25.632457292184725, 26.69635638873333, 27.757396028793025, + 28.81690383937566, 29.87563993700417, 30.93247376467715, 31.989004615698537, 33.04532297878666, + 34.10037054511756, 35.15228834438306, 36.20682587603185, 37.26007138798507, 39.3654879848909, + 41.47275644931721, 43.578639209968074, 45.686636269262294, 47.79657433321043, 49.90794852161227, + 52.02118929906994, 57.31806333496276, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ni56_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 4.342942647204277e-07, 7.817230319428646e-06, 6.42708273977769e-05, + 0.0002904458650804842, 0.0009123622824012837, 0.0022498876258026487, 0.0046944487518873, 0.014735532704563181, + 0.03529042138996706, 0.07190703372466718, 0.13162956968664008, 0.22190042758492473, 0.5092025223311029, + 0.9132839017604184, 1.374748346010104, 1.8555191556678001, 2.3404441148401185, 2.8221680793680175, + 3.3031960574204886, 3.783903579272735, 4.26245108973043, 4.7419390777291985, 5.9344984512435675, + 7.117271295655764, 8.292256071356476, 9.456366033129044, 10.608526033577194, 11.750508394851346, + 12.88309335857569, 14.008600171761918, 15.123851640967086, 16.232996110392154, 17.33645973384853, + 18.432969290874407, 19.525044807036846, 20.612783856719737, 21.695481676490196, 22.773786444981194, + 23.8481891169914, 24.919078092376076, 25.987219229908003, 27.053078443483418, 28.113943352306837, + 29.17609125905568, 30.232996110392154, 31.287801729930226, 32.3424226808222, 33.39619934709574, + 34.44715803134222, 35.49692964807321, 36.54530711646582, 37.594392550375424, 39.68752896121463, + 41.77959649125783, 43.86981820797933, 45.959518376973, 48.04921802267018, 50.13987908640124, + 52.230448921378276, 57.462397997898954, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ni57_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 4.342942647204277e-07, 1.7371744532199383e-06, 9.554373504133797e-06, 3.257086475060328e-05, + 8.771862606148251e-05, 0.0017410663385697559, 0.007809206274475302, 0.01921477477459369, 0.03493231633712192, + 0.05345799700199783, 0.07364137994668778, 0.0948950837519807, 0.11713833477999397, 0.16608656859343765, + 0.22565890312281184, 0.3025878355093501, 0.4025382106894563, 0.5279492540555757, 0.8463371121298052, + 1.2253092817258628, 1.631443769013172, 2.05307844348342, 2.484299839346786, 2.9237619608287004, + 3.369215857410143, 3.8188854145940097, 4.27415784926368, 4.731588765186738, 5.884795363948981, + 7.041392685158225, 8.195899652409233, 9.344392273685111, 10.482873583608754, 11.613841821876068, + 12.736396502276643, 13.851258348719075, 14.959041392321094, 16.060697840353612, 17.15836249209525, + 18.247973266361807, 19.332438459915604, 20.414973347970818, 21.492760389026838, 22.565847818673518, + 23.636487896353366, 24.7041505168398, 25.768638101247614, 26.831229693867062, 27.89209460269048, + 28.950851458888547, 30.008600171761916, 31.06445798922692, 32.11727129565576, 33.17026171539496, + 34.222716471147585, 35.27415784926368, 36.32633586092875, 37.376576957056514, 39.478566495593846, + 41.578639209968074, 43.67851837904011, 45.77959649125783, 47.88252453795488, 49.98721922990801, + 52.093421685162234, 57.372912002970104, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real ni58_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 2.822822391636452e-05, 0.0004722555358597003, 0.0025858928325085315, 0.008151594991554035, + 0.018820703394680185, 0.03585661791649524, 0.060127596252288286, 0.09212527438468374, 0.17939292292561174, + 0.29475734836761314, 0.43276876399762537, 0.5886922364625494, 0.7597527315231631, 1.1398790864012365, + 1.5670263661590604, 2.0211892990699383, 2.4913616938342726, 2.968015713993642, 3.4471580313422194, + 3.9253120914996495, 4.4048337166199385, 4.884795363948981, 5.363611979892144, 6.561101383649056, + 7.754348335711019, 8.94101424370557, 10.12057393120585, 11.290034611362518, 12.45178643552429, + 13.60530504614111, 14.752048447819439, 15.89209460269048, 17.02530586526477, 18.155336037465062, + 19.276461804173245, 20.394451680826215, 21.50650503240487, 22.6159500516564, 23.72098574415374, + 24.822168079368016, 25.920123326290724, 27.01703333929878, 28.10720996964787, 29.198657086954423, + 30.285557309007775, 31.371067862271737, 32.456366033129044, 33.539076098792776, 34.620136054973756, + 35.70070371714502, 36.78031731214015, 37.85853719756964, 38.936513742478894, 41.0899051114394, + 43.243038048686294, 45.39619934709574, 47.549003262025785, 49.70156798505593, 51.8561244442423, + 54.01283722470517, 59.41161970596323, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real cu59_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 2.605759074128604e-06, 1.650287675964334e-05, 6.340236609775624e-05, 0.00017585365720844043, 0.000390689249910088, + 0.0007428764320814314, 0.005397605476010478, 0.015802627271542913, 0.03197570643412326, 0.05338618387681151, + 0.07956831941607957, 0.11034623515591226, 0.1458282690543422, 0.18630242506533595, 0.2835775511211497, + 0.4040800579842662, 0.5475464254977157, 0.71148885462942, 0.8921585172262729, 1.2855573090077739, + 1.7075701760979363, 2.143014800254095, 2.5888317255942073, 3.037426497940624, 3.4913616938342726, + 3.9479236198317262, 4.4048337166199385, 4.865103974641128, 5.324282455297693, 6.480006942957151, + 7.6344772701607315, 8.788168371141168, 9.939019776448667, 11.086359830674748, 12.227886704613674, + 13.36735592102602, 14.501059262217751, 15.630427875025024, 16.75587485567249, 17.877946951629188, + 18.99563519459755, 20.110589710299248, 21.22271647114758, 22.33041377334919, 23.436162647040756, + 24.540329474790873, 25.6414741105041, 26.741151598851786, 27.838849090737256, 28.934498451243567, + 30.029383777685208, 31.123851640967086, 32.2148438480477, 33.30749603791321, 34.39967372148104, + 35.489958479424836, 36.58092497567562, 37.67117284271508, 38.76042248342321, 40.940516484932566, + 43.12057393120585, 45.303196057420486, 47.48572142648158, 49.67117284271508, 51.85913829729453, + 54.04921802267018, 59.54032947479087, + }; + + // this is log10(partition function) + + MICROPHYSICS_UNUSED HIP_CONSTEXPR static AMREX_GPU_MANAGED amrex::Real zn60_pf_array[npts_1] = { + 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 8.685880952436747e-07, 5.211502513843472e-06, + 1.8674261228107377e-05, 0.0009166960915506938, 0.006364623716448546, 0.020197147995473213, 0.043233346133400956, + 0.07391108301493142, 0.10997790066148228, 0.14954178751803532, 0.19143452549394308, 0.2810122204570727, + 0.3812506749896455, 0.4993433592273684, 0.6430235987933117, 0.8169781794613935, 1.2479732663618066, + 1.7512791039833422, 2.2764618041732443, 2.8055008581584002, 3.3283796034387376, 3.845098040014257, + 4.354108439147401, 4.859138297294531, 5.357934847000454, 5.854913022307856, 7.08278537031645, + 8.301029995663981, 9.509202522331103, 10.710117365111817, 11.90471554527868, 13.093421685162236, + 14.278753600952829, 15.457881896733992, 16.63144376901317, 17.800717078282386, 18.965671971220107, + 20.127104798364808, 21.28330122870355, 22.436162647040756, 23.5854607295085, 24.73158876518674, + 25.8750612633917, 27.01703333929878, 28.152288344383056, 29.29003461136252, 30.423245873936807, + 31.55509444857832, 32.68574173860226, 33.814913181275074, 34.94250410616808, 36.06818586174616, + 37.19589965240923, 38.320146286111054, 39.444044795918074, 40.568201724066995, 42.814913181275074, + 45.06069784035361, 47.30749603791321, 49.552668216112195, 51.80071707828238, 54.04921802267018, + 56.30102999566398, 61.93851972517649, + }; + + + + // interpolation routine + + template + AMREX_GPU_HOST_DEVICE AMREX_INLINE + void interpolate_pf(const Real t9, const Real (&temp_array)[npts], const Real (&pf_array)[npts], + Real& pf, Real& dpf_dT) { + + if (t9 >= temp_array[0] && t9 < temp_array[npts-1]) { + + // find the largest temperature element <= t9 using a binary search + + int left = 0; + int right = npts; + + while (left < right) { + int mid = (left + right) / 2; + if (temp_array[mid] > t9) { + right = mid; + } else { + left = mid + 1; + } + } + + const int idx = right - 1; + + // now we have temp_array[idx] <= t9 < temp_array[idx+1] + + // construct the slope -- this is (log10(pf_{i+1}) - log10(pf_i)) / (T_{i+1} - T_i) + + Real slope = (pf_array[idx+1] - pf_array[idx]) / (temp_array[idx+1] - temp_array[idx]); + + // find the PF + + Real log10_pf = pf_array[idx] + slope * (t9 - temp_array[idx]); + pf = std::pow(10.0_rt, log10_pf); + + // find the derivative (with respect to T, not T9) + + Real dpf_dT9 = pf * M_LN10 * slope; + dpf_dT = dpf_dT9 / 1.e9_rt; + + } else { + + // T < the smallest T or >= the largest T in the partition function table + pf = 1.0; + dpf_dT = 0.0; + + } + + } + +} + +// main interface + +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void get_partition_function(const int inuc, [[maybe_unused]] const tf_t& tfactors, + Real& pf, Real& dpf_dT) { + + // inuc is the 1-based index for the species + + switch (inuc) { + + case O16: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::o16_pf_array, pf, dpf_dT); + break; + + case F18: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::f18_pf_array, pf, dpf_dT); + break; + + case Ne20: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ne20_pf_array, pf, dpf_dT); + break; + + case Ne21: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ne21_pf_array, pf, dpf_dT); + break; + + case Na22: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::na22_pf_array, pf, dpf_dT); + break; + + case Na23: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::na23_pf_array, pf, dpf_dT); + break; + + case Mg24: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::mg24_pf_array, pf, dpf_dT); + break; + + case Al27: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::al27_pf_array, pf, dpf_dT); + break; + + case Si28: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::si28_pf_array, pf, dpf_dT); + break; + + case P31: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::p31_pf_array, pf, dpf_dT); + break; + + case S32: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::s32_pf_array, pf, dpf_dT); + break; + + case Cl35: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::cl35_pf_array, pf, dpf_dT); + break; + + case Ar36: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ar36_pf_array, pf, dpf_dT); + break; + + case K39: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::k39_pf_array, pf, dpf_dT); + break; + + case Ca40: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ca40_pf_array, pf, dpf_dT); + break; + + case Sc43: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::sc43_pf_array, pf, dpf_dT); + break; + + case Ti44: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ti44_pf_array, pf, dpf_dT); + break; + + case V47: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::v47_pf_array, pf, dpf_dT); + break; + + case Cr48: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::cr48_pf_array, pf, dpf_dT); + break; + + case Mn51: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::mn51_pf_array, pf, dpf_dT); + break; + + case Mn55: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::mn55_pf_array, pf, dpf_dT); + break; + + case Fe52: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::fe52_pf_array, pf, dpf_dT); + break; + + case Fe53: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::fe53_pf_array, pf, dpf_dT); + break; + + case Fe54: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::fe54_pf_array, pf, dpf_dT); + break; + + case Fe55: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::fe55_pf_array, pf, dpf_dT); + break; + + case Fe56: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::fe56_pf_array, pf, dpf_dT); + break; + + case Co55: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::co55_pf_array, pf, dpf_dT); + break; + + case Co56: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::co56_pf_array, pf, dpf_dT); + break; + + case Co57: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::co57_pf_array, pf, dpf_dT); + break; + + case Ni56: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ni56_pf_array, pf, dpf_dT); + break; + + case Ni57: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ni57_pf_array, pf, dpf_dT); + break; + + case Ni58: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::ni58_pf_array, pf, dpf_dT); + break; + + case Cu59: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::cu59_pf_array, pf, dpf_dT); + break; + + case Zn60: + part_fun::interpolate_pf(tfactors.T9, part_fun::temp_array_1, part_fun::zn60_pf_array, pf, dpf_dT); + break; + + + default: + + pf = 1.0_rt; + dpf_dT = 0.0_rt; + + } + +} + +// spins + +AMREX_GPU_HOST_DEVICE AMREX_INLINE +constexpr Real get_spin_state(const int inuc) { + + Real spin = -1.0; + + switch (inuc) { + + case He4: + case C12: + case O16: + case Ne20: + case Mg24: + case Si28: + case S32: + case Ar36: + case Ca40: + case Ti44: + case Cr48: + case Fe52: + case Fe54: + case Fe56: + case Ni56: + case Ni58: + case Zn60: + spin = 1; + break; + + case N: + case H1: + case N13: + case P31: + spin = 2; + break; + + case N14: + case F18: + spin = 3; + break; + + case Ne21: + case Na23: + case Fe55: + case Ni57: + case Cu59: + case Cl35: + case K39: + case V47: + spin = 4; + break; + + case Al27: + case Mn51: + case Mn55: + spin = 6; + break; + + case Na22: + spin = 7; + break; + + case Fe53: + case Co55: + case Co57: + case Sc43: + spin = 8; + break; + + case Co56: + spin = 9; + break; + + + } + + return spin; + +} + + +#endif diff --git a/networks/He-C-Fe-group/pynucastro.net b/networks/He-C-Fe-group/pynucastro.net new file mode 100644 index 0000000000..70dad9af7b --- /dev/null +++ b/networks/He-C-Fe-group/pynucastro.net @@ -0,0 +1,40 @@ +neutron n 1.0 0.0 +hydrogen-1 h1 1.0 1.0 +helium-4 he4 4.0 2.0 +carbon-12 c12 12.0 6.0 +nitrogen-13 n13 13.0 7.0 +nitrogen-14 n14 14.0 7.0 +oxygen-16 o16 16.0 8.0 +fluorine-18 f18 18.0 9.0 +neon-20 ne20 20.0 10.0 +neon-21 ne21 21.0 10.0 +sodium-22 na22 22.0 11.0 +sodium-23 na23 23.0 11.0 +magnesium-24 mg24 24.0 12.0 +aluminum-27 al27 27.0 13.0 +silicon-28 si28 28.0 14.0 +phosphorus-31 p31 31.0 15.0 +sulfur-32 s32 32.0 16.0 +argon-36 ar36 36.0 18.0 +calcium-40 ca40 40.0 20.0 +titanium-44 ti44 44.0 22.0 +chromium-48 cr48 48.0 24.0 +manganese-51 mn51 51.0 25.0 +manganese-55 mn55 55.0 25.0 +iron-52 fe52 52.0 26.0 +iron-53 fe53 53.0 26.0 +iron-54 fe54 54.0 26.0 +iron-55 fe55 55.0 26.0 +iron-56 fe56 56.0 26.0 +cobalt-55 co55 55.0 27.0 +cobalt-56 co56 56.0 27.0 +cobalt-57 co57 57.0 27.0 +nickel-56 ni56 56.0 28.0 +nickel-57 ni57 57.0 28.0 +nickel-58 ni58 58.0 28.0 +copper-59 cu59 59.0 29.0 +zinc-60 zn60 60.0 30.0 +__extra_chlorine-35 cl35 35.0 17.0 +__extra_potassium-39 k39 39.0 19.0 +__extra_scandium-43 sc43 43.0 21.0 +__extra_vanadium-47 v47 47.0 23.0 diff --git a/networks/He-C-Fe-group/reaclib_rates.H b/networks/He-C-Fe-group/reaclib_rates.H new file mode 100644 index 0000000000..b8a5a86910 --- /dev/null +++ b/networks/He-C-Fe-group/reaclib_rates.H @@ -0,0 +1,9303 @@ +#ifndef REACLIB_RATES_H +#define REACLIB_RATES_H + +#include +#include + +#include +#include +#include + +using namespace Rates; +using namespace Species; + +struct rate_t { + Array1D screened_rates; + Array1D add_energy_rate; +}; + +struct rate_derivs_t { + Array1D screened_rates; + Array1D dscreened_rates_dT; + Array1D add_energy_rate; +}; + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_c12_to_n13(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 + p --> n13 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ls09n + ln_set_rate = 17.1482 + -13.692 * tfactors.T913i + -0.230881 * tfactors.T913 + + 4.44362 * tfactors.T9 + -3.15898 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -13.692 * tfactors.T943i + (1.0/3.0) * -0.230881 * tfactors.T923i + + 4.44362 + (5.0/3.0) * -3.15898 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // ls09r + ln_set_rate = 17.5428 + -3.77849 * tfactors.T9i + -5.10735 * tfactors.T913i + -2.24111 * tfactors.T913 + + 0.148883 * tfactors.T9 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.77849 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.10735 * tfactors.T943i + (1.0/3.0) * -2.24111 * tfactors.T923i + + 0.148883 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_c12_to_o16(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 + he4 --> o16 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // nac2 + ln_set_rate = 254.634 + -1.84097 * tfactors.T9i + 103.411 * tfactors.T913i + -420.567 * tfactors.T913 + + 64.0874 * tfactors.T9 + -12.4624 * tfactors.T953 + 137.303 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.84097 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 103.411 * tfactors.T943i + (1.0/3.0) * -420.567 * tfactors.T923i + + 64.0874 + (5.0/3.0) * -12.4624 * tfactors.T923 + 137.303 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nac2 + ln_set_rate = 69.6526 + -1.39254 * tfactors.T9i + 58.9128 * tfactors.T913i + -148.273 * tfactors.T913 + + 9.08324 * tfactors.T9 + -0.541041 * tfactors.T953 + 70.3554 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.39254 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 58.9128 * tfactors.T943i + (1.0/3.0) * -148.273 * tfactors.T923i + + 9.08324 + (5.0/3.0) * -0.541041 * tfactors.T923 + 70.3554 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_n14_to_f18(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // n14 + he4 --> f18 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10n + ln_set_rate = 21.5339 + -36.2504 * tfactors.T913i + + -5.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -36.2504 * tfactors.T943i + + (5.0/3.0) * -5.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 13.8995 + -10.9656 * tfactors.T9i + -5.6227 * tfactors.T913i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 10.9656 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.6227 * tfactors.T943i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 0.196838 + -5.16034 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.16034 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_o16_to_ne20(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + he4 --> ne20 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // co10r + ln_set_rate = 9.50848 + -12.7643 * tfactors.T9i + -3.65925 * tfactors.T913 + + 0.714224 * tfactors.T9 + -0.00107508 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.7643 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -3.65925 * tfactors.T923i + + 0.714224 + (5.0/3.0) * -0.00107508 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // co10r + ln_set_rate = 3.88571 + -10.3585 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 10.3585 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // co10n + ln_set_rate = 23.903 + -39.7262 * tfactors.T913i + -0.210799 * tfactors.T913 + + 0.442879 * tfactors.T9 + -0.0797753 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.7262 * tfactors.T943i + (1.0/3.0) * -0.210799 * tfactors.T923i + + 0.442879 + (5.0/3.0) * -0.0797753 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_f18_to_na22(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // f18 + he4 --> na22 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // rpsmr + ln_set_rate = 35.3786 + -1.82957 * tfactors.T9i + 18.8956 * tfactors.T913i + -65.6134 * tfactors.T913 + + 1.71114 * tfactors.T9 + -0.0260999 * tfactors.T953 + 37.8396 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.82957 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 18.8956 * tfactors.T943i + (1.0/3.0) * -65.6134 * tfactors.T923i + + 1.71114 + (5.0/3.0) * -0.0260999 * tfactors.T923 + 37.8396 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ne20_to_mg24(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ne20 + he4 --> mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -38.7055 + -2.50605 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.50605 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 24.5058 + -46.2525 * tfactors.T913i + 5.58901 * tfactors.T913 + + 7.61843 * tfactors.T9 + -3.683 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -46.2525 * tfactors.T943i + (1.0/3.0) * 5.58901 * tfactors.T923i + + 7.61843 + (5.0/3.0) * -3.683 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -8.79827 + -12.7809 * tfactors.T9i + 16.9229 * tfactors.T913 + + -2.57325 * tfactors.T9 + 0.208997 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.7809 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 16.9229 * tfactors.T923i + + -2.57325 + (5.0/3.0) * 0.208997 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 1.98307 + -9.22026 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 9.22026 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_ne21_to_na22(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ne21 + p --> na22 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -47.6554 + -0.19618 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.19618 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 19.0696 + -19.2096 * tfactors.T913i + + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -19.2096 * tfactors.T943i + + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -39.4862 + -4.21385 * tfactors.T9i + 21.1176 * tfactors.T913i + 34.0411 * tfactors.T913 + + -4.45593 * tfactors.T9 + 0.328613 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.21385 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.1176 * tfactors.T943i + (1.0/3.0) * 34.0411 * tfactors.T923i + + -4.45593 + (5.0/3.0) * 0.328613 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 1.75704 + -1.39957 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.39957 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_na23_to_mg24(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // na23 + p --> mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10n + ln_set_rate = 18.9075 + -20.6428 * tfactors.T913i + 1.52954 * tfactors.T913 + + 2.7487 * tfactors.T9 + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -20.6428 * tfactors.T943i + (1.0/3.0) * 1.52954 * tfactors.T923i + + 2.7487 + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 9.0594 + -3.28029 * tfactors.T9i + -0.360588 * tfactors.T913 + + 1.4187 * tfactors.T9 + -0.184061 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.28029 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.360588 * tfactors.T923i + + 1.4187 + (5.0/3.0) * -0.184061 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -5.02585 + -1.61219 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.61219 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_mg24_to_si28(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mg24 + he4 --> si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // st08r + ln_set_rate = -50.5494 + -12.8332 * tfactors.T9i + 21.3721 * tfactors.T913i + 37.7649 * tfactors.T913 + + -4.10635 * tfactors.T9 + 0.249618 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.8332 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.3721 * tfactors.T943i + (1.0/3.0) * 37.7649 * tfactors.T923i + + -4.10635 + (5.0/3.0) * 0.249618 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // st08r + ln_set_rate = 8.03977 + -15.629 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 15.629 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_al27_to_si28(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // al27 + p --> si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -13.6664 + -1.90396 * tfactors.T9i + 23.8634 * tfactors.T913 + + -3.70135 * tfactors.T9 + 0.28964 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.90396 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 23.8634 * tfactors.T923i + + -3.70135 + (5.0/3.0) * 0.28964 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 86.0234 + -0.387313 * tfactors.T9i + -26.8327 * tfactors.T913i + -116.137 * tfactors.T913 + + 0.00950567 * tfactors.T9 + 0.00999755 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.387313 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -26.8327 * tfactors.T943i + (1.0/3.0) * -116.137 * tfactors.T923i + + 0.00950567 + (5.0/3.0) * 0.00999755 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 21.1065 + -23.2205 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -23.2205 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_si28_to_s32(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // si28 + he4 --> s32 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 47.9212 + -59.4896 * tfactors.T913i + 4.47205 * tfactors.T913 + + -4.78989 * tfactors.T9 + 0.557201 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -59.4896 * tfactors.T943i + (1.0/3.0) * 4.47205 * tfactors.T923i + + -4.78989 + (5.0/3.0) * 0.557201 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_p31_to_s32(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // p31 + p --> s32 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = 0.821556 + -3.77704 * tfactors.T9i + 8.09341 * tfactors.T913 + + -0.615971 * tfactors.T9 + 0.031159 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.77704 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 8.09341 * tfactors.T923i + + -0.615971 + (5.0/3.0) * 0.031159 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -2.66839 + -2.25958 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.25958 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 19.2596 + -25.3278 * tfactors.T913i + 6.4931 * tfactors.T913 + + -9.27513 * tfactors.T9 + -0.610439 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -25.3278 * tfactors.T943i + (1.0/3.0) * 6.4931 * tfactors.T923i + + -9.27513 + (5.0/3.0) * -0.610439 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_cr48_to_fe52(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cr48 + he4 --> fe52 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 65.1754 + -86.7459 * tfactors.T913i + -9.79373 * tfactors.T913 + + -0.772169 * tfactors.T9 + 0.155883 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * -9.79373 * tfactors.T923i + + -0.772169 + (5.0/3.0) * 0.155883 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_mn51_to_fe52(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn51 + p --> fe52 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.2596 + -36.1825 * tfactors.T913i + 0.873042 * tfactors.T913 + + -2.89731 * tfactors.T9 + 0.364394 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -36.1825 * tfactors.T943i + (1.0/3.0) * 0.873042 * tfactors.T923i + + -2.89731 + (5.0/3.0) * 0.364394 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_mn51_to_co55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn51 + he4 --> co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 65.9219 + -89.274 * tfactors.T913i + -10.4373 * tfactors.T913 + + 1.00492 * tfactors.T9 + -0.125548 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -10.4373 * tfactors.T923i + + 1.00492 + (5.0/3.0) * -0.125548 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe52_to_ni56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe52 + he4 --> ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 66.6417 + -91.6819 * tfactors.T913i + -9.51885 * tfactors.T913 + + -0.533014 * tfactors.T9 + 0.0892607 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -9.51885 * tfactors.T923i + + -0.533014 + (5.0/3.0) * 0.0892607 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co55_to_ni56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + p --> ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 37.3736 + -38.1053 * tfactors.T913i + -0.210947 * tfactors.T913 + + -2.68377 * tfactors.T9 + 0.355814 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1053 * tfactors.T943i + (1.0/3.0) * -0.210947 * tfactors.T923i + + -2.68377 + (5.0/3.0) * 0.355814 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_co55_to_cu59(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + he4 --> cu59 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 65.2921 + -94.1404 * tfactors.T913i + -2.62786 * tfactors.T913 + + -2.12066 * tfactors.T9 + 0.237999 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * -2.62786 * tfactors.T923i + + -2.12066 + (5.0/3.0) * 0.237999 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ni56_to_zn60(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 + he4 --> zn60 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 61.0733 + -96.4898 * tfactors.T913i + 6.47209 * tfactors.T913 + + -5.2029 * tfactors.T9 + 0.533391 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -96.4898 * tfactors.T943i + (1.0/3.0) * 6.47209 * tfactors.T923i + + -5.2029 + (5.0/3.0) * 0.533391 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_cu59_to_zn60(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cu59 + p --> zn60 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 37.226 + -39.9808 * tfactors.T913i + 1.17311 * tfactors.T913 + + -2.90486 * tfactors.T9 + 0.339644 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 1.17311 * tfactors.T923i + + -2.90486 + (5.0/3.0) * 0.339644 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_c12_to_p_na23(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 + c12 --> p + na23 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 60.9649 + -84.165 * tfactors.T913i + -1.4191 * tfactors.T913 + + -0.114619 * tfactors.T9 + -0.070307 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -84.165 * tfactors.T943i + (1.0/3.0) * -1.4191 * tfactors.T923i + + -0.114619 + (5.0/3.0) * -0.070307 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_c12_to_he4_ne20(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 + c12 --> he4 + ne20 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 61.2863 + -84.165 * tfactors.T913i + -1.56627 * tfactors.T913 + + -0.0736084 * tfactors.T9 + -0.072797 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -84.165 * tfactors.T943i + (1.0/3.0) * -1.56627 * tfactors.T923i + + -0.0736084 + (5.0/3.0) * -0.072797 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_n13_to_p_o16(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // n13 + he4 --> p + o16 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88n + ln_set_rate = 40.4644 + -35.829 * tfactors.T913i + -0.530275 * tfactors.T913 + + -0.982462 * tfactors.T9 + 0.0808059 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -35.829 * tfactors.T943i + (1.0/3.0) * -0.530275 * tfactors.T923i + + -0.982462 + (5.0/3.0) * 0.0808059 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_o16_to_p_al27(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + c12 --> p + al27 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 68.5253 + 0.205134 * tfactors.T9i + -119.242 * tfactors.T913i + 13.3667 * tfactors.T913 + + 0.295425 * tfactors.T9 + -0.267288 * tfactors.T953 + -9.91729 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.205134 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -119.242 * tfactors.T943i + (1.0/3.0) * 13.3667 * tfactors.T923i + + 0.295425 + (5.0/3.0) * -0.267288 * tfactors.T923 + -9.91729 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_o16_to_he4_mg24(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + c12 --> he4 + mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 48.5341 + 0.37204 * tfactors.T9i + -133.413 * tfactors.T913i + 50.1572 * tfactors.T913 + + -3.15987 * tfactors.T9 + 0.0178251 * tfactors.T953 + -23.7027 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.37204 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -133.413 * tfactors.T943i + (1.0/3.0) * 50.1572 * tfactors.T923i + + -3.15987 + (5.0/3.0) * 0.0178251 * tfactors.T923 + -23.7027 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_o16_o16_to_p_p31(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + o16 --> p + p31 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 85.2628 + 0.223453 * tfactors.T9i + -145.844 * tfactors.T913i + 8.72612 * tfactors.T913 + + -0.554035 * tfactors.T9 + -0.137562 * tfactors.T953 + -6.88807 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.223453 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -145.844 * tfactors.T943i + (1.0/3.0) * 8.72612 * tfactors.T923i + + -0.554035 + (5.0/3.0) * -0.137562 * tfactors.T923 + -6.88807 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_o16_o16_to_he4_si28(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + o16 --> he4 + si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 97.2435 + -0.268514 * tfactors.T9i + -119.324 * tfactors.T913i + -32.2497 * tfactors.T913 + + 1.46214 * tfactors.T9 + -0.200893 * tfactors.T953 + 13.2148 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.268514 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -119.324 * tfactors.T943i + (1.0/3.0) * -32.2497 * tfactors.T923i + + 1.46214 + (5.0/3.0) * -0.200893 * tfactors.T923 + 13.2148 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_f18_to_p_ne21(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // f18 + he4 --> p + ne21 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // rpsmr + ln_set_rate = 49.7863 + -1.84559 * tfactors.T9i + 21.4461 * tfactors.T913i + -73.252 * tfactors.T913 + + 2.42329 * tfactors.T9 + -0.077278 * tfactors.T953 + 40.7604 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.84559 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.4461 * tfactors.T943i + (1.0/3.0) * -73.252 * tfactors.T923i + + 2.42329 + (5.0/3.0) * -0.077278 * tfactors.T923 + 40.7604 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_na23_to_he4_ne20(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // na23 + p --> he4 + ne20 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -6.58736 + -2.31577 * tfactors.T9i + 19.7297 * tfactors.T913 + + -2.20987 * tfactors.T9 + 0.153374 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.31577 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 19.7297 * tfactors.T923i + + -2.20987 + (5.0/3.0) * 0.153374 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = 0.0178295 + -1.86103 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.86103 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 18.9756 + -20.0024 * tfactors.T913i + 11.5988 * tfactors.T913 + + -1.37398 * tfactors.T9 + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -20.0024 * tfactors.T943i + (1.0/3.0) * 11.5988 * tfactors.T923i + + -1.37398 + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_al27_to_he4_mg24(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // al27 + p --> he4 + mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -7.02789 + -4.2425 * tfactors.T9i + 18.0416 * tfactors.T913 + + -1.54137 * tfactors.T9 + 0.0847506 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.2425 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0416 * tfactors.T923i + + -1.54137 + (5.0/3.0) * 0.0847506 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -26.8683 + -0.963012 * tfactors.T9i + 5.18642 * tfactors.T913i + -34.7936 * tfactors.T913 + + 168.225 * tfactors.T9 + -115.825 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.963012 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 5.18642 * tfactors.T943i + (1.0/3.0) * -34.7936 * tfactors.T923i + + 168.225 + (5.0/3.0) * -115.825 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 29.4576 + -26.4162 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -26.4162 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_p31_to_he4_si28(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // p31 + p --> he4 + si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -10.893 + -3.42575 * tfactors.T9i + 21.521 * tfactors.T913 + + -1.90355 * tfactors.T9 + 0.092724 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.42575 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 21.521 * tfactors.T923i + + -1.90355 + (5.0/3.0) * 0.092724 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -12.919 + -1.87716 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.87716 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 60.8829 + -31.932 * tfactors.T913i + -77.0334 * tfactors.T913 + + -43.6847 * tfactors.T9 + -4.28955 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -31.932 * tfactors.T943i + (1.0/3.0) * -77.0334 * tfactors.T923i + + -43.6847 + (5.0/3.0) * -4.28955 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_cr48_to_p_mn51(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cr48 + he4 --> p + mn51 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 59.2276 + -86.7459 * tfactors.T913i + 1.05653 * tfactors.T913 + + -1.15757 * tfactors.T9 + 0.0877546 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * 1.05653 * tfactors.T923i + + -1.15757 + (5.0/3.0) * 0.0877546 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe52_to_p_co55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe52 + he4 --> p + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 62.2207 + -91.6819 * tfactors.T913i + -0.329235 * tfactors.T913 + + -0.780924 * tfactors.T9 + 0.0425179 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -0.329235 * tfactors.T923i + + -0.780924 + (5.0/3.0) * 0.0425179 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_cu59_to_he4_ni56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cu59 + p --> he4 + ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.7688 + -39.9808 * tfactors.T913i + 13.6773 * tfactors.T913 + + -3.76429 * tfactors.T9 + 0.438096 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 13.6773 * tfactors.T923i + + -3.76429 + (5.0/3.0) * 0.438096 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_he4_he4_to_c12(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // he4 + he4 + he4 --> c12 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // fy05r + ln_set_rate = -24.3505 + -4.12656 * tfactors.T9i + -13.49 * tfactors.T913i + 21.4259 * tfactors.T913 + + -1.34769 * tfactors.T9 + 0.0879816 * tfactors.T953 + -13.1653 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 4.12656 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -13.49 * tfactors.T943i + (1.0/3.0) * 21.4259 * tfactors.T923i + + -1.34769 + (5.0/3.0) * 0.0879816 * tfactors.T923 + -13.1653 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // fy05r + ln_set_rate = -11.7884 + -1.02446 * tfactors.T9i + -23.57 * tfactors.T913i + 20.4886 * tfactors.T913 + + -12.9882 * tfactors.T9 + -20.0 * tfactors.T953 + -2.16667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.02446 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -23.57 * tfactors.T943i + (1.0/3.0) * 20.4886 * tfactors.T923i + + -12.9882 + (5.0/3.0) * -20.0 * tfactors.T923 + -2.16667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // fy05n + ln_set_rate = -0.971052 + -37.06 * tfactors.T913i + 29.3493 * tfactors.T913 + + -115.507 * tfactors.T9 + -10.0 * tfactors.T953 + -1.33333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.06 * tfactors.T943i + (1.0/3.0) * 29.3493 * tfactors.T923i + + -115.507 + (5.0/3.0) * -10.0 * tfactors.T923 + -1.33333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_c12_to_mg24_modified(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 + c12 --> mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = -12.8056 + -30.1498 * tfactors.T9i + 11.4826 * tfactors.T913 + + 1.82849 * tfactors.T9 + -0.34844 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 30.1498 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 11.4826 * tfactors.T923i + + 1.82849 + (5.0/3.0) * -0.34844 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_o16_o16_to_s32_modified(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + o16 --> s32 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = 77.5491 + -0.373641 * tfactors.T9i + -120.83 * tfactors.T913i + -7.72334 * tfactors.T913 + + -2.27939 * tfactors.T9 + 0.167655 * tfactors.T953 + 7.62001 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.373641 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -120.83 * tfactors.T943i + (1.0/3.0) * -7.72334 * tfactors.T923i + + -2.27939 + (5.0/3.0) * 0.167655 * tfactors.T923 + 7.62001 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_o16_to_si28_modified(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + c12 --> si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88r + ln_set_rate = -132.213 + -1.46479 * tfactors.T9i + -293.089 * tfactors.T913i + 414.404 * tfactors.T913 + + -28.0562 * tfactors.T9 + 1.61807 * tfactors.T953 + -178.28 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.46479 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -293.089 * tfactors.T943i + (1.0/3.0) * 414.404 * tfactors.T923i + + -28.0562 + (5.0/3.0) * 1.61807 * tfactors.T923 + -178.28 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_to_p_weak_wc12(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // n --> p + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // wc12w + ln_set_rate = -6.78161; + amrex::ignore_unused(tfactors); + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.0; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_mn55_to_fe56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn55 + p --> fe56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.1888 + -36.1995 * tfactors.T913i + 1.15346 * tfactors.T913 + + -1.94437 * tfactors.T9 + 0.218429 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -36.1995 * tfactors.T943i + (1.0/3.0) * 1.15346 * tfactors.T923i + + -1.94437 + (5.0/3.0) * 0.218429 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_fe52_to_fe53(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe52 + n --> fe53 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 15.8885 + -0.344319 * tfactors.T913 + + 0.178277 * tfactors.T9 + -0.0334326 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -0.344319 * tfactors.T923i + + 0.178277 + (5.0/3.0) * -0.0334326 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_fe53_to_fe54(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe53 + n --> fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 16.4534 + -1.10421 * tfactors.T913 + + 0.379905 * tfactors.T9 + -0.0581878 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.10421 * tfactors.T923i + + 0.379905 + (5.0/3.0) * -0.0581878 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe53_to_ni57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe53 + he4 --> ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 69.0636 + -91.7231 * tfactors.T913i + -10.1816 * tfactors.T913 + + -0.0406303 * tfactors.T9 + 0.0345056 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * -10.1816 * tfactors.T923i + + -0.0406303 + (5.0/3.0) * 0.0345056 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_fe54_to_fe55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + n --> fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ks03 + ln_set_rate = -0.80864 + 0.0591716 * tfactors.T9i + -8.66617 * tfactors.T913i + 26.4472 * tfactors.T913 + + -1.9222 * tfactors.T9 + 0.0986404 * tfactors.T953 + -9.78317 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.0591716 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -8.66617 * tfactors.T943i + (1.0/3.0) * 26.4472 * tfactors.T923i + + -1.9222 + (5.0/3.0) * 0.0986404 * tfactors.T923 + -9.78317 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe54_to_co55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + p --> co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.2304 + -37.1544 * tfactors.T913i + 0.950364 * tfactors.T913 + + -1.77529 * tfactors.T9 + 0.198562 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.1544 * tfactors.T943i + (1.0/3.0) * 0.950364 * tfactors.T923i + + -1.77529 + (5.0/3.0) * 0.198562 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe54_to_ni58(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + he4 --> ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 60.2478 + -91.7628 * tfactors.T913i + 4.23027 * tfactors.T913 + + -3.31305 * tfactors.T9 + 0.271293 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.7628 * tfactors.T943i + (1.0/3.0) * 4.23027 * tfactors.T923i + + -3.31305 + (5.0/3.0) * 0.271293 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_fe55_to_fe56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 + n --> fe56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ks03 + ln_set_rate = 21.7202 + -0.0955677 * tfactors.T9i + 8.06062 * tfactors.T913i + -14.4809 * tfactors.T913 + + 0.94252 * tfactors.T9 + -0.0776007 * tfactors.T953 + 6.47093 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.0955677 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 8.06062 * tfactors.T943i + (1.0/3.0) * -14.4809 * tfactors.T923i + + 0.94252 + (5.0/3.0) * -0.0776007 * tfactors.T923 + 6.47093 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe55_to_co56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 + p --> co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 35.7333 + -37.1585 * tfactors.T913i + 1.66198 * tfactors.T913 + + -1.60842 * tfactors.T9 + 0.148916 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.1585 * tfactors.T943i + (1.0/3.0) * 1.66198 * tfactors.T923i + + -1.60842 + (5.0/3.0) * 0.148916 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe56_to_co57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe56 + p --> co57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.0665 + -37.1625 * tfactors.T913i + 1.06776 * tfactors.T913 + + -1.31689 * tfactors.T9 + 0.122089 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -37.1625 * tfactors.T943i + (1.0/3.0) * 1.06776 * tfactors.T923i + + -1.31689 + (5.0/3.0) * 0.122089 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_co55_to_co56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + n --> co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 17.065 + -1.86357 * tfactors.T913 + + 0.616591 * tfactors.T9 + -0.0839313 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.86357 * tfactors.T923i + + 0.616591 + (5.0/3.0) * -0.0839313 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_co56_to_co57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + n --> co57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 17.3552 + -1.37855 * tfactors.T913 + + 0.299896 * tfactors.T9 + -0.04382 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.37855 * tfactors.T923i + + 0.299896 + (5.0/3.0) * -0.04382 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co56_to_ni57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + p --> ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 35.5937 + -38.1094 * tfactors.T913i + 2.57091 * tfactors.T913 + + -2.07795 * tfactors.T9 + 0.20757 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1094 * tfactors.T943i + (1.0/3.0) * 2.57091 * tfactors.T923i + + -2.07795 + (5.0/3.0) * 0.20757 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co57_to_ni58(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co57 + p --> ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.0159 + -38.1133 * tfactors.T913i + 1.77414 * tfactors.T913 + + -1.48268 * tfactors.T9 + 0.121073 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 1.77414 * tfactors.T923i + + -1.48268 + (5.0/3.0) * 0.121073 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni56_to_ni57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 + n --> ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 16.0765 + -1.19665 * tfactors.T913 + + 0.507179 * tfactors.T9 + -0.074604 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.19665 * tfactors.T923i + + 0.507179 + (5.0/3.0) * -0.074604 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni57_to_ni58(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 + n --> ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 17.2731 + -1.90814 * tfactors.T913 + + 0.493188 * tfactors.T9 + -0.0684633 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.90814 * tfactors.T923i + + 0.493188 + (5.0/3.0) * -0.0684633 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_ni58_to_cu59(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 + p --> cu59 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // si13n + ln_set_rate = 36.6662 + -39.0526 * tfactors.T913i + 1.0436 * tfactors.T913 + + -2.10834 * tfactors.T9 + 0.239559 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -39.0526 * tfactors.T943i + (1.0/3.0) * 1.0436 * tfactors.T923i + + -2.10834 + (5.0/3.0) * 0.239559 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_mn51_to_p_fe54(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn51 + he4 --> p + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 62.2777 + -89.274 * tfactors.T913i + -0.862452 * tfactors.T913 + + -0.635672 * tfactors.T9 + 0.0196464 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -0.862452 * tfactors.T923i + + -0.635672 + (5.0/3.0) * 0.0196464 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe53_to_p_co56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe53 + he4 --> p + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 54.8614 + -91.7231 * tfactors.T913i + 10.052 * tfactors.T913 + + -3.86332 * tfactors.T9 + 0.391105 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * 10.052 * tfactors.T923i + + -3.86332 + (5.0/3.0) * 0.391105 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_fe55_to_p_mn55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 + n --> p + mn55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 4.70639 + 7.03052 * tfactors.T913 + + 0.260509 * tfactors.T9 + -0.0813397 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 7.03052 * tfactors.T923i + + 0.260509 + (5.0/3.0) * -0.0813397 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_co55_to_p_fe55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + n --> p + fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.7398 + -1.62382 * tfactors.T913 + + 0.58115 * tfactors.T9 + -0.0537057 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.62382 * tfactors.T923i + + 0.58115 + (5.0/3.0) * -0.0537057 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_co55_to_p_ni58(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + he4 --> p + ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 60.2281 + -94.1404 * tfactors.T913i + 3.39179 * tfactors.T913 + + -1.71062 * tfactors.T9 + 0.133003 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * 3.39179 * tfactors.T923i + + -1.71062 + (5.0/3.0) * 0.133003 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_co56_to_p_fe56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + n --> p + fe56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.4539 + -1.13331 * tfactors.T913 + + 0.347185 * tfactors.T9 + -0.0328879 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.13331 * tfactors.T923i + + 0.347185 + (5.0/3.0) * -0.0328879 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co57_to_he4_fe54(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co57 + p --> he4 + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -2.1962 + -38.1133 * tfactors.T913i + 29.3541 * tfactors.T913 + + -4.75966 * tfactors.T9 + 0.40418 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 29.3541 * tfactors.T923i + + -4.75966 + (5.0/3.0) * 0.40418 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni56_to_p_co56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 + n --> p + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 15.5693 + 1.76846 * tfactors.T913 + + 0.197992 * tfactors.T9 + -0.017494 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 1.76846 * tfactors.T923i + + 0.197992 + (5.0/3.0) * -0.017494 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni56_to_he4_fe53(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 + n --> he4 + fe53 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -7.84393 + 6.43259 * tfactors.T913 + + 2.29591 * tfactors.T9 + -0.254724 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 6.43259 * tfactors.T923i + + 2.29591 + (5.0/3.0) * -0.254724 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni57_to_p_co57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 + n --> p + co57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 19.9939 + -1.13177 * tfactors.T913 + + 0.56875 * tfactors.T9 + -0.0579913 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.13177 * tfactors.T923i + + 0.56875 + (5.0/3.0) * -0.0579913 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni57_to_he4_fe54(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 + n --> he4 + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 14.5327 + 0.48562 * tfactors.T913 + + -0.0249302 * tfactors.T9 + 0.0509605 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 0.48562 * tfactors.T923i + + -0.0249302 + (5.0/3.0) * 0.0509605 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_ni58_to_he4_fe55(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 + n --> he4 + fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -2.03901 + 3.44996 * tfactors.T913 + + 2.98226 * tfactors.T9 + -0.387699 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 3.44996 * tfactors.T923i + + 2.98226 + (5.0/3.0) * -0.387699 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_cu59_to_he4_co56(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cu59 + n --> he4 + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 11.0108 + -1.00882 * tfactors.T913 + + 1.88993 * tfactors.T9 + -0.202319 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * -1.00882 * tfactors.T923i + + 1.88993 + (5.0/3.0) * -0.202319 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n_zn60_to_he4_ni57(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // zn60 + n --> he4 + ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 12.4241 + 5.43552 * tfactors.T913 + + -1.25169 * tfactors.T9 + 0.148383 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + (1.0/3.0) * 5.43552 * tfactors.T923i + + -1.25169 + (5.0/3.0) * 0.148383 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_s32_to_ar36_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // s32 + he4 --> ar36 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 48.901 + -65.3709 * tfactors.T913i + 5.68294 * tfactors.T913 + + -5.00388 * tfactors.T9 + 0.571407 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -65.3709 * tfactors.T943i + (1.0/3.0) * 5.68294 * tfactors.T923i + + -5.00388 + (5.0/3.0) * 0.571407 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_cl35_to_ar36_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cl35 + p --> ar36 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = -9.03294 + -2.00996 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.00996 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -42.5249 + -0.564651 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.564651 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 35.6868 + -27.8971 * tfactors.T913i + -16.2304 * tfactors.T913 + + 35.255 * tfactors.T9 + -25.8411 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -27.8971 * tfactors.T943i + (1.0/3.0) * -16.2304 * tfactors.T923i + + 35.255 + (5.0/3.0) * -25.8411 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -7.84699 + -3.65092 * tfactors.T9i + 18.0179 * tfactors.T913 + + -2.86304 * tfactors.T9 + 0.250854 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.65092 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0179 * tfactors.T923i + + -2.86304 + (5.0/3.0) * 0.250854 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_cl35_to_he4_s32_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cl35 + p --> he4 + s32 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10r + ln_set_rate = 2.29121 + -6.00976 * tfactors.T9i + 5.33756 * tfactors.T913 + + 1.64418 * tfactors.T9 + -0.246167 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.00976 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 5.33756 * tfactors.T923i + + 1.64418 + (5.0/3.0) * -0.246167 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -1.01202 + -3.93495 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 3.93495 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10r + ln_set_rate = -57.5294 + -0.532931 * tfactors.T9i + 25.5338 * tfactors.T913 + + 6.45824 * tfactors.T9 + -0.950294 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.532931 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 25.5338 * tfactors.T923i + + 6.45824 + (5.0/3.0) * -0.950294 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10n + ln_set_rate = 32.12 + -30.9147 * tfactors.T913i + -1.2345 * tfactors.T913 + + 22.5118 * tfactors.T9 + -33.0589 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -30.9147 * tfactors.T943i + (1.0/3.0) * -1.2345 * tfactors.T923i + + 22.5118 + (5.0/3.0) * -33.0589 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ar36_to_ca40_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ar36 + he4 --> ca40 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 52.3486 + -71.0046 * tfactors.T913i + 4.0656 * tfactors.T913 + + -5.26509 * tfactors.T9 + 0.683546 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -71.0046 * tfactors.T943i + (1.0/3.0) * 4.0656 * tfactors.T923i + + -5.26509 + (5.0/3.0) * 0.683546 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_k39_to_ca40_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // k39 + p --> ca40 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // lo18r + ln_set_rate = 2761.38 + -5.22234 * tfactors.T9i + 802.18 * tfactors.T913i + -4010.27 * tfactors.T913 + + 1136.19 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.22234 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 802.18 * tfactors.T943i + (1.0/3.0) * -4010.27 * tfactors.T923i + + 1136.19 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // lo18r + ln_set_rate = 588.099 + -12.5647 * tfactors.T9i + 641.844 * tfactors.T913i + -1248.49 * tfactors.T913 + + 564.926 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 12.5647 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 641.844 * tfactors.T943i + (1.0/3.0) * -1248.49 * tfactors.T923i + + 564.926 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // lo18r + ln_set_rate = 102.252 + -1.66508 * tfactors.T9i + 41.1723 * tfactors.T913i + -149.299 * tfactors.T913 + + 10.5229 * tfactors.T9 + -0.68208 * tfactors.T953 + 59.2367 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 1.66508 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 41.1723 * tfactors.T943i + (1.0/3.0) * -149.299 * tfactors.T923i + + 10.5229 + (5.0/3.0) * -0.68208 * tfactors.T923 + 59.2367 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_k39_to_he4_ar36_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // k39 + p --> he4 + ar36 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.5166 + -30.0732 * tfactors.T913i + 7.03263 * tfactors.T913 + + -1.10085 * tfactors.T9 + 0.133768 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -30.0732 * tfactors.T943i + (1.0/3.0) * 7.03263 * tfactors.T923i + + -1.10085 + (5.0/3.0) * 0.133768 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ca40_to_ti44_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ca40 + he4 --> ti44 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // chw0 + ln_set_rate = 53.75 + -76.4273 * tfactors.T913i + 3.87451 * tfactors.T913 + + -3.61477 * tfactors.T9 + 0.367451 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -76.4273 * tfactors.T943i + (1.0/3.0) * 3.87451 * tfactors.T923i + + -3.61477 + (5.0/3.0) * 0.367451 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_sc43_to_ti44_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // sc43 + p --> ti44 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 36.8432 + -32.1734 * tfactors.T913i + -1.77078 * tfactors.T913 + + -2.21706 * tfactors.T9 + 0.298499 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * -1.77078 * tfactors.T923i + + -2.21706 + (5.0/3.0) * 0.298499 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_sc43_to_he4_ca40_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // sc43 + p --> he4 + ca40 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 34.8559 + -32.1734 * tfactors.T913i + 0.0296879 * tfactors.T913 + + -0.95232 * tfactors.T9 + 0.129022 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * 0.0296879 * tfactors.T923i + + -0.95232 + (5.0/3.0) * 0.129022 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ti44_to_cr48_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ti44 + he4 --> cr48 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 64.7958 + -81.667 * tfactors.T913i + -10.6333 * tfactors.T913 + + -0.672613 * tfactors.T9 + 0.161209 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = + -(1.0/3.0) * -81.667 * tfactors.T943i + (1.0/3.0) * -10.6333 * tfactors.T923i + + -0.672613 + (5.0/3.0) * 0.161209 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ti44_to_p_v47_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ti44 + he4 --> p + v47 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // chw0r + ln_set_rate = -76.5154 + -10.7931 * tfactors.T9i + 70.2835 * tfactors.T913 + + -7.99061 * tfactors.T9 + 0.486213 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 10.7931 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 70.2835 * tfactors.T923i + + -7.99061 + (5.0/3.0) * 0.486213 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_v47_to_cr48_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // v47 + p --> cr48 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // nfisn + ln_set_rate = 42.6798 + -6.0593 * tfactors.T9i + -34.0548 * tfactors.T913i + -3.41973 * tfactors.T913 + + 1.16501 * tfactors.T9 + -0.105543 * tfactors.T953 + -7.70886 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.0593 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -34.0548 * tfactors.T943i + (1.0/3.0) * -3.41973 * tfactors.T923i + + 1.16501 + (5.0/3.0) * -0.105543 * tfactors.T923 + -7.70886 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 511.463 + -5.29491 * tfactors.T9i + 317.171 * tfactors.T913i + -911.679 * tfactors.T913 + + 94.4245 * tfactors.T9 + -10.1973 * tfactors.T953 + 330.727 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 5.29491 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 317.171 * tfactors.T943i + (1.0/3.0) * -911.679 * tfactors.T923i + + 94.4245 + (5.0/3.0) * -10.1973 * tfactors.T923 + 330.727 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 23.8315 + 0.246665 * tfactors.T9i + -45.9868 * tfactors.T913i + 13.6822 * tfactors.T913 + + -0.376902 * tfactors.T9 + -0.0194875 * tfactors.T953 + -8.42325 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = -0.246665 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -45.9868 * tfactors.T943i + (1.0/3.0) * 13.6822 * tfactors.T923i + + -0.376902 + (5.0/3.0) * -0.0194875 * tfactors.T923 + -8.42325 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 40.5626 + -0.514414 * tfactors.T9i + -110.655 * tfactors.T913i + 83.0232 * tfactors.T913 + + -19.7762 * tfactors.T9 + 3.03961 * tfactors.T953 + -49.4742 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 0.514414 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -110.655 * tfactors.T943i + (1.0/3.0) * 83.0232 * tfactors.T923i + + -19.7762 + (5.0/3.0) * 3.03961 * tfactors.T923 + -49.4742 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_n13_to_p_c12_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // n13 --> p + c12 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ls09c + ln_set_rate = 40.04074558314484 + -22.547578710551672 * tfactors.T9i + -13.692 * tfactors.T913i + -0.230881 * tfactors.T913 + + 4.44362 * tfactors.T9 + -3.15898 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 22.547578710551672 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -13.692 * tfactors.T943i + (1.0/3.0) * -0.230881 * tfactors.T923i + + 4.44362 + (5.0/3.0) * -3.15898 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // ls09c + ln_set_rate = 40.43534558314484 + -26.326068710551674 * tfactors.T9i + -5.10735 * tfactors.T913i + -2.24111 * tfactors.T913 + + 0.148883 * tfactors.T9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 26.326068710551674 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.10735 * tfactors.T943i + (1.0/3.0) * -2.24111 * tfactors.T923i + + 0.148883; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real c12_pf, dc12_pf_dT; + // setting c12 partition function to 1.0 by default, independent of T + c12_pf = 1.0_rt; + dc12_pf_dT = 0.0_rt; + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real n13_pf, dn13_pf_dT; + // setting n13 partition function to 1.0 by default, independent of T + n13_pf = 1.0_rt; + dn13_pf_dT = 0.0_rt; + + Real z_r = p_pf * c12_pf; + Real z_p = n13_pf; + + Real dz_r_dT = c12_pf * dp_pf_dT + p_pf * dc12_pf_dT; + Real dz_p_dT = dn13_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_o16_to_he4_c12_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 --> he4 + c12 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // nac2 + ln_set_rate = 279.2945280776573 + -84.95160042649215 * tfactors.T9i + 103.411 * tfactors.T913i + -420.567 * tfactors.T913 + + 64.0874 * tfactors.T9 + -12.4624 * tfactors.T953 + 138.803 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 84.95160042649215 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 103.411 * tfactors.T943i + (1.0/3.0) * -420.567 * tfactors.T923i + + 64.0874 + (5.0/3.0) * -12.4624 * tfactors.T923 + 138.803 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nac2 + ln_set_rate = 94.31312807765731 + -84.50317042649215 * tfactors.T9i + 58.9128 * tfactors.T913i + -148.273 * tfactors.T913 + + 9.08324 * tfactors.T9 + -0.541041 * tfactors.T953 + 71.8554 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 84.50317042649215 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 58.9128 * tfactors.T943i + (1.0/3.0) * -148.273 * tfactors.T923i + + 9.08324 + (5.0/3.0) * -0.541041 * tfactors.T923 + 71.8554 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real c12_pf, dc12_pf_dT; + // setting c12 partition function to 1.0 by default, independent of T + c12_pf = 1.0_rt; + dc12_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real o16_pf, do16_pf_dT; + // interpolating o16 partition function + get_partition_function(O16, tfactors, o16_pf, do16_pf_dT); + + Real z_r = he4_pf * c12_pf; + Real z_p = o16_pf; + + Real dz_r_dT = c12_pf * dhe4_pf_dT + he4_pf * dc12_pf_dT; + Real dz_p_dT = do16_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_f18_to_he4_n14_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // f18 --> he4 + n14 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 46.248979543913606 + -51.22930570025806 * tfactors.T9i + -36.2504 * tfactors.T913i + + -5.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 51.22930570025806 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -36.2504 * tfactors.T943i + + (5.0/3.0) * -5.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 38.61457954391361 + -62.19490570025806 * tfactors.T9i + -5.6227 * tfactors.T913i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 62.19490570025806 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -5.6227 * tfactors.T943i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 24.91191754391361 + -56.38964570025806 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 56.38964570025806 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real f18_pf, df18_pf_dT; + // interpolating f18 partition function + get_partition_function(F18, tfactors, f18_pf, df18_pf_dT); + + Real n14_pf, dn14_pf_dT; + // setting n14 partition function to 1.0 by default, independent of T + n14_pf = 1.0_rt; + dn14_pf_dT = 0.0_rt; + + Real z_r = he4_pf * n14_pf; + Real z_p = f18_pf; + + Real dz_r_dT = n14_pf * dhe4_pf_dT + he4_pf * dn14_pf_dT; + Real dz_p_dT = df18_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ne20_to_he4_o16_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ne20 --> he4 + o16 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // co10c + ln_set_rate = 34.26581585936365 + -67.65193003813836 * tfactors.T9i + -3.65925 * tfactors.T913 + + 0.714224 * tfactors.T9 + -0.00107508 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 67.65193003813836 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -3.65925 * tfactors.T923i + + 0.714224 + (5.0/3.0) * -0.00107508 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // co10c + ln_set_rate = 28.64304585936365 + -65.24613003813835 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 65.24613003813835 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // co10c + ln_set_rate = 48.66033585936365 + -54.887630038138354 * tfactors.T9i + -39.7262 * tfactors.T913i + -0.210799 * tfactors.T913 + + 0.442879 * tfactors.T9 + -0.0797753 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 54.887630038138354 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.7262 * tfactors.T943i + (1.0/3.0) * -0.210799 * tfactors.T923i + + 0.442879 + (5.0/3.0) * -0.0797753 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real o16_pf, do16_pf_dT; + // interpolating o16 partition function + get_partition_function(O16, tfactors, o16_pf, do16_pf_dT); + + Real ne20_pf, dne20_pf_dT; + // interpolating ne20 partition function + get_partition_function(Ne20, tfactors, ne20_pf, dne20_pf_dT); + + Real z_r = he4_pf * o16_pf; + Real z_p = ne20_pf; + + Real dz_r_dT = o16_pf * dhe4_pf_dT + he4_pf * do16_pf_dT; + Real dz_p_dT = dne20_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_na22_to_p_ne21_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // na22 --> p + ne21 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = -24.579038986172677 + -78.40599033331655 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 78.40599033331655 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 42.145961013827325 + -78.20981033331655 * tfactors.T9i + -19.2096 * tfactors.T913i + + -1.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 78.20981033331655 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -19.2096 * tfactors.T943i + + (5.0/3.0) * -1.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -16.409838986172673 + -82.42366033331655 * tfactors.T9i + 21.1176 * tfactors.T913i + 34.0411 * tfactors.T913 + + -4.45593 * tfactors.T9 + 0.328613 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 82.42366033331655 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.1176 * tfactors.T943i + (1.0/3.0) * 34.0411 * tfactors.T923i + + -4.45593 + (5.0/3.0) * 0.328613 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 24.833401013827324 + -79.60938033331655 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 79.60938033331655 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ne21_pf, dne21_pf_dT; + // interpolating ne21 partition function + get_partition_function(Ne21, tfactors, ne21_pf, dne21_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real na22_pf, dna22_pf_dT; + // interpolating na22 partition function + get_partition_function(Na22, tfactors, na22_pf, dna22_pf_dT); + + Real z_r = p_pf * ne21_pf; + Real z_p = na22_pf; + + Real dz_r_dT = ne21_pf * dp_pf_dT + p_pf * dne21_pf_dT; + Real dz_p_dT = dna22_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_na22_to_he4_f18_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // na22 --> he4 + f18 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // rpsmr + ln_set_rate = 59.32234728275454 + -100.23588367240258 * tfactors.T9i + 18.8956 * tfactors.T913i + -65.6134 * tfactors.T913 + + 1.71114 * tfactors.T9 + -0.0260999 * tfactors.T953 + 39.3396 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 100.23588367240258 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 18.8956 * tfactors.T943i + (1.0/3.0) * -65.6134 * tfactors.T923i + + 1.71114 + (5.0/3.0) * -0.0260999 * tfactors.T923 + 39.3396 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real f18_pf, df18_pf_dT; + // interpolating f18 partition function + get_partition_function(F18, tfactors, f18_pf, df18_pf_dT); + + Real na22_pf, dna22_pf_dT; + // interpolating na22 partition function + get_partition_function(Na22, tfactors, na22_pf, dna22_pf_dT); + + Real z_r = he4_pf * f18_pf; + Real z_p = na22_pf; + + Real dz_r_dT = f18_pf * dhe4_pf_dT + he4_pf * df18_pf_dT; + Real dz_p_dT = dna22_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_mg24_to_p_na23_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mg24 --> p + na23 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 43.93571176470678 + -135.6881490421346 * tfactors.T9i + -20.6428 * tfactors.T913i + 1.52954 * tfactors.T913 + + 2.7487 * tfactors.T9 + -1.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 135.6881490421346 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -20.6428 * tfactors.T943i + (1.0/3.0) * 1.52954 * tfactors.T923i + + 2.7487 + (5.0/3.0) * -1.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 34.08761176470678 + -138.9684390421346 * tfactors.T9i + -0.360588 * tfactors.T913 + + 1.4187 * tfactors.T9 + -0.184061 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 138.9684390421346 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.360588 * tfactors.T923i + + 1.4187 + (5.0/3.0) * -0.184061 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 20.002361764706784 + -137.3003390421346 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 137.3003390421346 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real na23_pf, dna23_pf_dT; + // interpolating na23 partition function + get_partition_function(Na23, tfactors, na23_pf, dna23_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real mg24_pf, dmg24_pf_dT; + // interpolating mg24 partition function + get_partition_function(Mg24, tfactors, mg24_pf, dmg24_pf_dT); + + Real z_r = p_pf * na23_pf; + Real z_p = mg24_pf; + + Real dz_r_dT = na23_pf * dp_pf_dT + p_pf * dna23_pf_dT; + Real dz_p_dT = dmg24_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_mg24_to_he4_ne20_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mg24 --> he4 + ne20 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = -13.886931148855957 + -110.62012330714883 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 110.62012330714883 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 49.324368851144044 + -108.11407330714883 * tfactors.T9i + -46.2525 * tfactors.T913i + 5.58901 * tfactors.T913 + + 7.61843 * tfactors.T9 + -3.683 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 108.11407330714883 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -46.2525 * tfactors.T943i + (1.0/3.0) * 5.58901 * tfactors.T923i + + 7.61843 + (5.0/3.0) * -3.683 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 16.02029885114404 + -120.89497330714883 * tfactors.T9i + 16.9229 * tfactors.T913 + + -2.57325 * tfactors.T9 + 0.208997 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 120.89497330714883 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 16.9229 * tfactors.T923i + + -2.57325 + (5.0/3.0) * 0.208997 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 26.801638851144045 + -117.33433330714882 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 117.33433330714882 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real mg24_pf, dmg24_pf_dT; + // interpolating mg24 partition function + get_partition_function(Mg24, tfactors, mg24_pf, dmg24_pf_dT); + + Real ne20_pf, dne20_pf_dT; + // interpolating ne20 partition function + get_partition_function(Ne20, tfactors, ne20_pf, dne20_pf_dT); + + Real z_r = he4_pf * ne20_pf; + Real z_p = mg24_pf; + + Real dz_r_dT = ne20_pf * dhe4_pf_dT + he4_pf * dne20_pf_dT; + Real dz_p_dT = dmg24_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_si28_to_p_al27_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // si28 --> p + al27 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 11.776564828186824 + -136.3434628922348 * tfactors.T9i + 23.8634 * tfactors.T913 + + -3.70135 * tfactors.T9 + 0.28964 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 136.3434628922348 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 23.8634 * tfactors.T923i + + -3.70135 + (5.0/3.0) * 0.28964 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 111.46636482818681 + -134.8268158922348 * tfactors.T9i + -26.8327 * tfactors.T913i + -116.137 * tfactors.T913 + + 0.00950567 * tfactors.T9 + 0.00999755 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 134.8268158922348 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -26.8327 * tfactors.T943i + (1.0/3.0) * -116.137 * tfactors.T923i + + 0.00950567 + (5.0/3.0) * 0.00999755 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 46.54946482818683 + -134.4395028922348 * tfactors.T9i + -23.2205 * tfactors.T913i + + -2.0 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 134.4395028922348 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -23.2205 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real al27_pf, dal27_pf_dT; + // interpolating al27 partition function + get_partition_function(Al27, tfactors, al27_pf, dal27_pf_dT); + + Real si28_pf, dsi28_pf_dT; + // interpolating si28 partition function + get_partition_function(Si28, tfactors, si28_pf, dsi28_pf_dT); + + Real z_r = p_pf * al27_pf; + Real z_p = si28_pf; + + Real dz_r_dT = al27_pf * dp_pf_dT + p_pf * dal27_pf_dT; + Real dz_p_dT = dsi28_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_si28_to_he4_mg24_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // si28 --> he4 + mg24 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // st08r + ln_set_rate = -25.688574833405916 + -128.69270892750794 * tfactors.T9i + 21.3721 * tfactors.T913i + 37.7649 * tfactors.T913 + + -4.10635 * tfactors.T9 + 0.249618 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 128.69270892750794 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.3721 * tfactors.T943i + (1.0/3.0) * 37.7649 * tfactors.T923i + + -4.10635 + (5.0/3.0) * 0.249618 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // st08r + ln_set_rate = 32.90059516659409 + -131.48850892750792 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 131.48850892750792 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real mg24_pf, dmg24_pf_dT; + // interpolating mg24 partition function + get_partition_function(Mg24, tfactors, mg24_pf, dmg24_pf_dT); + + Real si28_pf, dsi28_pf_dT; + // interpolating si28 partition function + get_partition_function(Si28, tfactors, si28_pf, dsi28_pf_dT); + + Real z_r = he4_pf * mg24_pf; + Real z_p = si28_pf; + + Real dz_r_dT = mg24_pf * dhe4_pf_dT + he4_pf * dmg24_pf_dT; + Real dz_p_dT = dsi28_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_s32_to_p_p31_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // s32 --> p + p31 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 25.172836958303158 + -106.63693563716609 * tfactors.T9i + 8.09341 * tfactors.T913 + + -0.615971 * tfactors.T9 + 0.031159 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 106.63693563716609 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 8.09341 * tfactors.T923i + + -0.615971 + (5.0/3.0) * 0.031159 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 21.682890958303158 + -105.11947563716609 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 105.11947563716609 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 43.610880958303156 + -102.85989563716609 * tfactors.T9i + -25.3278 * tfactors.T913i + 6.4931 * tfactors.T913 + + -9.27513 * tfactors.T9 + -0.610439 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 102.85989563716609 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -25.3278 * tfactors.T943i + (1.0/3.0) * 6.4931 * tfactors.T923i + + -9.27513 + (5.0/3.0) * -0.610439 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real s32_pf, ds32_pf_dT; + // interpolating s32 partition function + get_partition_function(S32, tfactors, s32_pf, ds32_pf_dT); + + Real p31_pf, dp31_pf_dT; + // interpolating p31 partition function + get_partition_function(P31, tfactors, p31_pf, dp31_pf_dT); + + Real z_r = p_pf * p31_pf; + Real z_p = s32_pf; + + Real dz_r_dT = p31_pf * dp_pf_dT + p_pf * dp31_pf_dT; + Real dz_p_dT = ds32_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_s32_to_he4_si28_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // s32 --> he4 + si28 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 72.81295409739818 + -80.62610309662641 * tfactors.T9i + -59.4896 * tfactors.T913i + 4.47205 * tfactors.T913 + + -4.78989 * tfactors.T9 + 0.557201 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 80.62610309662641 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -59.4896 * tfactors.T943i + (1.0/3.0) * 4.47205 * tfactors.T923i + + -4.78989 + (5.0/3.0) * 0.557201 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real s32_pf, ds32_pf_dT; + // interpolating s32 partition function + get_partition_function(S32, tfactors, s32_pf, ds32_pf_dT); + + Real si28_pf, dsi28_pf_dT; + // interpolating si28 partition function + get_partition_function(Si28, tfactors, si28_pf, dsi28_pf_dT); + + Real z_r = he4_pf * si28_pf; + Real z_p = s32_pf; + + Real dz_r_dT = si28_pf * dhe4_pf_dT + he4_pf * dsi28_pf_dT; + Real dz_p_dT = ds32_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe52_to_p_mn51_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe52 --> p + mn51 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 61.72798916565748 + -85.6326403498911 * tfactors.T9i + -36.1825 * tfactors.T913i + 0.873042 * tfactors.T913 + + -2.89731 * tfactors.T9 + 0.364394 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 85.6326403498911 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -36.1825 * tfactors.T943i + (1.0/3.0) * 0.873042 * tfactors.T923i + + -2.89731 + (5.0/3.0) * 0.364394 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real mn51_pf, dmn51_pf_dT; + // interpolating mn51 partition function + get_partition_function(Mn51, tfactors, mn51_pf, dmn51_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real fe52_pf, dfe52_pf_dT; + // interpolating fe52 partition function + get_partition_function(Fe52, tfactors, fe52_pf, dfe52_pf_dT); + + Real z_r = p_pf * mn51_pf; + Real z_p = fe52_pf; + + Real dz_r_dT = mn51_pf * dp_pf_dT + p_pf * dmn51_pf_dT; + Real dz_p_dT = dfe52_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe52_to_he4_cr48_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe52 --> he4 + cr48 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 90.14738712482466 + -92.10912191363732 * tfactors.T9i + -86.7459 * tfactors.T913i + -9.79373 * tfactors.T913 + + -0.772169 * tfactors.T9 + 0.155883 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 92.10912191363732 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * -9.79373 * tfactors.T923i + + -0.772169 + (5.0/3.0) * 0.155883 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cr48_pf, dcr48_pf_dT; + // interpolating cr48 partition function + get_partition_function(Cr48, tfactors, cr48_pf, dcr48_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe52_pf, dfe52_pf_dT; + // interpolating fe52 partition function + get_partition_function(Fe52, tfactors, fe52_pf, dfe52_pf_dT); + + Real z_r = he4_pf * cr48_pf; + Real z_p = fe52_pf; + + Real dz_r_dT = cr48_pf * dhe4_pf_dT + he4_pf * dcr48_pf_dT; + Real dz_p_dT = dfe52_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co55_to_he4_mn51_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 --> he4 + mn51 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 90.61300778512097 + -95.28620688500884 * tfactors.T9i + -89.274 * tfactors.T913i + -10.4373 * tfactors.T913 + + 1.00492 * tfactors.T9 + -0.125548 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 95.28620688500884 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -10.4373 * tfactors.T923i + + 1.00492 + (5.0/3.0) * -0.125548 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real mn51_pf, dmn51_pf_dT; + // interpolating mn51 partition function + get_partition_function(Mn51, tfactors, mn51_pf, dmn51_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real z_r = he4_pf * mn51_pf; + Real z_p = co55_pf; + + Real dz_r_dT = mn51_pf * dhe4_pf_dT + he4_pf * dmn51_pf_dT; + Real dz_p_dT = dco55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni56_to_p_co55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 --> p + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 63.131770608640906 + -83.14741674893808 * tfactors.T9i + -38.1053 * tfactors.T913i + -0.210947 * tfactors.T913 + + -2.68377 * tfactors.T9 + 0.355814 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 83.14741674893808 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1053 * tfactors.T943i + (1.0/3.0) * -0.210947 * tfactors.T923i + + -2.68377 + (5.0/3.0) * 0.355814 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real z_r = p_pf * co55_pf; + Real z_p = ni56_pf; + + Real dz_r_dT = co55_pf * dp_pf_dT + p_pf * dco55_pf_dT; + Real dz_p_dT = dni56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni56_to_he4_fe52_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 --> he4 + fe52 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 91.62258922810439 + -92.801099329237 * tfactors.T9i + -91.6819 * tfactors.T913i + -9.51885 * tfactors.T913 + + -0.533014 * tfactors.T9 + 0.0892607 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 92.801099329237 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -9.51885 * tfactors.T923i + + -0.533014 + (5.0/3.0) * 0.0892607 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe52_pf, dfe52_pf_dT; + // interpolating fe52 partition function + get_partition_function(Fe52, tfactors, fe52_pf, dfe52_pf_dT); + + Real z_r = he4_pf * fe52_pf; + Real z_p = ni56_pf; + + Real dz_r_dT = fe52_pf * dhe4_pf_dT + he4_pf * dfe52_pf_dT; + Real dz_p_dT = dni56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_cu59_to_he4_co55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cu59 --> he4 + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 90.97199197888506 + -55.17460977128912 * tfactors.T9i + -94.1404 * tfactors.T913i + -2.62786 * tfactors.T913 + + -2.12066 * tfactors.T9 + 0.237999 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 55.17460977128912 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * -2.62786 * tfactors.T923i + + -2.12066 + (5.0/3.0) * 0.237999 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cu59_pf, dcu59_pf_dT; + // interpolating cu59 partition function + get_partition_function(Cu59, tfactors, cu59_pf, dcu59_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real z_r = he4_pf * co55_pf; + Real z_p = cu59_pf; + + Real dz_r_dT = co55_pf * dhe4_pf_dT + he4_pf * dco55_pf_dT; + Real dz_p_dT = dcu59_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_zn60_to_p_cu59_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // zn60 --> p + cu59 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 62.2928405088604 + -59.40944656945774 * tfactors.T9i + -39.9808 * tfactors.T913i + 1.17311 * tfactors.T913 + + -2.90486 * tfactors.T9 + 0.339644 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 59.40944656945774 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 1.17311 * tfactors.T923i + + -2.90486 + (5.0/3.0) * 0.339644 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cu59_pf, dcu59_pf_dT; + // interpolating cu59 partition function + get_partition_function(Cu59, tfactors, cu59_pf, dcu59_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real zn60_pf, dzn60_pf_dT; + // interpolating zn60 partition function + get_partition_function(Zn60, tfactors, zn60_pf, dzn60_pf_dT); + + Real z_r = p_pf * cu59_pf; + Real z_p = zn60_pf; + + Real dz_r_dT = cu59_pf * dp_pf_dT + p_pf * dcu59_pf_dT; + Real dz_p_dT = dzn60_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_zn60_to_he4_ni56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // zn60 --> he4 + ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 86.06186187910455 + -31.43675563699001 * tfactors.T9i + -96.4898 * tfactors.T913i + 6.47209 * tfactors.T913 + + -5.2029 * tfactors.T9 + 0.533391 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 31.43675563699001 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -96.4898 * tfactors.T943i + (1.0/3.0) * 6.47209 * tfactors.T923i + + -5.2029 + (5.0/3.0) * 0.533391 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real zn60_pf, dzn60_pf_dT; + // interpolating zn60 partition function + get_partition_function(Zn60, tfactors, zn60_pf, dzn60_pf_dT); + + Real z_r = he4_pf * ni56_pf; + Real z_p = zn60_pf; + + Real dz_r_dT = ni56_pf * dhe4_pf_dT + he4_pf * dni56_pf_dT; + Real dz_p_dT = dzn60_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_c12_to_he4_he4_he4_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // c12 --> he4 + he4 + he4 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // fy05c + ln_set_rate = 22.39392447043974 + -88.54942933569913 * tfactors.T9i + -13.49 * tfactors.T913i + 21.4259 * tfactors.T913 + + -1.34769 * tfactors.T9 + 0.0879816 * tfactors.T953 + -10.1653 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 88.54942933569913 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -13.49 * tfactors.T943i + (1.0/3.0) * 21.4259 * tfactors.T923i + + -1.34769 + (5.0/3.0) * 0.0879816 * tfactors.T923 + -10.1653 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // fy05c + ln_set_rate = 34.95602447043974 + -85.44732933569914 * tfactors.T9i + -23.57 * tfactors.T913i + 20.4886 * tfactors.T913 + + -12.9882 * tfactors.T9 + -20.0 * tfactors.T953 + 0.8333300000000001 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 85.44732933569914 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -23.57 * tfactors.T943i + (1.0/3.0) * 20.4886 * tfactors.T923i + + -12.9882 + (5.0/3.0) * -20.0 * tfactors.T923 + 0.8333300000000001 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // fy05c + ln_set_rate = 45.77337247043974 + -84.42286933569913 * tfactors.T9i + -37.06 * tfactors.T913i + 29.3493 * tfactors.T913 + + -115.507 * tfactors.T9 + -10.0 * tfactors.T953 + 1.66667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 84.42286933569913 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.06 * tfactors.T943i + (1.0/3.0) * 29.3493 * tfactors.T923i + + -115.507 + (5.0/3.0) * -10.0 * tfactors.T923 + 1.66667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real c12_pf, dc12_pf_dT; + // setting c12 partition function to 1.0 by default, independent of T + c12_pf = 1.0_rt; + dc12_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real z_r = he4_pf * he4_pf * he4_pf; + Real z_p = c12_pf; + + Real dz_r_dT = dhe4_pf_dT + dhe4_pf_dT + dhe4_pf_dT; + Real dz_p_dT = dc12_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_o16_to_he4_n13_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // o16 + p --> he4 + n13 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // cf88n + ln_set_rate = 42.232382494512464 + -60.55237555926846 * tfactors.T9i + -35.829 * tfactors.T913i + -0.530275 * tfactors.T913 + + -0.982462 * tfactors.T9 + 0.0808059 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 60.55237555926846 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -35.829 * tfactors.T943i + (1.0/3.0) * -0.530275 * tfactors.T923i + + -0.982462 + (5.0/3.0) * 0.0808059 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real o16_pf, do16_pf_dT; + // interpolating o16 partition function + get_partition_function(O16, tfactors, o16_pf, do16_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real n13_pf, dn13_pf_dT; + // setting n13 partition function to 1.0 by default, independent of T + n13_pf = 1.0_rt; + dn13_pf_dT = 0.0_rt; + + Real z_r = he4_pf * n13_pf; + Real z_p = p_pf * o16_pf; + + Real dz_r_dT = n13_pf * dhe4_pf_dT + he4_pf * dn13_pf_dT; + Real dz_p_dT = o16_pf * dp_pf_dT + p_pf * do16_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ne20_to_p_na23_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ne20 + he4 --> p + na23 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = -6.377717086437262 + -29.88961364462334 * tfactors.T9i + 19.7297 * tfactors.T913 + + -2.20987 * tfactors.T9 + 0.153374 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 29.88961364462334 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 19.7297 * tfactors.T923i + + -2.20987 + (5.0/3.0) * 0.153374 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 0.227472413562738 + -29.434873644623337 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 29.434873644623337 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 19.18524291356274 + -27.573843644623338 * tfactors.T9i + -20.0024 * tfactors.T913i + 11.5988 * tfactors.T913 + + -1.37398 * tfactors.T9 + -1.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 27.573843644623338 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -20.0024 * tfactors.T943i + (1.0/3.0) * 11.5988 * tfactors.T923i + + -1.37398 + (5.0/3.0) * -1.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real na23_pf, dna23_pf_dT; + // interpolating na23 partition function + get_partition_function(Na23, tfactors, na23_pf, dna23_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ne20_pf, dne20_pf_dT; + // interpolating ne20 partition function + get_partition_function(Ne20, tfactors, ne20_pf, dne20_pf_dT); + + Real z_r = p_pf * na23_pf; + Real z_p = he4_pf * ne20_pf; + + Real dz_r_dT = na23_pf * dp_pf_dT + p_pf * dna23_pf_dT; + Real dz_p_dT = ne20_pf * dhe4_pf_dT + he4_pf * dne20_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_ne21_to_he4_f18_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ne21 + p --> he4 + f18 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // rpsmr + ln_set_rate = 50.65368626892722 + -22.049056049959066 * tfactors.T9i + 21.4461 * tfactors.T913i + -73.252 * tfactors.T913 + + 2.42329 * tfactors.T9 + -0.077278 * tfactors.T953 + 40.7604 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 22.049056049959066 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 21.4461 * tfactors.T943i + (1.0/3.0) * -73.252 * tfactors.T923i + + 2.42329 + (5.0/3.0) * -0.077278 * tfactors.T923 + 40.7604 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ne21_pf, dne21_pf_dT; + // interpolating ne21 partition function + get_partition_function(Ne21, tfactors, ne21_pf, dne21_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real f18_pf, df18_pf_dT; + // interpolating f18 partition function + get_partition_function(F18, tfactors, f18_pf, df18_pf_dT); + + Real z_r = he4_pf * f18_pf; + Real z_p = p_pf * ne21_pf; + + Real dz_r_dT = f18_pf * dhe4_pf_dT + he4_pf * df18_pf_dT; + Real dz_p_dT = ne21_pf * dp_pf_dT + p_pf * dne21_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_mg24_to_p_al27_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mg24 + he4 --> p + al27 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = -6.445750338407262 + -22.82086933218981 * tfactors.T9i + 18.0416 * tfactors.T913 + + -1.54137 * tfactors.T9 + 0.0847506 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 22.82086933218981 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0416 * tfactors.T923i + + -1.54137 + (5.0/3.0) * 0.0847506 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -26.286160338407264 + -19.54138133218981 * tfactors.T9i + 5.18642 * tfactors.T913i + -34.7936 * tfactors.T913 + + 168.225 * tfactors.T9 + -115.825 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 19.54138133218981 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 5.18642 * tfactors.T943i + (1.0/3.0) * -34.7936 * tfactors.T923i + + 168.225 + (5.0/3.0) * -115.825 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 30.039739661592737 + -18.578369332189812 * tfactors.T9i + -26.4162 * tfactors.T913i + + -2.0 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 18.578369332189812 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -26.4162 * tfactors.T943i + + (5.0/3.0) * -2.0 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real al27_pf, dal27_pf_dT; + // interpolating al27 partition function + get_partition_function(Al27, tfactors, al27_pf, dal27_pf_dT); + + Real mg24_pf, dmg24_pf_dT; + // interpolating mg24 partition function + get_partition_function(Mg24, tfactors, mg24_pf, dmg24_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real z_r = p_pf * al27_pf; + Real z_p = he4_pf * mg24_pf; + + Real dz_r_dT = al27_pf * dp_pf_dT + p_pf * dal27_pf_dT; + Real dz_p_dT = mg24_pf * dhe4_pf_dT + he4_pf * dmg24_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_si28_to_p_p31_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // si28 + he4 --> p + p31 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = -11.433473139095032 + -25.65965858572089 * tfactors.T9i + 21.521 * tfactors.T913 + + -1.90355 * tfactors.T9 + 0.092724 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 25.65965858572089 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 21.521 * tfactors.T923i + + -1.90355 + (5.0/3.0) * 0.092724 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -13.459473139095032 + -24.11106858572089 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 24.11106858572089 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 60.342426860904965 + -22.23390858572089 * tfactors.T9i + -31.932 * tfactors.T913i + -77.0334 * tfactors.T913 + + -43.6847 * tfactors.T9 + -4.28955 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 22.23390858572089 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -31.932 * tfactors.T943i + (1.0/3.0) * -77.0334 * tfactors.T923i + + -43.6847 + (5.0/3.0) * -4.28955 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real p31_pf, dp31_pf_dT; + // interpolating p31 partition function + get_partition_function(P31, tfactors, p31_pf, dp31_pf_dT); + + Real si28_pf, dsi28_pf_dT; + // interpolating si28 partition function + get_partition_function(Si28, tfactors, si28_pf, dsi28_pf_dT); + + Real z_r = p_pf * p31_pf; + Real z_p = he4_pf * si28_pf; + + Real dz_r_dT = p31_pf * dp_pf_dT + p_pf * dp31_pf_dT; + Real dz_p_dT = si28_pf * dhe4_pf_dT + he4_pf * dsi28_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_mn51_to_he4_cr48_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn51 + p --> he4 + cr48 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 58.73119795916719 + -6.476551190854941 * tfactors.T9i + -86.7459 * tfactors.T913i + 1.05653 * tfactors.T913 + + -1.15757 * tfactors.T9 + 0.0877546 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.476551190854941 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -86.7459 * tfactors.T943i + (1.0/3.0) * 1.05653 * tfactors.T923i + + -1.15757 + (5.0/3.0) * 0.0877546 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real cr48_pf, dcr48_pf_dT; + // interpolating cr48 partition function + get_partition_function(Cr48, tfactors, cr48_pf, dcr48_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real mn51_pf, dmn51_pf_dT; + // interpolating mn51 partition function + get_partition_function(Mn51, tfactors, mn51_pf, dmn51_pf_dT); + + Real z_r = he4_pf * cr48_pf; + Real z_p = p_pf * mn51_pf; + + Real dz_r_dT = cr48_pf * dhe4_pf_dT + he4_pf * dcr48_pf_dT; + Real dz_p_dT = mn51_pf * dp_pf_dT + p_pf * dmn51_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co55_to_he4_fe52_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 + p --> he4 + fe52 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 61.443418619463486 + -9.65364776674457 * tfactors.T9i + -91.6819 * tfactors.T913i + -0.329235 * tfactors.T913 + + -0.780924 * tfactors.T9 + 0.0425179 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 9.65364776674457 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.6819 * tfactors.T943i + (1.0/3.0) * -0.329235 * tfactors.T923i + + -0.780924 + (5.0/3.0) * 0.0425179 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real fe52_pf, dfe52_pf_dT; + // interpolating fe52 partition function + get_partition_function(Fe52, tfactors, fe52_pf, dfe52_pf_dT); + + Real z_r = he4_pf * fe52_pf; + Real z_p = p_pf * co55_pf; + + Real dz_r_dT = fe52_pf * dhe4_pf_dT + he4_pf * dfe52_pf_dT; + Real dz_p_dT = co55_pf * dp_pf_dT + p_pf * dco55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ni56_to_p_cu59_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni56 + he4 --> p + cu59 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.847078629755856 + -27.97280697764895 * tfactors.T9i + -39.9808 * tfactors.T913i + 13.6773 * tfactors.T913 + + -3.76429 * tfactors.T9 + 0.438096 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 27.97280697764895 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.9808 * tfactors.T943i + (1.0/3.0) * 13.6773 * tfactors.T923i + + -3.76429 + (5.0/3.0) * 0.438096 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cu59_pf, dcu59_pf_dT; + // interpolating cu59 partition function + get_partition_function(Cu59, tfactors, cu59_pf, dcu59_pf_dT); + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real z_r = p_pf * cu59_pf; + Real z_p = he4_pf * ni56_pf; + + Real dz_r_dT = cu59_pf * dp_pf_dT + p_pf * dcu59_pf_dT; + Real dz_p_dT = ni56_pf * dhe4_pf_dT + he4_pf * dni56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe53_to_n_fe52_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe53 --> n + fe52 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 37.48624299107921 + -123.99427613085159 * tfactors.T9i + -0.344319 * tfactors.T913 + + 0.178277 * tfactors.T9 + -0.0334326 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 123.99427613085159 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -0.344319 * tfactors.T923i + + 0.178277 + (5.0/3.0) * -0.0334326 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real fe52_pf, dfe52_pf_dT; + // interpolating fe52 partition function + get_partition_function(Fe52, tfactors, fe52_pf, dfe52_pf_dT); + + Real fe53_pf, dfe53_pf_dT; + // interpolating fe53 partition function + get_partition_function(Fe53, tfactors, fe53_pf, dfe53_pf_dT); + + Real z_r = n_pf * fe52_pf; + Real z_p = fe53_pf; + + Real dz_r_dT = fe52_pf * dn_pf_dT + n_pf * dfe52_pf_dT; + Real dz_p_dT = dfe53_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe54_to_n_fe53_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 --> n + fe53 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 42.210560167376684 + -155.25104569177333 * tfactors.T9i + -1.10421 * tfactors.T913 + + 0.379905 * tfactors.T9 + -0.0581878 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 155.25104569177333 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.10421 * tfactors.T923i + + 0.379905 + (5.0/3.0) * -0.0581878 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real fe53_pf, dfe53_pf_dT; + // interpolating fe53 partition function + get_partition_function(Fe53, tfactors, fe53_pf, dfe53_pf_dT); + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = n_pf * fe53_pf; + Real z_p = fe54_pf; + + Real dz_r_dT = fe53_pf * dn_pf_dT + n_pf * dfe53_pf_dT; + Real dz_p_dT = dfe54_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe55_to_n_fe54_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 --> n + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ks03 + ln_set_rate = 21.483298756092896 + -107.84311925142697 * tfactors.T9i + -8.66617 * tfactors.T913i + 26.4472 * tfactors.T913 + + -1.9222 * tfactors.T9 + 0.0986404 * tfactors.T953 + -8.28317 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 107.84311925142697 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -8.66617 * tfactors.T943i + (1.0/3.0) * 26.4472 * tfactors.T923i + + -1.9222 + (5.0/3.0) * 0.0986404 * tfactors.T923 + -8.28317 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = n_pf * fe54_pf; + Real z_p = fe55_pf; + + Real dz_r_dT = fe54_pf * dn_pf_dT + n_pf * dfe54_pf_dT; + Real dz_p_dT = dfe55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe56_to_n_fe55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe56 --> n + fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ks03 + ln_set_rate = 46.785223428080954 + -130.0232339465001 * tfactors.T9i + 8.06062 * tfactors.T913i + -14.4809 * tfactors.T913 + + 0.94252 * tfactors.T9 + -0.0776007 * tfactors.T953 + 7.97093 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 130.0232339465001 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 8.06062 * tfactors.T943i + (1.0/3.0) * -14.4809 * tfactors.T923i + + 0.94252 + (5.0/3.0) * -0.0776007 * tfactors.T923 + 7.97093 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real fe56_pf, dfe56_pf_dT; + // interpolating fe56 partition function + get_partition_function(Fe56, tfactors, fe56_pf, dfe56_pf_dT); + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real z_r = n_pf * fe55_pf; + Real z_p = fe56_pf; + + Real dz_r_dT = fe55_pf * dn_pf_dT + n_pf * dfe55_pf_dT; + Real dz_p_dT = dfe56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_fe56_to_p_mn55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe56 --> p + mn55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 61.659288536189116 + -118.17693119642051 * tfactors.T9i + -36.1995 * tfactors.T913i + 1.15346 * tfactors.T913 + + -1.94437 * tfactors.T9 + 0.218429 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 118.17693119642051 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -36.1995 * tfactors.T943i + (1.0/3.0) * 1.15346 * tfactors.T923i + + -1.94437 + (5.0/3.0) * 0.218429 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real fe56_pf, dfe56_pf_dT; + // interpolating fe56 partition function + get_partition_function(Fe56, tfactors, fe56_pf, dfe56_pf_dT); + + Real mn55_pf, dmn55_pf_dT; + // interpolating mn55 partition function + get_partition_function(Mn55, tfactors, mn55_pf, dmn55_pf_dT); + + Real z_r = p_pf * mn55_pf; + Real z_p = fe56_pf; + + Real dz_r_dT = mn55_pf * dp_pf_dT + p_pf * dmn55_pf_dT; + Real dz_p_dT = dfe56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co55_to_p_fe54_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co55 --> p + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 57.82919157553295 + -58.76609208478817 * tfactors.T9i + -37.1544 * tfactors.T913i + 0.950364 * tfactors.T913 + + -1.77529 * tfactors.T9 + 0.198562 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 58.76609208478817 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.1544 * tfactors.T943i + (1.0/3.0) * 0.950364 * tfactors.T923i + + -1.77529 + (5.0/3.0) * 0.198562 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = p_pf * fe54_pf; + Real z_p = co55_pf; + + Real dz_r_dT = fe54_pf * dp_pf_dT + p_pf * dfe54_pf_dT; + Real dz_p_dT = dco55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co56_to_n_co55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 --> n + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 40.62594603130468 + -117.00951667337291 * tfactors.T9i + -1.86357 * tfactors.T913 + + 0.616591 * tfactors.T9 + -0.0839313 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 117.00951667337291 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.86357 * tfactors.T923i + + 0.616591 + (5.0/3.0) * -0.0839313 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = n_pf * co55_pf; + Real z_p = co56_pf; + + Real dz_r_dT = co55_pf * dn_pf_dT + n_pf * dco55_pf_dT; + Real dz_p_dT = dco56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co56_to_p_fe55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 --> p + fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 58.601098850744734 + -67.87436231336505 * tfactors.T9i + -37.1585 * tfactors.T913i + 1.66198 * tfactors.T913 + + -1.60842 * tfactors.T9 + 0.148916 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 67.87436231336505 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.1585 * tfactors.T943i + (1.0/3.0) * 1.66198 * tfactors.T923i + + -1.60842 + (5.0/3.0) * 0.148916 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = p_pf * fe55_pf; + Real z_p = co56_pf; + + Real dz_r_dT = fe55_pf * dp_pf_dT + p_pf * dfe55_pf_dT; + Real dz_p_dT = dco56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co57_to_n_co56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co57 --> n + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 41.15219049522237 + -132.01531905660212 * tfactors.T9i + -1.37855 * tfactors.T913 + + 0.299896 * tfactors.T9 + -0.04382 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 132.01531905660212 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.37855 * tfactors.T923i + + 0.299896 + (5.0/3.0) * -0.04382 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real co57_pf, dco57_pf_dT; + // interpolating co57 partition function + get_partition_function(Co57, tfactors, co57_pf, dco57_pf_dT); + + Real z_r = n_pf * co56_pf; + Real z_p = co57_pf; + + Real dz_r_dT = co56_pf * dn_pf_dT + n_pf * dco56_pf_dT; + Real dz_p_dT = dco57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_co57_to_p_fe56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co57 --> p + fe56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 57.66626591788614 + -69.94994642462048 * tfactors.T9i + -37.1625 * tfactors.T913i + 1.06776 * tfactors.T913 + + -1.31689 * tfactors.T9 + 0.122089 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 69.94994642462048 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -37.1625 * tfactors.T943i + (1.0/3.0) * 1.06776 * tfactors.T923i + + -1.31689 + (5.0/3.0) * 0.122089 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real fe56_pf, dfe56_pf_dT; + // interpolating fe56 partition function + get_partition_function(Fe56, tfactors, fe56_pf, dfe56_pf_dT); + + Real co57_pf, dco57_pf_dT; + // interpolating co57 partition function + get_partition_function(Co57, tfactors, co57_pf, dco57_pf_dT); + + Real z_r = p_pf * fe56_pf; + Real z_p = co57_pf; + + Real dz_r_dT = fe56_pf * dp_pf_dT + p_pf * dfe56_pf_dT; + Real dz_p_dT = dco57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni57_to_n_ni56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 --> n + ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 38.36941309844609 + -118.94166894064354 * tfactors.T9i + -1.19665 * tfactors.T913 + + 0.507179 * tfactors.T9 + -0.074604 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 118.94166894064354 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.19665 * tfactors.T923i + + 0.507179 + (5.0/3.0) * -0.074604 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real z_r = n_pf * ni56_pf; + Real z_p = ni57_pf; + + Real dz_r_dT = ni56_pf * dn_pf_dT + n_pf * dni56_pf_dT; + Real dz_p_dT = dni57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni57_to_p_co56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 --> p + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 60.08383767578231 + -85.07956901620872 * tfactors.T9i + -38.1094 * tfactors.T913i + 2.57091 * tfactors.T913 + + -2.07795 * tfactors.T9 + 0.20757 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 85.07956901620872 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1094 * tfactors.T943i + (1.0/3.0) * 2.57091 * tfactors.T923i + + -2.07795 + (5.0/3.0) * 0.20757 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = p_pf * co56_pf; + Real z_p = ni57_pf; + + Real dz_r_dT = co56_pf * dp_pf_dT + p_pf * dco56_pf_dT; + Real dz_p_dT = dni57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni57_to_he4_fe53_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 --> he4 + fe53 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 94.73965933547126 + -87.74826004866655 * tfactors.T9i + -91.7231 * tfactors.T913i + -10.1816 * tfactors.T913 + + -0.0406303 * tfactors.T9 + 0.0345056 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 87.74826004866655 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * -10.1816 * tfactors.T923i + + -0.0406303 + (5.0/3.0) * 0.0345056 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe53_pf, dfe53_pf_dT; + // interpolating fe53 partition function + get_partition_function(Fe53, tfactors, fe53_pf, dfe53_pf_dT); + + Real z_r = he4_pf * fe53_pf; + Real z_p = ni57_pf; + + Real dz_r_dT = fe53_pf * dhe4_pf_dT + he4_pf * dfe53_pf_dT; + Real dz_p_dT = dni57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni58_to_n_ni57_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 --> n + ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 42.339063572267165 + -141.77239789336582 * tfactors.T9i + -1.90814 * tfactors.T913 + + 0.493188 * tfactors.T9 + -0.0684633 * tfactors.T953 + 1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 141.77239789336582 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.90814 * tfactors.T923i + + 0.493188 + (5.0/3.0) * -0.0684633 * tfactors.T923 + 1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real z_r = n_pf * ni57_pf; + Real z_p = ni58_pf; + + Real dz_r_dT = ni57_pf * dn_pf_dT + n_pf * dni57_pf_dT; + Real dz_p_dT = dni58_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni58_to_p_co57_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 --> p + co57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 61.775010752827114 + -94.83746016924091 * tfactors.T9i + -38.1133 * tfactors.T913i + 1.77414 * tfactors.T913 + + -1.48268 * tfactors.T9 + 0.121073 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 94.83746016924091 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 1.77414 * tfactors.T923i + + -1.48268 + (5.0/3.0) * 0.121073 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real co57_pf, dco57_pf_dT; + // interpolating co57 partition function + get_partition_function(Co57, tfactors, co57_pf, dco57_pf_dT); + + Real z_r = p_pf * co57_pf; + Real z_p = ni58_pf; + + Real dz_r_dT = co57_pf * dp_pf_dT + p_pf * dco57_pf_dT; + Real dz_p_dT = dni58_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ni58_to_he4_fe54_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 --> he4 + fe54 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 85.23266274036175 + -74.27065665689001 * tfactors.T9i + -91.7628 * tfactors.T913i + 4.23027 * tfactors.T913 + + -3.31305 * tfactors.T9 + 0.271293 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 74.27065665689001 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.7628 * tfactors.T943i + (1.0/3.0) * 4.23027 * tfactors.T923i + + -3.31305 + (5.0/3.0) * 0.271293 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = he4_pf * fe54_pf; + Real z_p = ni58_pf; + + Real dz_r_dT = fe54_pf * dhe4_pf_dT + he4_pf * dfe54_pf_dT; + Real dz_p_dT = dni58_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_cu59_to_p_ni58_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cu59 --> p + ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // si13n + ln_set_rate = 58.96002081405625 + -39.670045199187285 * tfactors.T9i + -39.0526 * tfactors.T913i + 1.0436 * tfactors.T913 + + -2.10834 * tfactors.T9 + 0.239559 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 39.670045199187285 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -39.0526 * tfactors.T943i + (1.0/3.0) * 1.0436 * tfactors.T923i + + -2.10834 + (5.0/3.0) * 0.239559 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cu59_pf, dcu59_pf_dT; + // interpolating cu59 partition function + get_partition_function(Cu59, tfactors, cu59_pf, dcu59_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real z_r = p_pf * ni58_pf; + Real z_p = cu59_pf; + + Real dz_r_dT = ni58_pf * dp_pf_dT + p_pf * dni58_pf_dT; + Real dz_p_dT = dcu59_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_mn55_to_n_fe55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // mn55 + p --> n + fe55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 4.300924891891836 + -11.761875387476456 * tfactors.T9i + 7.03052 * tfactors.T913 + + 0.260509 * tfactors.T9 + -0.0813397 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 11.761875387476456 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 7.03052 * tfactors.T923i + + 0.260509 + (5.0/3.0) * -0.0813397 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real mn55_pf, dmn55_pf_dT; + // interpolating mn55 partition function + get_partition_function(Mn55, tfactors, mn55_pf, dmn55_pf_dT); + + Real z_r = n_pf * fe55_pf; + Real z_p = p_pf * mn55_pf; + + Real dz_r_dT = fe55_pf * dn_pf_dT + n_pf * dfe55_pf_dT; + Real dz_p_dT = mn55_pf * dp_pf_dT + p_pf * dmn55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe53_to_n_ni56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe53 + he4 --> n + ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -11.227076237025186 + -31.193524937158223 * tfactors.T9i + 6.43259 * tfactors.T913 + + 2.29591 * tfactors.T9 + -0.254724 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 31.193524937158223 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 6.43259 * tfactors.T923i + + 2.29591 + (5.0/3.0) * -0.254724 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe53_pf, dfe53_pf_dT; + // interpolating fe53 partition function + get_partition_function(Fe53, tfactors, fe53_pf, dfe53_pf_dT); + + Real z_r = n_pf * ni56_pf; + Real z_p = he4_pf * fe53_pf; + + Real dz_r_dT = ni56_pf * dn_pf_dT + n_pf * dni56_pf_dT; + Real dz_p_dT = fe53_pf * dhe4_pf_dT + he4_pf * dfe53_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe54_to_he4_mn51_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + p --> he4 + mn51 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 65.37001620958803 + -36.52011480022066 * tfactors.T9i + -89.274 * tfactors.T913i + -0.862452 * tfactors.T913 + + -0.635672 * tfactors.T9 + 0.0196464 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 36.52011480022066 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -89.274 * tfactors.T943i + (1.0/3.0) * -0.862452 * tfactors.T923i + + -0.635672 + (5.0/3.0) * 0.0196464 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real mn51_pf, dmn51_pf_dT; + // interpolating mn51 partition function + get_partition_function(Mn51, tfactors, mn51_pf, dmn51_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = he4_pf * mn51_pf; + Real z_p = p_pf * fe54_pf; + + Real dz_r_dT = mn51_pf * dhe4_pf_dT + he4_pf * dmn51_pf_dT; + Real dz_p_dT = fe54_pf * dp_pf_dT + p_pf * dfe54_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe54_to_n_ni57_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + he4 --> n + ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 14.613800831905415 + -67.50220541720067 * tfactors.T9i + 0.48562 * tfactors.T913 + + -0.0249302 * tfactors.T9 + 0.0509605 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 67.50220541720067 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 0.48562 * tfactors.T923i + + -0.0249302 + (5.0/3.0) * 0.0509605 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = n_pf * ni57_pf; + Real z_p = he4_pf * fe54_pf; + + Real dz_r_dT = ni57_pf * dn_pf_dT + n_pf * dni57_pf_dT; + Real dz_p_dT = fe54_pf * dhe4_pf_dT + he4_pf * dfe54_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe54_to_p_co57_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe54 + he4 --> p + co57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -1.4219519875346407 + -20.56680351235092 * tfactors.T9i + -38.1133 * tfactors.T913i + 29.3541 * tfactors.T913 + + -4.75966 * tfactors.T9 + 0.40418 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 20.56680351235092 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -38.1133 * tfactors.T943i + (1.0/3.0) * 29.3541 * tfactors.T923i + + -4.75966 + (5.0/3.0) * 0.40418 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co57_pf, dco57_pf_dT; + // interpolating co57 partition function + get_partition_function(Co57, tfactors, co57_pf, dco57_pf_dT); + + Real fe54_pf, dfe54_pf_dT; + // interpolating fe54 partition function + get_partition_function(Fe54, tfactors, fe54_pf, dfe54_pf_dT); + + Real z_r = p_pf * co57_pf; + Real z_p = he4_pf * fe54_pf; + + Real dz_r_dT = co57_pf * dp_pf_dT + p_pf * dco57_pf_dT; + Real dz_p_dT = fe54_pf * dhe4_pf_dT + he4_pf * dfe54_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe55_to_n_co55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 + p --> n + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 21.432947180559943 + -49.13538645037029 * tfactors.T9i + -1.62382 * tfactors.T913 + + 0.58115 * tfactors.T9 + -0.0537057 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 49.13538645037029 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.62382 * tfactors.T923i + + 0.58115 + (5.0/3.0) * -0.0537057 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real z_r = n_pf * co55_pf; + Real z_p = p_pf * fe55_pf; + + Real dz_r_dT = co55_pf * dn_pf_dT + n_pf * dco55_pf_dT; + Real dz_p_dT = fe55_pf * dp_pf_dT + p_pf * dfe55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_fe55_to_n_ni58_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe55 + he4 --> n + ni58 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = -4.731933984268859 + -33.63082187826845 * tfactors.T9i + 3.44996 * tfactors.T913 + + 2.98226 * tfactors.T9 + -0.387699 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 33.63082187826845 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 3.44996 * tfactors.T923i + + 2.98226 + (5.0/3.0) * -0.387699 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real fe55_pf, dfe55_pf_dT; + // interpolating fe55 partition function + get_partition_function(Fe55, tfactors, fe55_pf, dfe55_pf_dT); + + Real z_r = n_pf * ni58_pf; + Real z_p = he4_pf * fe55_pf; + + Real dz_r_dT = ni58_pf * dn_pf_dT + n_pf * dni58_pf_dT; + Real dz_p_dT = fe55_pf * dhe4_pf_dT + he4_pf * dfe55_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_fe56_to_n_co56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // fe56 + p --> n + co56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 22.65112457733622 + -62.065024496438 * tfactors.T9i + -1.13331 * tfactors.T913 + + 0.347185 * tfactors.T9 + -0.0328879 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 62.065024496438 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.13331 * tfactors.T923i + + 0.347185 + (5.0/3.0) * -0.0328879 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real fe56_pf, dfe56_pf_dT; + // interpolating fe56 partition function + get_partition_function(Fe56, tfactors, fe56_pf, dfe56_pf_dT); + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = n_pf * co56_pf; + Real z_p = p_pf * fe56_pf; + + Real dz_r_dT = co56_pf * dn_pf_dT + n_pf * dco56_pf_dT; + Real dz_p_dT = fe56_pf * dp_pf_dT + p_pf * dfe56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co56_to_n_ni56_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + p --> n + ni56 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 13.37207542266378 + -33.86221596961605 * tfactors.T9i + 1.76846 * tfactors.T913 + + 0.197992 * tfactors.T9 + -0.017494 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 33.86221596961605 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 1.76846 * tfactors.T923i + + 0.197992 + (5.0/3.0) * -0.017494 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni56_pf, dni56_pf_dT; + // interpolating ni56 partition function + get_partition_function(Ni56, tfactors, ni56_pf, dni56_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = n_pf * ni56_pf; + Real z_p = p_pf * co56_pf; + + Real dz_r_dT = ni56_pf * dn_pf_dT + n_pf * dni56_pf_dT; + Real dz_p_dT = co56_pf * dp_pf_dT + p_pf * dco56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co56_to_he4_fe53_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + p --> he4 + fe53 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 56.04732165968897 + -2.6687374505303194 * tfactors.T9i + -91.7231 * tfactors.T913i + 10.052 * tfactors.T913 + + -3.86332 * tfactors.T9 + 0.391105 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 2.6687374505303194 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -91.7231 * tfactors.T943i + (1.0/3.0) * 10.052 * tfactors.T923i + + -3.86332 + (5.0/3.0) * 0.391105 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real fe53_pf, dfe53_pf_dT; + // interpolating fe53 partition function + get_partition_function(Fe53, tfactors, fe53_pf, dfe53_pf_dT); + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = he4_pf * fe53_pf; + Real z_p = p_pf * co56_pf; + + Real dz_r_dT = fe53_pf * dhe4_pf_dT + he4_pf * dfe53_pf_dT; + Real dz_p_dT = co56_pf * dp_pf_dT + p_pf * dco56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_co56_to_n_cu59_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co56 + he4 --> n + cu59 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 8.891854052419635 + -61.835022947265 * tfactors.T9i + -1.00882 * tfactors.T913 + + 1.88993 * tfactors.T9 + -0.202319 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 61.835022947265 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.00882 * tfactors.T923i + + 1.88993 + (5.0/3.0) * -0.202319 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real cu59_pf, dcu59_pf_dT; + // interpolating cu59 partition function + get_partition_function(Cu59, tfactors, cu59_pf, dcu59_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co56_pf, dco56_pf_dT; + // interpolating co56 partition function + get_partition_function(Co56, tfactors, co56_pf, dco56_pf_dT); + + Real z_r = n_pf * cu59_pf; + Real z_p = he4_pf * co56_pf; + + Real dz_r_dT = cu59_pf * dn_pf_dT + n_pf * dcu59_pf_dT; + Real dz_p_dT = co56_pf * dhe4_pf_dT + he4_pf * dco56_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_co57_to_n_ni57_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // co57 + p --> n + ni57 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 19.300752819440056 + -46.935401904849755 * tfactors.T9i + -1.13177 * tfactors.T913 + + 0.56875 * tfactors.T9 + -0.0579913 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 46.935401904849755 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * -1.13177 * tfactors.T923i + + 0.56875 + (5.0/3.0) * -0.0579913 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real co57_pf, dco57_pf_dT; + // interpolating co57 partition function + get_partition_function(Co57, tfactors, co57_pf, dco57_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real z_r = n_pf * ni57_pf; + Real z_p = p_pf * co57_pf; + + Real dz_r_dT = ni57_pf * dn_pf_dT + n_pf * dni57_pf_dT; + Real dz_p_dT = co57_pf * dp_pf_dT + p_pf * dco57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ni57_to_n_zn60_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni57 + he4 --> n + zn60 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 9.728451219341542 + -87.50502934883477 * tfactors.T9i + 5.43552 * tfactors.T913 + + -1.25169 * tfactors.T9 + 0.148383 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 87.50502934883477 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 5.43552 * tfactors.T923i + + -1.25169 + (5.0/3.0) * 0.148383 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real n_pf, dn_pf_dT; + // setting n partition function to 1.0 by default, independent of T + n_pf = 1.0_rt; + dn_pf_dT = 0.0_rt; + + Real ni57_pf, dni57_pf_dT; + // interpolating ni57 partition function + get_partition_function(Ni57, tfactors, ni57_pf, dni57_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real zn60_pf, dzn60_pf_dT; + // interpolating zn60 partition function + get_partition_function(Zn60, tfactors, zn60_pf, dzn60_pf_dT); + + Real z_r = n_pf * zn60_pf; + Real z_p = he4_pf * ni57_pf; + + Real dz_r_dT = zn60_pf * dn_pf_dT + n_pf * dzn60_pf_dT; + Real dz_p_dT = ni57_pf * dhe4_pf_dT + he4_pf * dni57_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_ni58_to_he4_co55_derived(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ni58 + p --> he4 + co55 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 63.614171164828804 + -15.504564572101842 * tfactors.T9i + -94.1404 * tfactors.T913i + 3.39179 * tfactors.T913 + + -1.71062 * tfactors.T9 + 0.133003 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 15.504564572101842 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -94.1404 * tfactors.T943i + (1.0/3.0) * 3.39179 * tfactors.T923i + + -1.71062 + (5.0/3.0) * 0.133003 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real co55_pf, dco55_pf_dT; + // interpolating co55 partition function + get_partition_function(Co55, tfactors, co55_pf, dco55_pf_dT); + + Real ni58_pf, dni58_pf_dT; + // interpolating ni58 partition function + get_partition_function(Ni58, tfactors, ni58_pf, dni58_pf_dT); + + Real z_r = he4_pf * co55_pf; + Real z_p = p_pf * ni58_pf; + + Real dz_r_dT = co55_pf * dhe4_pf_dT + he4_pf * dco55_pf_dT; + Real dz_p_dT = ni58_pf * dp_pf_dT + p_pf * dni58_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_s32_to_p_cl35_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // s32 + he4 --> p + cl35 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 2.425628238034531 + -27.66622776398283 * tfactors.T9i + 5.33756 * tfactors.T913 + + 1.64418 * tfactors.T9 + -0.246167 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 27.66622776398283 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 5.33756 * tfactors.T923i + + 1.64418 + (5.0/3.0) * -0.246167 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -0.877601761965469 + -25.59141776398283 * tfactors.T9i + + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 25.59141776398283 * tfactors.T9i * tfactors.T9i + + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -57.39498176196547 + -22.18939876398283 * tfactors.T9i + 25.5338 * tfactors.T913 + + 6.45824 * tfactors.T9 + -0.950294 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 22.18939876398283 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 25.5338 * tfactors.T923i + + 6.45824 + (5.0/3.0) * -0.950294 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 32.25441823803453 + -21.65646776398283 * tfactors.T9i + -30.9147 * tfactors.T913i + -1.2345 * tfactors.T913 + + 22.5118 * tfactors.T9 + -33.0589 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 21.65646776398283 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -30.9147 * tfactors.T943i + (1.0/3.0) * -1.2345 * tfactors.T923i + + 22.5118 + (5.0/3.0) * -33.0589 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real cl35_pf, dcl35_pf_dT; + // interpolating cl35 partition function + get_partition_function(Cl35, tfactors, cl35_pf, dcl35_pf_dT); + + Real s32_pf, ds32_pf_dT; + // interpolating s32 partition function + get_partition_function(S32, tfactors, s32_pf, ds32_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real z_r = p_pf * cl35_pf; + Real z_p = he4_pf * s32_pf; + + Real dz_r_dT = cl35_pf * dp_pf_dT + p_pf * dcl35_pf_dT; + Real dz_p_dT = s32_pf * dhe4_pf_dT + he4_pf * ds32_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ar36_to_he4_s32_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ar36 --> he4 + s32 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 73.81637663285039 + -77.06281976216322 * tfactors.T9i + -65.3709 * tfactors.T913i + 5.68294 * tfactors.T913 + + -5.00388 * tfactors.T9 + 0.571407 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 77.06281976216322 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -65.3709 * tfactors.T943i + (1.0/3.0) * 5.68294 * tfactors.T923i + + -5.00388 + (5.0/3.0) * 0.571407 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real s32_pf, ds32_pf_dT; + // interpolating s32 partition function + get_partition_function(S32, tfactors, s32_pf, ds32_pf_dT); + + Real ar36_pf, dar36_pf_dT; + // interpolating ar36 partition function + get_partition_function(Ar36, tfactors, ar36_pf, dar36_pf_dT); + + Real z_r = he4_pf * s32_pf; + Real z_p = ar36_pf; + + Real dz_r_dT = s32_pf * dhe4_pf_dT + he4_pf * ds32_pf_dT; + Real dz_p_dT = dar36_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ar36_to_p_cl35_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ar36 --> p + cl35 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // il10c + ln_set_rate = 16.01685487088493 + -100.72924752614605 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 100.72924752614605 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = -17.47510512911507 + -99.28393852614604 * tfactors.T9i; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 99.28393852614604 * tfactors.T9i * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 60.73659487088493 + -98.71928752614605 * tfactors.T9i + -27.8971 * tfactors.T913i + -16.2304 * tfactors.T913 + + 35.255 * tfactors.T9 + -25.8411 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 98.71928752614605 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -27.8971 * tfactors.T943i + (1.0/3.0) * -16.2304 * tfactors.T923i + + 35.255 + (5.0/3.0) * -25.8411 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // il10c + ln_set_rate = 17.202804870884933 + -102.37020752614605 * tfactors.T9i + 18.0179 * tfactors.T913 + + -2.86304 * tfactors.T9 + 0.250854 * tfactors.T953; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 102.37020752614605 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 18.0179 * tfactors.T923i + + -2.86304 + (5.0/3.0) * 0.250854 * tfactors.T923; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real cl35_pf, dcl35_pf_dT; + // interpolating cl35 partition function + get_partition_function(Cl35, tfactors, cl35_pf, dcl35_pf_dT); + + Real ar36_pf, dar36_pf_dT; + // interpolating ar36 partition function + get_partition_function(Ar36, tfactors, ar36_pf, dar36_pf_dT); + + Real z_r = p_pf * cl35_pf; + Real z_p = ar36_pf; + + Real dz_r_dT = cl35_pf * dp_pf_dT + p_pf * dcl35_pf_dT; + Real dz_p_dT = dar36_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ar36_to_p_k39_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ar36 + he4 --> p + k39 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 20.636664061510302 + -14.953349961318928 * tfactors.T9i + -30.0732 * tfactors.T913i + 7.03263 * tfactors.T913 + + -1.10085 * tfactors.T9 + 0.133768 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 14.953349961318928 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -30.0732 * tfactors.T943i + (1.0/3.0) * 7.03263 * tfactors.T923i + + -1.10085 + (5.0/3.0) * 0.133768 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real k39_pf, dk39_pf_dT; + // interpolating k39 partition function + get_partition_function(K39, tfactors, k39_pf, dk39_pf_dT); + + Real ar36_pf, dar36_pf_dT; + // interpolating ar36 partition function + get_partition_function(Ar36, tfactors, ar36_pf, dar36_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real z_r = p_pf * k39_pf; + Real z_p = he4_pf * ar36_pf; + + Real dz_r_dT = k39_pf * dp_pf_dT + p_pf * dk39_pf_dT; + Real dz_p_dT = ar36_pf * dhe4_pf_dT + he4_pf * dar36_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ca40_to_he4_ar36_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ca40 --> he4 + ar36 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 77.28261041284823 + -81.69174599574632 * tfactors.T9i + -71.0046 * tfactors.T913i + 4.0656 * tfactors.T913 + + -5.26509 * tfactors.T9 + 0.683546 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 81.69174599574632 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -71.0046 * tfactors.T943i + (1.0/3.0) * 4.0656 * tfactors.T923i + + -5.26509 + (5.0/3.0) * 0.683546 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ca40_pf, dca40_pf_dT; + // interpolating ca40 partition function + get_partition_function(Ca40, tfactors, ca40_pf, dca40_pf_dT); + + Real ar36_pf, dar36_pf_dT; + // interpolating ar36 partition function + get_partition_function(Ar36, tfactors, ar36_pf, dar36_pf_dT); + + Real z_r = he4_pf * ar36_pf; + Real z_p = ca40_pf; + + Real dz_r_dT = ar36_pf * dhe4_pf_dT + he4_pf * dar36_pf_dT; + Real dz_p_dT = dca40_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ca40_to_p_k39_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ca40 --> p + k39 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // lo18r + ln_set_rate = 2786.4340744743586 + -101.86662364079672 * tfactors.T9i + 802.18 * tfactors.T913i + -4010.27 * tfactors.T913 + + 1137.69 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 101.86662364079672 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 802.18 * tfactors.T943i + (1.0/3.0) * -4010.27 * tfactors.T923i + + 1137.69 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // lo18r + ln_set_rate = 613.1530744743586 + -109.20898364079672 * tfactors.T9i + 641.844 * tfactors.T913i + -1248.49 * tfactors.T913 + + 566.426 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 109.20898364079672 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 641.844 * tfactors.T943i + (1.0/3.0) * -1248.49 * tfactors.T923i + + 566.426 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // lo18r + ln_set_rate = 127.30607447435852 + -98.30936364079672 * tfactors.T9i + 41.1723 * tfactors.T913i + -149.299 * tfactors.T913 + + 10.5229 * tfactors.T9 + -0.68208 * tfactors.T953 + 60.7367 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 98.30936364079672 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 41.1723 * tfactors.T943i + (1.0/3.0) * -149.299 * tfactors.T923i + + 10.5229 + (5.0/3.0) * -0.68208 * tfactors.T923 + 60.7367 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ca40_pf, dca40_pf_dT; + // interpolating ca40 partition function + get_partition_function(Ca40, tfactors, ca40_pf, dca40_pf_dT); + + Real k39_pf, dk39_pf_dT; + // interpolating k39 partition function + get_partition_function(K39, tfactors, k39_pf, dk39_pf_dT); + + Real z_r = p_pf * k39_pf; + Real z_p = ca40_pf; + + Real dz_r_dT = k39_pf * dp_pf_dT + p_pf * dk39_pf_dT; + Real dz_p_dT = dca40_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_he4_ca40_to_p_sc43_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ca40 + he4 --> p + sc43 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 35.65752817292938 + -40.87575463203665 * tfactors.T9i + -32.1734 * tfactors.T913i + 0.0296879 * tfactors.T913 + + -0.95232 * tfactors.T9 + 0.129022 * tfactors.T953 + -0.666667 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 40.87575463203665 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * 0.0296879 * tfactors.T923i + + -0.95232 + (5.0/3.0) * 0.129022 * tfactors.T923 + -0.666667 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ca40_pf, dca40_pf_dT; + // interpolating ca40 partition function + get_partition_function(Ca40, tfactors, ca40_pf, dca40_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real sc43_pf, dsc43_pf_dT; + // interpolating sc43 partition function + get_partition_function(Sc43, tfactors, sc43_pf, dsc43_pf_dT); + + Real z_r = p_pf * sc43_pf; + Real z_p = he4_pf * ca40_pf; + + Real dz_r_dT = sc43_pf * dp_pf_dT + p_pf * dsc43_pf_dT; + Real dz_p_dT = ca40_pf * dhe4_pf_dT + he4_pf * dca40_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ti44_to_he4_ca40_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ti44 --> he4 + ca40 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // chw0 + ln_set_rate = 78.69908591662849 + -59.4975248620018 * tfactors.T9i + -76.4273 * tfactors.T913i + 3.87451 * tfactors.T913 + + -3.61477 * tfactors.T9 + 0.367451 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 59.4975248620018 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -76.4273 * tfactors.T943i + (1.0/3.0) * 3.87451 * tfactors.T923i + + -3.61477 + (5.0/3.0) * 0.367451 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ca40_pf, dca40_pf_dT; + // interpolating ca40 partition function + get_partition_function(Ca40, tfactors, ca40_pf, dca40_pf_dT); + + Real ti44_pf, dti44_pf_dT; + // interpolating ti44 partition function + get_partition_function(Ti44, tfactors, ti44_pf, dti44_pf_dT); + + Real z_r = he4_pf * ca40_pf; + Real z_p = ti44_pf; + + Real dz_r_dT = ca40_pf * dhe4_pf_dT + he4_pf * dca40_pf_dT; + Real dz_p_dT = dti44_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ti44_to_p_sc43_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // ti44 --> p + sc43 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 62.59391408955788 + -100.37327949403844 * tfactors.T9i + -32.1734 * tfactors.T913i + -1.77078 * tfactors.T913 + + -2.21706 * tfactors.T9 + 0.298499 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 100.37327949403844 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -32.1734 * tfactors.T943i + (1.0/3.0) * -1.77078 * tfactors.T923i + + -2.21706 + (5.0/3.0) * 0.298499 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real ti44_pf, dti44_pf_dT; + // interpolating ti44 partition function + get_partition_function(Ti44, tfactors, ti44_pf, dti44_pf_dT); + + Real sc43_pf, dsc43_pf_dT; + // interpolating sc43 partition function + get_partition_function(Sc43, tfactors, sc43_pf, dsc43_pf_dT); + + Real z_r = p_pf * sc43_pf; + Real z_p = ti44_pf; + + Real dz_r_dT = sc43_pf * dp_pf_dT + p_pf * dsc43_pf_dT; + Real dz_p_dT = dti44_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_cr48_to_he4_ti44_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cr48 --> he4 + ti44 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // ths8r + ln_set_rate = 89.75733412085052 + -89.3041938384302 * tfactors.T9i + -81.667 * tfactors.T913i + -10.6333 * tfactors.T913 + + -0.672613 * tfactors.T9 + 0.161209 * tfactors.T953 + 0.833333 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 89.3041938384302 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -81.667 * tfactors.T943i + (1.0/3.0) * -10.6333 * tfactors.T923i + + -0.672613 + (5.0/3.0) * 0.161209 * tfactors.T923 + 0.833333 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cr48_pf, dcr48_pf_dT; + // interpolating cr48 partition function + get_partition_function(Cr48, tfactors, cr48_pf, dcr48_pf_dT); + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real ti44_pf, dti44_pf_dT; + // interpolating ti44 partition function + get_partition_function(Ti44, tfactors, ti44_pf, dti44_pf_dT); + + Real z_r = he4_pf * ti44_pf; + Real z_p = cr48_pf; + + Real dz_r_dT = ti44_pf * dhe4_pf_dT + he4_pf * dti44_pf_dT; + Real dz_p_dT = dcr48_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_cr48_to_p_v47_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // cr48 --> p + v47 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // nfisn + ln_set_rate = 67.74027107253823 + -100.12633621113824 * tfactors.T9i + -34.0548 * tfactors.T913i + -3.41973 * tfactors.T913 + + 1.16501 * tfactors.T9 + -0.105543 * tfactors.T953 + -6.20886 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 100.12633621113824 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -34.0548 * tfactors.T943i + (1.0/3.0) * -3.41973 * tfactors.T923i + + 1.16501 + (5.0/3.0) * -0.105543 * tfactors.T923 + -6.20886 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 536.5234710725382 + -99.36194621113825 * tfactors.T9i + 317.171 * tfactors.T913i + -911.679 * tfactors.T913 + + 94.4245 * tfactors.T9 + -10.1973 * tfactors.T953 + 332.227 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 99.36194621113825 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * 317.171 * tfactors.T943i + (1.0/3.0) * -911.679 * tfactors.T923i + + 94.4245 + (5.0/3.0) * -10.1973 * tfactors.T923 + 332.227 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 48.891971072538226 + -93.82037121113825 * tfactors.T9i + -45.9868 * tfactors.T913i + 13.6822 * tfactors.T913 + + -0.376902 * tfactors.T9 + -0.0194875 * tfactors.T953 + -6.9232499999999995 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 93.82037121113825 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -45.9868 * tfactors.T943i + (1.0/3.0) * 13.6822 * tfactors.T923i + + -0.376902 + (5.0/3.0) * -0.0194875 * tfactors.T923 + -6.9232499999999995 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + // nfisn + ln_set_rate = 65.62307107253824 + -94.58145021113825 * tfactors.T9i + -110.655 * tfactors.T913i + 83.0232 * tfactors.T913 + + -19.7762 * tfactors.T9 + 3.03961 * tfactors.T953 + -47.9742 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 94.58145021113825 * tfactors.T9i * tfactors.T9i + -(1.0/3.0) * -110.655 * tfactors.T943i + (1.0/3.0) * 83.0232 * tfactors.T923i + + -19.7762 + (5.0/3.0) * 3.03961 * tfactors.T923 + -47.9742 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real cr48_pf, dcr48_pf_dT; + // interpolating cr48 partition function + get_partition_function(Cr48, tfactors, cr48_pf, dcr48_pf_dT); + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real v47_pf, dv47_pf_dT; + // interpolating v47 partition function + get_partition_function(V47, tfactors, v47_pf, dv47_pf_dT); + + Real z_r = p_pf * v47_pf; + Real z_p = cr48_pf; + + Real dz_r_dT = v47_pf * dp_pf_dT + p_pf * dv47_pf_dT; + Real dz_p_dT = dcr48_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_p_v47_to_he4_ti44_derived_removed(const tf_t& tfactors, Real& rate, Real& drate_dT) { + + // v47 + p --> he4 + ti44 + + rate = 0.0; + drate_dT = 0.0; + + Real ln_set_rate{0.0}; + Real dln_set_rate_dT9{0.0}; + Real set_rate{0.0}; + + // chw0r + ln_set_rate = -76.61433695168769 + -6.029445311023438 * tfactors.T9i + 70.2835 * tfactors.T913 + + -7.99061 * tfactors.T9 + 0.486213 * tfactors.T953 + -1.5 * tfactors.lnT9; + + if constexpr (do_T_derivatives) { + dln_set_rate_dT9 = 6.029445311023438 * tfactors.T9i * tfactors.T9i + (1.0/3.0) * 70.2835 * tfactors.T923i + + -7.99061 + (5.0/3.0) * 0.486213 * tfactors.T923 + -1.5 * tfactors.T9i; + } + + // avoid underflows by zeroing rates in [0.0, 1.e-100] + ln_set_rate = std::max(ln_set_rate, -230.0); + set_rate = std::exp(ln_set_rate); + rate += set_rate; + if constexpr (do_T_derivatives) { + drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; + } + + + Real p_pf, dp_pf_dT; + // setting p partition function to 1.0 by default, independent of T + p_pf = 1.0_rt; + dp_pf_dT = 0.0_rt; + + Real he4_pf, dhe4_pf_dT; + // setting he4 partition function to 1.0 by default, independent of T + he4_pf = 1.0_rt; + dhe4_pf_dT = 0.0_rt; + + Real v47_pf, dv47_pf_dT; + // interpolating v47 partition function + get_partition_function(V47, tfactors, v47_pf, dv47_pf_dT); + + Real ti44_pf, dti44_pf_dT; + // interpolating ti44 partition function + get_partition_function(Ti44, tfactors, ti44_pf, dti44_pf_dT); + + Real z_r = he4_pf * ti44_pf; + Real z_p = p_pf * v47_pf; + + Real dz_r_dT = ti44_pf * dhe4_pf_dT + he4_pf * dti44_pf_dT; + Real dz_p_dT = v47_pf * dp_pf_dT + p_pf * dv47_pf_dT; + + Real dzterm_dT = (z_p * dz_r_dT - z_r * dz_p_dT) / (z_p * z_p); + + drate_dT = dzterm_dT * rate + drate_dT * (z_r / z_p); + rate *= z_r/z_p; + +} + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_s32_he4_to_ar36_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ag = rate_eval.screened_rates(k_he4_s32_to_ar36_removed); + Real r_ap = rate_eval.screened_rates(k_he4_s32_to_p_cl35_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_cl35_to_ar36_removed); + Real r_pa = rate_eval.screened_rates(k_p_cl35_to_he4_s32_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ag + r_ap * r_pg * dd; + if constexpr (std::is_same::value) { + Real drdT_ag = rate_eval.dscreened_rates_dT(k_he4_s32_to_ar36_removed); + Real drdT_ap = rate_eval.dscreened_rates_dT(k_he4_s32_to_p_cl35_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_cl35_to_ar36_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_cl35_to_he4_s32_removed); + drate_dT = drdT_ag + drdT_ap * r_pg * dd + r_ap * drdT_pg * dd - r_ap * r_pg * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ar36_to_s32_he4_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ga = rate_eval.screened_rates(k_ar36_to_he4_s32_derived_removed); + Real r_pa = rate_eval.screened_rates(k_p_cl35_to_he4_s32_removed); + Real r_gp = rate_eval.screened_rates(k_ar36_to_p_cl35_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_cl35_to_ar36_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ga + r_gp * r_pa * dd; + if constexpr (std::is_same::value) { + Real drdT_ga = rate_eval.dscreened_rates_dT(k_ar36_to_he4_s32_derived_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_cl35_to_he4_s32_removed); + Real drdT_gp = rate_eval.dscreened_rates_dT(k_ar36_to_p_cl35_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_cl35_to_ar36_removed); + drate_dT = drdT_ga + drdT_gp * r_pa * dd + r_gp * drdT_pa * dd - r_gp * r_pa * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ar36_he4_to_ca40_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ag = rate_eval.screened_rates(k_he4_ar36_to_ca40_removed); + Real r_ap = rate_eval.screened_rates(k_he4_ar36_to_p_k39_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_k39_to_ca40_removed); + Real r_pa = rate_eval.screened_rates(k_p_k39_to_he4_ar36_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ag + r_ap * r_pg * dd; + if constexpr (std::is_same::value) { + Real drdT_ag = rate_eval.dscreened_rates_dT(k_he4_ar36_to_ca40_removed); + Real drdT_ap = rate_eval.dscreened_rates_dT(k_he4_ar36_to_p_k39_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_k39_to_ca40_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_k39_to_he4_ar36_removed); + drate_dT = drdT_ag + drdT_ap * r_pg * dd + r_ap * drdT_pg * dd - r_ap * r_pg * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ca40_to_ar36_he4_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ga = rate_eval.screened_rates(k_ca40_to_he4_ar36_derived_removed); + Real r_pa = rate_eval.screened_rates(k_p_k39_to_he4_ar36_removed); + Real r_gp = rate_eval.screened_rates(k_ca40_to_p_k39_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_k39_to_ca40_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ga + r_gp * r_pa * dd; + if constexpr (std::is_same::value) { + Real drdT_ga = rate_eval.dscreened_rates_dT(k_ca40_to_he4_ar36_derived_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_k39_to_he4_ar36_removed); + Real drdT_gp = rate_eval.dscreened_rates_dT(k_ca40_to_p_k39_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_k39_to_ca40_removed); + drate_dT = drdT_ga + drdT_gp * r_pa * dd + r_gp * drdT_pa * dd - r_gp * r_pa * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ca40_he4_to_ti44_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ag = rate_eval.screened_rates(k_he4_ca40_to_ti44_removed); + Real r_ap = rate_eval.screened_rates(k_he4_ca40_to_p_sc43_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_sc43_to_ti44_removed); + Real r_pa = rate_eval.screened_rates(k_p_sc43_to_he4_ca40_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ag + r_ap * r_pg * dd; + if constexpr (std::is_same::value) { + Real drdT_ag = rate_eval.dscreened_rates_dT(k_he4_ca40_to_ti44_removed); + Real drdT_ap = rate_eval.dscreened_rates_dT(k_he4_ca40_to_p_sc43_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_sc43_to_ti44_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_sc43_to_he4_ca40_removed); + drate_dT = drdT_ag + drdT_ap * r_pg * dd + r_ap * drdT_pg * dd - r_ap * r_pg * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ti44_to_ca40_he4_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ga = rate_eval.screened_rates(k_ti44_to_he4_ca40_derived_removed); + Real r_pa = rate_eval.screened_rates(k_p_sc43_to_he4_ca40_removed); + Real r_gp = rate_eval.screened_rates(k_ti44_to_p_sc43_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_sc43_to_ti44_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ga + r_gp * r_pa * dd; + if constexpr (std::is_same::value) { + Real drdT_ga = rate_eval.dscreened_rates_dT(k_ti44_to_he4_ca40_derived_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_sc43_to_he4_ca40_removed); + Real drdT_gp = rate_eval.dscreened_rates_dT(k_ti44_to_p_sc43_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_sc43_to_ti44_removed); + drate_dT = drdT_ga + drdT_gp * r_pa * dd + r_gp * drdT_pa * dd - r_gp * r_pa * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_ti44_he4_to_cr48_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ag = rate_eval.screened_rates(k_he4_ti44_to_cr48_removed); + Real r_ap = rate_eval.screened_rates(k_he4_ti44_to_p_v47_removed); + Real r_pg = rate_eval.screened_rates(k_p_v47_to_cr48_removed); + Real r_pa = rate_eval.screened_rates(k_p_v47_to_he4_ti44_derived_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ag + r_ap * r_pg * dd; + if constexpr (std::is_same::value) { + Real drdT_ag = rate_eval.dscreened_rates_dT(k_he4_ti44_to_cr48_removed); + Real drdT_ap = rate_eval.dscreened_rates_dT(k_he4_ti44_to_p_v47_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_v47_to_cr48_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_v47_to_he4_ti44_derived_removed); + drate_dT = drdT_ag + drdT_ap * r_pg * dd + r_ap * drdT_pg * dd - r_ap * r_pg * dd * dd * (drdT_pg + drdT_pa); + } +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void rate_cr48_to_ti44_he4_approx(const T& rate_eval, Real& rate, Real& drate_dT) { + + Real r_ga = rate_eval.screened_rates(k_cr48_to_he4_ti44_derived_removed); + Real r_pa = rate_eval.screened_rates(k_p_v47_to_he4_ti44_derived_removed); + Real r_gp = rate_eval.screened_rates(k_cr48_to_p_v47_derived_removed); + Real r_pg = rate_eval.screened_rates(k_p_v47_to_cr48_removed); + Real dd = 1.0_rt / (r_pg + r_pa); + rate = r_ga + r_gp * r_pa * dd; + if constexpr (std::is_same::value) { + Real drdT_ga = rate_eval.dscreened_rates_dT(k_cr48_to_he4_ti44_derived_removed); + Real drdT_pa = rate_eval.dscreened_rates_dT(k_p_v47_to_he4_ti44_derived_removed); + Real drdT_gp = rate_eval.dscreened_rates_dT(k_cr48_to_p_v47_derived_removed); + Real drdT_pg = rate_eval.dscreened_rates_dT(k_p_v47_to_cr48_removed); + drate_dT = drdT_ga + drdT_gp * r_pa * dd + r_gp * drdT_pa * dd - r_gp * r_pa * dd * dd * (drdT_pg + drdT_pa); + } +} + + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void +fill_reaclib_rates(const tf_t& tfactors, T& rate_eval) +{ + + Real rate; + Real drate_dT; + + rate_p_c12_to_n13(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_c12_to_n13) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_c12_to_n13) = drate_dT; + + } + rate_he4_c12_to_o16(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_c12_to_o16) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_c12_to_o16) = drate_dT; + + } + rate_he4_n14_to_f18(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_n14_to_f18) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_n14_to_f18) = drate_dT; + + } + rate_he4_o16_to_ne20(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_o16_to_ne20) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_o16_to_ne20) = drate_dT; + + } + rate_he4_f18_to_na22(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_f18_to_na22) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_f18_to_na22) = drate_dT; + + } + rate_he4_ne20_to_mg24(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ne20_to_mg24) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ne20_to_mg24) = drate_dT; + + } + rate_p_ne21_to_na22(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_ne21_to_na22) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_ne21_to_na22) = drate_dT; + + } + rate_p_na23_to_mg24(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_na23_to_mg24) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_na23_to_mg24) = drate_dT; + + } + rate_he4_mg24_to_si28(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_mg24_to_si28) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_mg24_to_si28) = drate_dT; + + } + rate_p_al27_to_si28(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_al27_to_si28) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_al27_to_si28) = drate_dT; + + } + rate_he4_si28_to_s32(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_si28_to_s32) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_si28_to_s32) = drate_dT; + + } + rate_p_p31_to_s32(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_p31_to_s32) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_p31_to_s32) = drate_dT; + + } + rate_he4_cr48_to_fe52(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_cr48_to_fe52) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_cr48_to_fe52) = drate_dT; + + } + rate_p_mn51_to_fe52(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_mn51_to_fe52) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_mn51_to_fe52) = drate_dT; + + } + rate_he4_mn51_to_co55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_mn51_to_co55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_mn51_to_co55) = drate_dT; + + } + rate_he4_fe52_to_ni56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe52_to_ni56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe52_to_ni56) = drate_dT; + + } + rate_p_co55_to_ni56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co55_to_ni56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co55_to_ni56) = drate_dT; + + } + rate_he4_co55_to_cu59(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_co55_to_cu59) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_co55_to_cu59) = drate_dT; + + } + rate_he4_ni56_to_zn60(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ni56_to_zn60) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ni56_to_zn60) = drate_dT; + + } + rate_p_cu59_to_zn60(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_cu59_to_zn60) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_cu59_to_zn60) = drate_dT; + + } + rate_c12_c12_to_p_na23(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_c12_to_p_na23) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_c12_to_p_na23) = drate_dT; + + } + rate_c12_c12_to_he4_ne20(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_c12_to_he4_ne20) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_c12_to_he4_ne20) = drate_dT; + + } + rate_he4_n13_to_p_o16(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_n13_to_p_o16) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_n13_to_p_o16) = drate_dT; + + } + rate_c12_o16_to_p_al27(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_o16_to_p_al27) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_o16_to_p_al27) = drate_dT; + + } + rate_c12_o16_to_he4_mg24(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_o16_to_he4_mg24) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_o16_to_he4_mg24) = drate_dT; + + } + rate_o16_o16_to_p_p31(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_o16_o16_to_p_p31) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_o16_o16_to_p_p31) = drate_dT; + + } + rate_o16_o16_to_he4_si28(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_o16_o16_to_he4_si28) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_o16_o16_to_he4_si28) = drate_dT; + + } + rate_he4_f18_to_p_ne21(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_f18_to_p_ne21) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_f18_to_p_ne21) = drate_dT; + + } + rate_p_na23_to_he4_ne20(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_na23_to_he4_ne20) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_na23_to_he4_ne20) = drate_dT; + + } + rate_p_al27_to_he4_mg24(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_al27_to_he4_mg24) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_al27_to_he4_mg24) = drate_dT; + + } + rate_p_p31_to_he4_si28(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_p31_to_he4_si28) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_p31_to_he4_si28) = drate_dT; + + } + rate_he4_cr48_to_p_mn51(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_cr48_to_p_mn51) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_cr48_to_p_mn51) = drate_dT; + + } + rate_he4_fe52_to_p_co55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe52_to_p_co55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe52_to_p_co55) = drate_dT; + + } + rate_p_cu59_to_he4_ni56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_cu59_to_he4_ni56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_cu59_to_he4_ni56) = drate_dT; + + } + rate_he4_he4_he4_to_c12(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_he4_he4_to_c12) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_he4_he4_to_c12) = drate_dT; + + } + rate_c12_c12_to_mg24_modified(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_c12_to_mg24_modified) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_c12_to_mg24_modified) = drate_dT; + + } + rate_o16_o16_to_s32_modified(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_o16_o16_to_s32_modified) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_o16_o16_to_s32_modified) = drate_dT; + + } + rate_c12_o16_to_si28_modified(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_o16_to_si28_modified) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_o16_to_si28_modified) = drate_dT; + + } + rate_n_to_p_weak_wc12(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_to_p_weak_wc12) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_to_p_weak_wc12) = drate_dT; + + } + rate_p_mn55_to_fe56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_mn55_to_fe56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_mn55_to_fe56) = drate_dT; + + } + rate_n_fe52_to_fe53(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_fe52_to_fe53) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_fe52_to_fe53) = drate_dT; + + } + rate_n_fe53_to_fe54(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_fe53_to_fe54) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_fe53_to_fe54) = drate_dT; + + } + rate_he4_fe53_to_ni57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe53_to_ni57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe53_to_ni57) = drate_dT; + + } + rate_n_fe54_to_fe55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_fe54_to_fe55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_fe54_to_fe55) = drate_dT; + + } + rate_p_fe54_to_co55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe54_to_co55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe54_to_co55) = drate_dT; + + } + rate_he4_fe54_to_ni58(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe54_to_ni58) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe54_to_ni58) = drate_dT; + + } + rate_n_fe55_to_fe56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_fe55_to_fe56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_fe55_to_fe56) = drate_dT; + + } + rate_p_fe55_to_co56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe55_to_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe55_to_co56) = drate_dT; + + } + rate_p_fe56_to_co57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe56_to_co57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe56_to_co57) = drate_dT; + + } + rate_n_co55_to_co56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_co55_to_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_co55_to_co56) = drate_dT; + + } + rate_n_co56_to_co57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_co56_to_co57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_co56_to_co57) = drate_dT; + + } + rate_p_co56_to_ni57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co56_to_ni57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co56_to_ni57) = drate_dT; + + } + rate_p_co57_to_ni58(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co57_to_ni58) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co57_to_ni58) = drate_dT; + + } + rate_n_ni56_to_ni57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni56_to_ni57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni56_to_ni57) = drate_dT; + + } + rate_n_ni57_to_ni58(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni57_to_ni58) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni57_to_ni58) = drate_dT; + + } + rate_p_ni58_to_cu59(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_ni58_to_cu59) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_ni58_to_cu59) = drate_dT; + + } + rate_he4_mn51_to_p_fe54(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_mn51_to_p_fe54) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_mn51_to_p_fe54) = drate_dT; + + } + rate_he4_fe53_to_p_co56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe53_to_p_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe53_to_p_co56) = drate_dT; + + } + rate_n_fe55_to_p_mn55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_fe55_to_p_mn55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_fe55_to_p_mn55) = drate_dT; + + } + rate_n_co55_to_p_fe55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_co55_to_p_fe55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_co55_to_p_fe55) = drate_dT; + + } + rate_he4_co55_to_p_ni58(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_co55_to_p_ni58) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_co55_to_p_ni58) = drate_dT; + + } + rate_n_co56_to_p_fe56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_co56_to_p_fe56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_co56_to_p_fe56) = drate_dT; + + } + rate_p_co57_to_he4_fe54(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co57_to_he4_fe54) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co57_to_he4_fe54) = drate_dT; + + } + rate_n_ni56_to_p_co56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni56_to_p_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni56_to_p_co56) = drate_dT; + + } + rate_n_ni56_to_he4_fe53(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni56_to_he4_fe53) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni56_to_he4_fe53) = drate_dT; + + } + rate_n_ni57_to_p_co57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni57_to_p_co57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni57_to_p_co57) = drate_dT; + + } + rate_n_ni57_to_he4_fe54(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni57_to_he4_fe54) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni57_to_he4_fe54) = drate_dT; + + } + rate_n_ni58_to_he4_fe55(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_ni58_to_he4_fe55) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_ni58_to_he4_fe55) = drate_dT; + + } + rate_n_cu59_to_he4_co56(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_cu59_to_he4_co56) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_cu59_to_he4_co56) = drate_dT; + + } + rate_n_zn60_to_he4_ni57(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n_zn60_to_he4_ni57) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_zn60_to_he4_ni57) = drate_dT; + + } + rate_he4_s32_to_ar36_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_s32_to_ar36_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_s32_to_ar36_removed) = drate_dT; + + } + rate_p_cl35_to_ar36_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_cl35_to_ar36_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_cl35_to_ar36_removed) = drate_dT; + + } + rate_p_cl35_to_he4_s32_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_cl35_to_he4_s32_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_cl35_to_he4_s32_removed) = drate_dT; + + } + rate_he4_ar36_to_ca40_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ar36_to_ca40_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ar36_to_ca40_removed) = drate_dT; + + } + rate_p_k39_to_ca40_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_k39_to_ca40_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_k39_to_ca40_removed) = drate_dT; + + } + rate_p_k39_to_he4_ar36_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_k39_to_he4_ar36_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_k39_to_he4_ar36_removed) = drate_dT; + + } + rate_he4_ca40_to_ti44_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ca40_to_ti44_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ca40_to_ti44_removed) = drate_dT; + + } + rate_p_sc43_to_ti44_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_sc43_to_ti44_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_sc43_to_ti44_removed) = drate_dT; + + } + rate_p_sc43_to_he4_ca40_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_sc43_to_he4_ca40_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_sc43_to_he4_ca40_removed) = drate_dT; + + } + rate_he4_ti44_to_cr48_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ti44_to_cr48_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ti44_to_cr48_removed) = drate_dT; + + } + rate_he4_ti44_to_p_v47_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ti44_to_p_v47_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ti44_to_p_v47_removed) = drate_dT; + + } + rate_p_v47_to_cr48_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_v47_to_cr48_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_v47_to_cr48_removed) = drate_dT; + + } + rate_n13_to_p_c12_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_n13_to_p_c12_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n13_to_p_c12_derived) = drate_dT; + + } + rate_o16_to_he4_c12_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_o16_to_he4_c12_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_o16_to_he4_c12_derived) = drate_dT; + + } + rate_f18_to_he4_n14_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_f18_to_he4_n14_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_f18_to_he4_n14_derived) = drate_dT; + + } + rate_ne20_to_he4_o16_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ne20_to_he4_o16_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ne20_to_he4_o16_derived) = drate_dT; + + } + rate_na22_to_p_ne21_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_na22_to_p_ne21_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_na22_to_p_ne21_derived) = drate_dT; + + } + rate_na22_to_he4_f18_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_na22_to_he4_f18_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_na22_to_he4_f18_derived) = drate_dT; + + } + rate_mg24_to_p_na23_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_mg24_to_p_na23_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_mg24_to_p_na23_derived) = drate_dT; + + } + rate_mg24_to_he4_ne20_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_mg24_to_he4_ne20_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_mg24_to_he4_ne20_derived) = drate_dT; + + } + rate_si28_to_p_al27_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_si28_to_p_al27_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_si28_to_p_al27_derived) = drate_dT; + + } + rate_si28_to_he4_mg24_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_si28_to_he4_mg24_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_si28_to_he4_mg24_derived) = drate_dT; + + } + rate_s32_to_p_p31_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_s32_to_p_p31_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_s32_to_p_p31_derived) = drate_dT; + + } + rate_s32_to_he4_si28_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_s32_to_he4_si28_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_s32_to_he4_si28_derived) = drate_dT; + + } + rate_fe52_to_p_mn51_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe52_to_p_mn51_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe52_to_p_mn51_derived) = drate_dT; + + } + rate_fe52_to_he4_cr48_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe52_to_he4_cr48_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe52_to_he4_cr48_derived) = drate_dT; + + } + rate_co55_to_he4_mn51_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co55_to_he4_mn51_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co55_to_he4_mn51_derived) = drate_dT; + + } + rate_ni56_to_p_co55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni56_to_p_co55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni56_to_p_co55_derived) = drate_dT; + + } + rate_ni56_to_he4_fe52_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni56_to_he4_fe52_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni56_to_he4_fe52_derived) = drate_dT; + + } + rate_cu59_to_he4_co55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_cu59_to_he4_co55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_cu59_to_he4_co55_derived) = drate_dT; + + } + rate_zn60_to_p_cu59_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_zn60_to_p_cu59_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_zn60_to_p_cu59_derived) = drate_dT; + + } + rate_zn60_to_he4_ni56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_zn60_to_he4_ni56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_zn60_to_he4_ni56_derived) = drate_dT; + + } + rate_c12_to_he4_he4_he4_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_c12_to_he4_he4_he4_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_c12_to_he4_he4_he4_derived) = drate_dT; + + } + rate_p_o16_to_he4_n13_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_o16_to_he4_n13_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_o16_to_he4_n13_derived) = drate_dT; + + } + rate_he4_ne20_to_p_na23_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ne20_to_p_na23_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ne20_to_p_na23_derived) = drate_dT; + + } + rate_p_ne21_to_he4_f18_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_ne21_to_he4_f18_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_ne21_to_he4_f18_derived) = drate_dT; + + } + rate_he4_mg24_to_p_al27_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_mg24_to_p_al27_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_mg24_to_p_al27_derived) = drate_dT; + + } + rate_he4_si28_to_p_p31_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_si28_to_p_p31_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_si28_to_p_p31_derived) = drate_dT; + + } + rate_p_mn51_to_he4_cr48_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_mn51_to_he4_cr48_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_mn51_to_he4_cr48_derived) = drate_dT; + + } + rate_p_co55_to_he4_fe52_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co55_to_he4_fe52_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co55_to_he4_fe52_derived) = drate_dT; + + } + rate_he4_ni56_to_p_cu59_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ni56_to_p_cu59_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ni56_to_p_cu59_derived) = drate_dT; + + } + rate_fe53_to_n_fe52_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe53_to_n_fe52_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe53_to_n_fe52_derived) = drate_dT; + + } + rate_fe54_to_n_fe53_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe54_to_n_fe53_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe54_to_n_fe53_derived) = drate_dT; + + } + rate_fe55_to_n_fe54_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe55_to_n_fe54_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe55_to_n_fe54_derived) = drate_dT; + + } + rate_fe56_to_n_fe55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe56_to_n_fe55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe56_to_n_fe55_derived) = drate_dT; + + } + rate_fe56_to_p_mn55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_fe56_to_p_mn55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_fe56_to_p_mn55_derived) = drate_dT; + + } + rate_co55_to_p_fe54_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co55_to_p_fe54_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co55_to_p_fe54_derived) = drate_dT; + + } + rate_co56_to_n_co55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co56_to_n_co55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co56_to_n_co55_derived) = drate_dT; + + } + rate_co56_to_p_fe55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co56_to_p_fe55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co56_to_p_fe55_derived) = drate_dT; + + } + rate_co57_to_n_co56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co57_to_n_co56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co57_to_n_co56_derived) = drate_dT; + + } + rate_co57_to_p_fe56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_co57_to_p_fe56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_co57_to_p_fe56_derived) = drate_dT; + + } + rate_ni57_to_n_ni56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni57_to_n_ni56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni57_to_n_ni56_derived) = drate_dT; + + } + rate_ni57_to_p_co56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni57_to_p_co56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni57_to_p_co56_derived) = drate_dT; + + } + rate_ni57_to_he4_fe53_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni57_to_he4_fe53_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni57_to_he4_fe53_derived) = drate_dT; + + } + rate_ni58_to_n_ni57_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni58_to_n_ni57_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni58_to_n_ni57_derived) = drate_dT; + + } + rate_ni58_to_p_co57_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni58_to_p_co57_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni58_to_p_co57_derived) = drate_dT; + + } + rate_ni58_to_he4_fe54_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ni58_to_he4_fe54_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ni58_to_he4_fe54_derived) = drate_dT; + + } + rate_cu59_to_p_ni58_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_cu59_to_p_ni58_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_cu59_to_p_ni58_derived) = drate_dT; + + } + rate_p_mn55_to_n_fe55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_mn55_to_n_fe55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_mn55_to_n_fe55_derived) = drate_dT; + + } + rate_he4_fe53_to_n_ni56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe53_to_n_ni56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe53_to_n_ni56_derived) = drate_dT; + + } + rate_p_fe54_to_he4_mn51_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe54_to_he4_mn51_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe54_to_he4_mn51_derived) = drate_dT; + + } + rate_he4_fe54_to_n_ni57_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe54_to_n_ni57_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe54_to_n_ni57_derived) = drate_dT; + + } + rate_he4_fe54_to_p_co57_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe54_to_p_co57_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe54_to_p_co57_derived) = drate_dT; + + } + rate_p_fe55_to_n_co55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe55_to_n_co55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe55_to_n_co55_derived) = drate_dT; + + } + rate_he4_fe55_to_n_ni58_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_fe55_to_n_ni58_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_fe55_to_n_ni58_derived) = drate_dT; + + } + rate_p_fe56_to_n_co56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_fe56_to_n_co56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_fe56_to_n_co56_derived) = drate_dT; + + } + rate_p_co56_to_n_ni56_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co56_to_n_ni56_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co56_to_n_ni56_derived) = drate_dT; + + } + rate_p_co56_to_he4_fe53_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co56_to_he4_fe53_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co56_to_he4_fe53_derived) = drate_dT; + + } + rate_he4_co56_to_n_cu59_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_co56_to_n_cu59_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_co56_to_n_cu59_derived) = drate_dT; + + } + rate_p_co57_to_n_ni57_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_co57_to_n_ni57_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_co57_to_n_ni57_derived) = drate_dT; + + } + rate_he4_ni57_to_n_zn60_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ni57_to_n_zn60_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ni57_to_n_zn60_derived) = drate_dT; + + } + rate_p_ni58_to_he4_co55_derived(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_ni58_to_he4_co55_derived) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_ni58_to_he4_co55_derived) = drate_dT; + + } + rate_he4_s32_to_p_cl35_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_s32_to_p_cl35_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_s32_to_p_cl35_derived_removed) = drate_dT; + + } + rate_ar36_to_he4_s32_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ar36_to_he4_s32_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ar36_to_he4_s32_derived_removed) = drate_dT; + + } + rate_ar36_to_p_cl35_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ar36_to_p_cl35_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ar36_to_p_cl35_derived_removed) = drate_dT; + + } + rate_he4_ar36_to_p_k39_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ar36_to_p_k39_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ar36_to_p_k39_derived_removed) = drate_dT; + + } + rate_ca40_to_he4_ar36_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ca40_to_he4_ar36_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ca40_to_he4_ar36_derived_removed) = drate_dT; + + } + rate_ca40_to_p_k39_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ca40_to_p_k39_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ca40_to_p_k39_derived_removed) = drate_dT; + + } + rate_he4_ca40_to_p_sc43_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_he4_ca40_to_p_sc43_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_he4_ca40_to_p_sc43_derived_removed) = drate_dT; + + } + rate_ti44_to_he4_ca40_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ti44_to_he4_ca40_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ti44_to_he4_ca40_derived_removed) = drate_dT; + + } + rate_ti44_to_p_sc43_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_ti44_to_p_sc43_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ti44_to_p_sc43_derived_removed) = drate_dT; + + } + rate_cr48_to_he4_ti44_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_cr48_to_he4_ti44_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_cr48_to_he4_ti44_derived_removed) = drate_dT; + + } + rate_cr48_to_p_v47_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_cr48_to_p_v47_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_cr48_to_p_v47_derived_removed) = drate_dT; + + } + rate_p_v47_to_he4_ti44_derived_removed(tfactors, rate, drate_dT); + rate_eval.screened_rates(k_p_v47_to_he4_ti44_derived_removed) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_v47_to_he4_ti44_derived_removed) = drate_dT; + + } + +} + +template +AMREX_GPU_HOST_DEVICE AMREX_INLINE +void +fill_approx_rates([[maybe_unused]] const tf_t& tfactors, [[maybe_unused]] T& rate_eval) +{ + + [[maybe_unused]] Real rate{}; + [[maybe_unused]] Real drate_dT{}; + + rate_s32_he4_to_ar36_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_s32_he4_to_ar36_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_s32_he4_to_ar36_approx) = drate_dT; + + } + rate_ar36_to_s32_he4_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ar36_to_s32_he4_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ar36_to_s32_he4_approx) = drate_dT; + + } + rate_ar36_he4_to_ca40_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ar36_he4_to_ca40_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ar36_he4_to_ca40_approx) = drate_dT; + + } + rate_ca40_to_ar36_he4_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ca40_to_ar36_he4_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ca40_to_ar36_he4_approx) = drate_dT; + + } + rate_ca40_he4_to_ti44_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ca40_he4_to_ti44_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ca40_he4_to_ti44_approx) = drate_dT; + + } + rate_ti44_to_ca40_he4_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ti44_to_ca40_he4_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ti44_to_ca40_he4_approx) = drate_dT; + + } + rate_ti44_he4_to_cr48_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_ti44_he4_to_cr48_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_ti44_he4_to_cr48_approx) = drate_dT; + + } + rate_cr48_to_ti44_he4_approx(rate_eval, rate, drate_dT); + rate_eval.screened_rates(k_cr48_to_ti44_he4_approx) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_cr48_to_ti44_he4_approx) = drate_dT; + + } + +} + +#endif diff --git a/networks/He-C-Fe-group/table_rates.H b/networks/He-C-Fe-group/table_rates.H new file mode 100644 index 0000000000..a9c6f74c68 --- /dev/null +++ b/networks/He-C-Fe-group/table_rates.H @@ -0,0 +1,440 @@ +#ifndef TABLE_RATES_H +#define TABLE_RATES_H + +#include +#include +#include +#include + +#include + +using namespace amrex; + +void init_tabular(); + +// Table is expected to be in terms of dens*ye and temp (logarithmic, cgs units) +// Table energy units are expected in terms of ergs + +// all tables are expected to have columns: +// Log(rhoY) Log(T) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +// Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +// + +const int num_tables = 10; + +enum TableVars +{ + jtab_mu = 1, + jtab_dq = 2, + jtab_vs = 3, + jtab_rate = 4, + jtab_nuloss = 5, + jtab_gamma = 6, + num_vars = jtab_gamma +}; + + +struct table_t +{ + int ntemp; + int nrhoy; + int nvars; + int nheader; +}; + +// we add a 7th index, k_index_dlogr_dlogt used for computing the derivative +// of Log(rate) with respect of Log(temperature) by using the table +// values. It isn't an index into the table but into the 'entries' +// array. Is important to mention that although we compute dlogr/dlogT is +// the computed quantity in 'entries', we pursue ultimately +// dr/dt as the final desired quantity to be computed for this index. + +const int k_index_dlogr_dlogt = 7; +const int add_vars = 1; // 1 Additional Var in entries + + +namespace rate_tables +{ + extern AMREX_GPU_MANAGED table_t j_co55_fe55_meta; + extern AMREX_GPU_MANAGED Array3D j_co55_fe55_data; + extern AMREX_GPU_MANAGED Array1D j_co55_fe55_rhoy; + extern AMREX_GPU_MANAGED Array1D j_co55_fe55_temp; + + extern AMREX_GPU_MANAGED table_t j_co56_fe56_meta; + extern AMREX_GPU_MANAGED Array3D j_co56_fe56_data; + extern AMREX_GPU_MANAGED Array1D j_co56_fe56_rhoy; + extern AMREX_GPU_MANAGED Array1D j_co56_fe56_temp; + + extern AMREX_GPU_MANAGED table_t j_co56_ni56_meta; + extern AMREX_GPU_MANAGED Array3D j_co56_ni56_data; + extern AMREX_GPU_MANAGED Array1D j_co56_ni56_rhoy; + extern AMREX_GPU_MANAGED Array1D j_co56_ni56_temp; + + extern AMREX_GPU_MANAGED table_t j_co57_ni57_meta; + extern AMREX_GPU_MANAGED Array3D j_co57_ni57_data; + extern AMREX_GPU_MANAGED Array1D j_co57_ni57_rhoy; + extern AMREX_GPU_MANAGED Array1D j_co57_ni57_temp; + + extern AMREX_GPU_MANAGED table_t j_fe55_co55_meta; + extern AMREX_GPU_MANAGED Array3D j_fe55_co55_data; + extern AMREX_GPU_MANAGED Array1D j_fe55_co55_rhoy; + extern AMREX_GPU_MANAGED Array1D j_fe55_co55_temp; + + extern AMREX_GPU_MANAGED table_t j_fe55_mn55_meta; + extern AMREX_GPU_MANAGED Array3D j_fe55_mn55_data; + extern AMREX_GPU_MANAGED Array1D j_fe55_mn55_rhoy; + extern AMREX_GPU_MANAGED Array1D j_fe55_mn55_temp; + + extern AMREX_GPU_MANAGED table_t j_fe56_co56_meta; + extern AMREX_GPU_MANAGED Array3D j_fe56_co56_data; + extern AMREX_GPU_MANAGED Array1D j_fe56_co56_rhoy; + extern AMREX_GPU_MANAGED Array1D j_fe56_co56_temp; + + extern AMREX_GPU_MANAGED table_t j_mn55_fe55_meta; + extern AMREX_GPU_MANAGED Array3D j_mn55_fe55_data; + extern AMREX_GPU_MANAGED Array1D j_mn55_fe55_rhoy; + extern AMREX_GPU_MANAGED Array1D j_mn55_fe55_temp; + + extern AMREX_GPU_MANAGED table_t j_ni56_co56_meta; + extern AMREX_GPU_MANAGED Array3D j_ni56_co56_data; + extern AMREX_GPU_MANAGED Array1D j_ni56_co56_rhoy; + extern AMREX_GPU_MANAGED Array1D j_ni56_co56_temp; + + extern AMREX_GPU_MANAGED table_t j_ni57_co57_meta; + extern AMREX_GPU_MANAGED Array3D j_ni57_co57_data; + extern AMREX_GPU_MANAGED Array1D j_ni57_co57_rhoy; + extern AMREX_GPU_MANAGED Array1D j_ni57_co57_temp; + +} + +template +void init_tab_info(const table_t& tf, const std::string& file, R& log_rhoy_table, T& log_temp_table, D& data) +{ + // This function initializes the selected tabular-rate tables. From the tables we are interested + // on the rate, neutrino-energy-loss and the gamma-energy entries. + + std::ifstream table; + table.open(file); + + std::string line; + + // read and skip over the header + + for (int i = 0; i < tf.nheader; ++i) { + std::getline(table, line); + } + + // now the data -- there are 2 extra columns, for log_temp and log_rhoy + + for (int j = 1; j <= tf.nrhoy; ++j) { + for (int i = 1; i <= tf.ntemp; ++i) { + std::getline(table, line); + std::istringstream sdata(line); + + sdata >> log_rhoy_table(j) >> log_temp_table(i); + + for (int n = 1; n <= tf.nvars; ++n) { + sdata >> data(i, j, n); + } + } + } + table.close(); +} + + +template +AMREX_INLINE AMREX_GPU_HOST_DEVICE +int vector_index_lu(const int vlen, const V& vector, const Real fvar) +{ + + // Returns the greatest index of vector for which vector(index) < fvar. + // Return 1 if fvar < vector(1) + // Return size(vector)-1 if fvar > vector(size(vector)) + // The interval [index, index+1] brackets fvar for fvar within the range of vector. + + int index; + + if (fvar < vector(1)) { + index = 1; + } else if (fvar > vector(vlen)) { + index = vlen - 1; + } else { + int nup = vlen; + int ndn = 1; + for (int i = 1; i <= vlen; ++i) { + int j = ndn + (nup - ndn)/2; + if (fvar < vector(j)) { + nup = j; + } else { + ndn = j; + } + if ((nup - ndn) == 1) { + break; + } + } + index = ndn; + } + return index; +} + + +AMREX_INLINE AMREX_GPU_HOST_DEVICE +Real +evaluate_linear_1d(const Real fhi, const Real flo, const Real xhi, const Real xlo, const Real x) +{ + // This function is a 1-D linear interpolator, that keeps x constant to xlo or xhi, based + // on the side, if x is outside [xlo, xhi] respectively. + + Real xx = Clamp(x, xlo, xhi); + Real f = flo + (fhi - flo) * (xx - xlo) / (xhi - xlo); + + return f; +} + +AMREX_INLINE AMREX_GPU_HOST_DEVICE +Real +evaluate_linear_2d(const Real fip1jp1, const Real fip1j, const Real fijp1, const Real fij, + const Real xhi, const Real xlo, const Real yhi, const Real ylo, + const Real x, const Real y) +{ + // This is the 2-D linear interpolator, as an extension of evaluate_linear_1d. + + Real f; + Real dx = xhi - xlo; + Real dy = yhi - ylo; + + Real E = fij; + Real C = (fijp1 - fij) / dy; + Real B = (fip1j - fij) / dx; + Real A = (fip1jp1 - B * dx - C * dy - E) / (dx * dy); + + Real xx = Clamp(x, xlo, xhi); + Real yy = Clamp(y, ylo, yhi); + + f = A * (xx - xlo) * (yy - ylo) + + B * (xx - xlo) + + C * (yy - ylo) + + E; + + return f; +} + + +template +AMREX_INLINE AMREX_GPU_HOST_DEVICE +Real +evaluate_vars(const table_t& table_meta, const R& log_rhoy_table, const T& log_temp_table, const D& data, + const Real log_rhoy, const Real log_temp, const int component) +{ + // This function evaluates the 2-D interpolator, for several pairs of rho_ye and temperature. + + int jtemp_lo = vector_index_lu(table_meta.ntemp, log_temp_table, log_temp); + int jtemp_hi = jtemp_lo + 1; + + int irhoy_lo = vector_index_lu(table_meta.nrhoy, log_rhoy_table, log_rhoy); + int irhoy_hi = irhoy_lo + 1; + + Real rhoy_lo = log_rhoy_table(irhoy_lo); + Real rhoy_hi = log_rhoy_table(irhoy_hi); + + Real t_lo = log_temp_table(jtemp_lo); + Real t_hi = log_temp_table(jtemp_hi); + + Real fij = data(jtemp_lo, irhoy_lo, component); + Real fip1j = data(jtemp_lo, irhoy_hi, component); + Real fijp1 = data(jtemp_hi, irhoy_lo, component); + Real fip1jp1 = data(jtemp_hi, irhoy_hi, component); + + Real r = evaluate_linear_2d(fip1jp1, fip1j, fijp1, fij, + rhoy_hi, rhoy_lo, t_hi, t_lo, log_rhoy, log_temp); + + return r; +} + + +template +AMREX_INLINE AMREX_GPU_HOST_DEVICE +Real +evaluate_dr_dtemp(const table_t& table_meta, const R& log_rhoy_table, const T& log_temp_table, const D& data, + const Real log_rhoy, const Real log_temp) +{ + // The main objective of this function is compute dlogr_dlogt. + + int irhoy_lo = vector_index_lu(table_meta.nrhoy, log_rhoy_table, log_rhoy); + int irhoy_hi = irhoy_lo + 1; + + int jtemp_lo = vector_index_lu(table_meta.ntemp, log_temp_table, log_temp); + int jtemp_hi = jtemp_lo + 1; + + Real dlogr_dlogt; + + //Now we compute the forward finite difference on the boundary + + if ((jtemp_lo - 1 < 1) || (jtemp_hi + 1 > table_meta.ntemp)) { + + // In this case we are in the boundaries of the table. + // At the boundary, we compute the forward-j finite difference + // to compute dlogr_dlogt_i and dlogr_dlogt_ip1, using the + // following stencil: + // + // + // fijp1-----------fip1jp1 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fij-------------fip1j + // + // with the following result: + // + // dlogr_dlogt_i --------dlogr_dlogt_ip1 + // + // Finally, we perform a 1d-linear interpolation between dlogr_dlogt_ip1 + // and dlogr_dlogt_i to compute dlogr_dlogt + + Real log_rhoy_lo = log_temp_table(irhoy_lo); + Real log_rhoy_hi = log_temp_table(irhoy_hi); + + Real log_temp_lo = log_temp_table(jtemp_lo); + Real log_temp_hi = log_temp_table(jtemp_hi); + + Real fij = data(jtemp_lo, irhoy_lo, jtab_rate); + Real fip1j = data(jtemp_lo, irhoy_hi, jtab_rate); + Real fijp1 = data(jtemp_hi, irhoy_lo, jtab_rate); + Real fip1jp1 = data(jtemp_hi, irhoy_hi, jtab_rate); + + Real dlogr_dlogt_i = (fijp1 - fij) / (log_temp_hi - log_temp_lo); + Real dlogr_dlogt_ip1 = (fip1jp1 - fip1j) / (log_temp_hi - log_temp_lo); + + if ((log_temp < log_temp_lo) || (log_temp > log_temp_hi)) { + dlogr_dlogt = 0.0_rt; + } else { + dlogr_dlogt = evaluate_linear_1d(dlogr_dlogt_ip1, dlogr_dlogt_i, log_rhoy_hi, log_rhoy_lo, log_rhoy); + } + + } else { + + // In this case, we use a bigger stencil to reconstruct the + // temperature derivatives in the j and j+1 temperature positions, + // using the cetral-j finite differences: + // + // fijp2 ------------fip1jp2 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fijp1------------fip1jp1 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fij------------- fip1j + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // fijm1------------fip1jm1 + // + // with the following result: + // + // + // dr_dt_ijp1 --------dr_dt_ip1jp1 + // | | + // | | + // | | + // | | + // | | + // | | + // | | + // dr_dt_ij-----------dr_dt_ip1j + // + // Finally, we perform a 2d-linear interpolation to + // compute dlogr_dlogt. + + Real log_temp_jm1 = log_temp_table(jtemp_lo-1); + Real log_temp_j = log_temp_table(jtemp_lo); + Real log_temp_jp1 = log_temp_table(jtemp_hi); + Real log_temp_jp2 = log_temp_table(jtemp_hi+1); + + Real log_rhoy_lo = log_rhoy_table(irhoy_lo); + Real log_rhoy_hi = log_rhoy_table(irhoy_hi); + + Real fijm1 = data(jtemp_lo-1, irhoy_lo, jtab_rate); + Real fij = data(jtemp_lo, irhoy_lo, jtab_rate); + Real fijp1 = data(jtemp_hi, irhoy_lo, jtab_rate); + Real fijp2 = data(jtemp_hi+1, irhoy_lo, jtab_rate); + + Real fip1jm1 = data(jtemp_lo-1, irhoy_hi, jtab_rate); + Real fip1j = data(jtemp_lo, irhoy_hi, jtab_rate); + Real fip1jp1 = data(jtemp_hi, irhoy_hi, jtab_rate); + Real fip1jp2 = data(jtemp_hi+1, irhoy_hi, jtab_rate); + + Real dlogr_dlogt_ij = (fijp1 - fijm1)/(log_temp_jp1 - log_temp_jm1); + Real dlogr_dlogt_ijp1 = (fijp2 - fij)/(log_temp_jp2 - log_temp_j); + Real dlogr_dlogt_ip1j = (fip1jp1 - fip1jm1)/(log_temp_jp1 - log_temp_jm1); + Real dlogr_dlogt_ip1jp1 = (fip1jp2 - fip1j)/(log_temp_jp2 - log_temp_j); + + dlogr_dlogt = evaluate_linear_2d(dlogr_dlogt_ip1jp1, dlogr_dlogt_ip1j, dlogr_dlogt_ijp1, dlogr_dlogt_ij, + log_rhoy_hi, log_rhoy_lo, log_temp_jp1, log_temp_j, + log_rhoy, log_temp); + + } + return dlogr_dlogt; +} + + +template +AMREX_INLINE AMREX_GPU_HOST_DEVICE +void +get_entries(const table_t& table_meta, const R& log_rhoy_table, const T& log_temp_table, const D& data, + const Real log_rhoy, const Real log_temp, Array1D& entries) +{ + for (int ivar = 1; ivar <= num_vars; ivar++) { + entries(ivar) = evaluate_vars(table_meta, log_rhoy_table, log_temp_table, data, + log_rhoy, log_temp, ivar); + } + + entries(k_index_dlogr_dlogt) = evaluate_dr_dtemp(table_meta, log_rhoy_table, log_temp_table, data, + log_rhoy, log_temp); +} + +template +AMREX_INLINE AMREX_GPU_HOST_DEVICE +void +tabular_evaluate(const table_t& table_meta, + const R& log_rhoy_table, const T& log_temp_table, const D& data, + const Real rhoy, const Real temp, + Real& rate, Real& drate_dt, Real& edot_nu, Real& edot_gamma) +{ + Array1D entries; + + // Get the table entries at this rhoy, temp + + Real log_rhoy = std::log10(rhoy); + Real log_temp = std::log10(temp); + + get_entries(table_meta, log_rhoy_table, log_temp_table, data, + log_rhoy, log_temp, entries); + + // Fill outputs: rate, d(rate)/d(temperature), and + // (negative) neutrino loss contribution to energy generation + + rate = std::pow(10.0_rt, entries(jtab_rate)); + drate_dt = rate * entries(k_index_dlogr_dlogt) / temp; + edot_nu = -std::pow(10.0_rt, entries(jtab_nuloss)); + edot_gamma = std::pow(10.0_rt, entries(jtab_gamma)); +} + +#endif diff --git a/networks/He-C-Fe-group/table_rates_data.cpp b/networks/He-C-Fe-group/table_rates_data.cpp new file mode 100644 index 0000000000..5ac5e8a541 --- /dev/null +++ b/networks/He-C-Fe-group/table_rates_data.cpp @@ -0,0 +1,153 @@ +#include +#include +#include +#include + +using namespace amrex; + +namespace rate_tables +{ + + AMREX_GPU_MANAGED table_t j_co55_fe55_meta; + AMREX_GPU_MANAGED Array3D j_co55_fe55_data; + AMREX_GPU_MANAGED Array1D j_co55_fe55_rhoy; + AMREX_GPU_MANAGED Array1D j_co55_fe55_temp; + + AMREX_GPU_MANAGED table_t j_co56_fe56_meta; + AMREX_GPU_MANAGED Array3D j_co56_fe56_data; + AMREX_GPU_MANAGED Array1D j_co56_fe56_rhoy; + AMREX_GPU_MANAGED Array1D j_co56_fe56_temp; + + AMREX_GPU_MANAGED table_t j_co56_ni56_meta; + AMREX_GPU_MANAGED Array3D j_co56_ni56_data; + AMREX_GPU_MANAGED Array1D j_co56_ni56_rhoy; + AMREX_GPU_MANAGED Array1D j_co56_ni56_temp; + + AMREX_GPU_MANAGED table_t j_co57_ni57_meta; + AMREX_GPU_MANAGED Array3D j_co57_ni57_data; + AMREX_GPU_MANAGED Array1D j_co57_ni57_rhoy; + AMREX_GPU_MANAGED Array1D j_co57_ni57_temp; + + AMREX_GPU_MANAGED table_t j_fe55_co55_meta; + AMREX_GPU_MANAGED Array3D j_fe55_co55_data; + AMREX_GPU_MANAGED Array1D j_fe55_co55_rhoy; + AMREX_GPU_MANAGED Array1D j_fe55_co55_temp; + + AMREX_GPU_MANAGED table_t j_fe55_mn55_meta; + AMREX_GPU_MANAGED Array3D j_fe55_mn55_data; + AMREX_GPU_MANAGED Array1D j_fe55_mn55_rhoy; + AMREX_GPU_MANAGED Array1D j_fe55_mn55_temp; + + AMREX_GPU_MANAGED table_t j_fe56_co56_meta; + AMREX_GPU_MANAGED Array3D j_fe56_co56_data; + AMREX_GPU_MANAGED Array1D j_fe56_co56_rhoy; + AMREX_GPU_MANAGED Array1D j_fe56_co56_temp; + + AMREX_GPU_MANAGED table_t j_mn55_fe55_meta; + AMREX_GPU_MANAGED Array3D j_mn55_fe55_data; + AMREX_GPU_MANAGED Array1D j_mn55_fe55_rhoy; + AMREX_GPU_MANAGED Array1D j_mn55_fe55_temp; + + AMREX_GPU_MANAGED table_t j_ni56_co56_meta; + AMREX_GPU_MANAGED Array3D j_ni56_co56_data; + AMREX_GPU_MANAGED Array1D j_ni56_co56_rhoy; + AMREX_GPU_MANAGED Array1D j_ni56_co56_temp; + + AMREX_GPU_MANAGED table_t j_ni57_co57_meta; + AMREX_GPU_MANAGED Array3D j_ni57_co57_data; + AMREX_GPU_MANAGED Array1D j_ni57_co57_rhoy; + AMREX_GPU_MANAGED Array1D j_ni57_co57_temp; + + +} + + +void init_tabular() +{ + + amrex::Print() << "reading in network electron-capture / beta-decay tables..." << std::endl; + + using namespace rate_tables; + + j_co55_fe55_meta.ntemp = 13; + j_co55_fe55_meta.nrhoy = 11; + j_co55_fe55_meta.nvars = 6; + j_co55_fe55_meta.nheader = 5; + + init_tab_info(j_co55_fe55_meta, "55co-55fe_electroncapture.dat", j_co55_fe55_rhoy, j_co55_fe55_temp, j_co55_fe55_data); + + + j_co56_fe56_meta.ntemp = 13; + j_co56_fe56_meta.nrhoy = 11; + j_co56_fe56_meta.nvars = 6; + j_co56_fe56_meta.nheader = 5; + + init_tab_info(j_co56_fe56_meta, "56co-56fe_electroncapture.dat", j_co56_fe56_rhoy, j_co56_fe56_temp, j_co56_fe56_data); + + + j_co56_ni56_meta.ntemp = 13; + j_co56_ni56_meta.nrhoy = 11; + j_co56_ni56_meta.nvars = 6; + j_co56_ni56_meta.nheader = 5; + + init_tab_info(j_co56_ni56_meta, "56co-56ni_betadecay.dat", j_co56_ni56_rhoy, j_co56_ni56_temp, j_co56_ni56_data); + + + j_co57_ni57_meta.ntemp = 13; + j_co57_ni57_meta.nrhoy = 11; + j_co57_ni57_meta.nvars = 6; + j_co57_ni57_meta.nheader = 5; + + init_tab_info(j_co57_ni57_meta, "57co-57ni_betadecay.dat", j_co57_ni57_rhoy, j_co57_ni57_temp, j_co57_ni57_data); + + + j_fe55_co55_meta.ntemp = 13; + j_fe55_co55_meta.nrhoy = 11; + j_fe55_co55_meta.nvars = 6; + j_fe55_co55_meta.nheader = 5; + + init_tab_info(j_fe55_co55_meta, "55fe-55co_betadecay.dat", j_fe55_co55_rhoy, j_fe55_co55_temp, j_fe55_co55_data); + + + j_fe55_mn55_meta.ntemp = 13; + j_fe55_mn55_meta.nrhoy = 11; + j_fe55_mn55_meta.nvars = 6; + j_fe55_mn55_meta.nheader = 5; + + init_tab_info(j_fe55_mn55_meta, "55fe-55mn_electroncapture.dat", j_fe55_mn55_rhoy, j_fe55_mn55_temp, j_fe55_mn55_data); + + + j_fe56_co56_meta.ntemp = 13; + j_fe56_co56_meta.nrhoy = 11; + j_fe56_co56_meta.nvars = 6; + j_fe56_co56_meta.nheader = 5; + + init_tab_info(j_fe56_co56_meta, "56fe-56co_betadecay.dat", j_fe56_co56_rhoy, j_fe56_co56_temp, j_fe56_co56_data); + + + j_mn55_fe55_meta.ntemp = 13; + j_mn55_fe55_meta.nrhoy = 11; + j_mn55_fe55_meta.nvars = 6; + j_mn55_fe55_meta.nheader = 5; + + init_tab_info(j_mn55_fe55_meta, "55mn-55fe_betadecay.dat", j_mn55_fe55_rhoy, j_mn55_fe55_temp, j_mn55_fe55_data); + + + j_ni56_co56_meta.ntemp = 13; + j_ni56_co56_meta.nrhoy = 11; + j_ni56_co56_meta.nvars = 6; + j_ni56_co56_meta.nheader = 5; + + init_tab_info(j_ni56_co56_meta, "56ni-56co_electroncapture.dat", j_ni56_co56_rhoy, j_ni56_co56_temp, j_ni56_co56_data); + + + j_ni57_co57_meta.ntemp = 13; + j_ni57_co57_meta.nrhoy = 11; + j_ni57_co57_meta.nvars = 6; + j_ni57_co57_meta.nheader = 5; + + init_tab_info(j_ni57_co57_meta, "57ni-57co_electroncapture.dat", j_ni57_co57_rhoy, j_ni57_co57_temp, j_ni57_co57_data); + + + +} diff --git a/networks/He-C-Fe-group/tfactors.H b/networks/He-C-Fe-group/tfactors.H new file mode 100644 index 0000000000..43a6316db7 --- /dev/null +++ b/networks/He-C-Fe-group/tfactors.H @@ -0,0 +1,34 @@ +#ifndef TFACTORS_H +#define TFACTORS_H + +struct tf_t { + Real T9; + Real T9i; + Real T943i; + Real T923i; + Real T913i; + Real T913; + Real T923; + Real T953; + Real lnT9; +}; + +AMREX_GPU_HOST_DEVICE AMREX_INLINE +tf_t evaluate_tfactors(const Real T) +{ + + tf_t tf; + tf.T9 = T / 1.e9_rt; + tf.T9i = 1.0_rt / tf.T9; + tf.T913 = std::cbrt(tf.T9); + tf.T913i = 1.0_rt / tf.T913; + tf.T923i = tf.T913i * tf.T913i; + tf.T943i = tf.T9i * tf.T913i; + tf.T923 = tf.T913 * tf.T913; + tf.T953 = tf.T9 * tf.T923; + tf.lnT9 = std::log(tf.T9); + + return tf; +} + +#endif \ No newline at end of file