Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reorganize the He nets #1687

Open
wants to merge 14 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified networks/CNO_He_burn/CNO_He_burn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions networks/CNO_He_burn/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ifeq ($(USE_REACT),TRUE)
CEXE_headers += actual_network.H
CEXE_headers += tfactors.H
CEXE_headers += partition_functions.H
CEXE_sources += partition_functions_data.cpp
CEXE_headers += actual_rhs.H
CEXE_headers += reaclib_rates.H
CEXE_headers += table_rates.H
Expand Down
64 changes: 32 additions & 32 deletions networks/CNO_He_burn/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,100 +30,100 @@ namespace network
return 0.0_rt;
}
else if constexpr (spec == He4) {
return 28.29566_rt;
return 28.295662457999697_rt;
}
else if constexpr (spec == C12) {
return 92.16172800000001_rt;
return 92.16173498399803_rt;
}
else if constexpr (spec == C13) {
return 97.108037_rt;
return 97.10804378399916_rt;
}
else if constexpr (spec == N13) {
return 94.105219_rt;
return 94.10522604799917_rt;
}
else if constexpr (spec == N14) {
return 104.65859599999999_rt;
return 104.65860734799753_rt;
}
else if constexpr (spec == N15) {
return 115.4919_rt;
return 115.49190414799887_rt;
}
else if constexpr (spec == O14) {
return 98.731892_rt;
return 98.73189611199996_rt;
}
else if constexpr (spec == O15) {
return 111.95538_rt;
return 111.95539521199862_rt;
}
else if constexpr (spec == O16) {
return 127.619296_rt;
return 127.6193154119992_rt;
}
else if constexpr (spec == O17) {
return 131.76237600000002_rt;
return 131.76239561199873_rt;
}
else if constexpr (spec == O18) {
return 139.807746_rt;
return 139.8077658120019_rt;
}
else if constexpr (spec == F17) {
return 128.21957600000002_rt;
return 128.21958437599824_rt;
}
else if constexpr (spec == F18) {
return 137.369484_rt;
return 137.36950247599816_rt;
}
else if constexpr (spec == F19) {
return 147.801342_rt;
return 147.80136567599766_rt;
}
else if constexpr (spec == Ne18) {
return 132.142626_rt;
return 132.14265544000227_rt;
}
else if constexpr (spec == Ne19) {
return 143.779517_rt;
return 143.7795235400008_rt;
}
else if constexpr (spec == Ne20) {
return 160.6448_rt;
return 160.64482384000075_rt;
}
else if constexpr (spec == Ne21) {
return 167.405973_rt;
return 167.40598973999658_rt;
}
else if constexpr (spec == Na22) {
return 174.144674_rt;
return 174.14457080400098_rt;
}
else if constexpr (spec == Na23) {
return 186.56433900000002_rt;
return 186.56435240400242_rt;
}
else if constexpr (spec == Mg22) {
return 168.58074200000001_rt;
return 168.58082376800303_rt;
}
else if constexpr (spec == Mg24) {
return 198.25701600000002_rt;
return 198.2570479679962_rt;
}
else if constexpr (spec == Al27) {
return 224.951931_rt;
return 224.95193723199915_rt;
}
else if constexpr (spec == Si28) {
return 236.536832_rt;
return 236.53684539599638_rt;
}
else if constexpr (spec == P31) {
return 262.91617699999995_rt;
return 262.9161999600037_rt;
}
else if constexpr (spec == S32) {
return 271.78012800000005_rt;
return 271.78016372399725_rt;
}
else if constexpr (spec == Ar36) {
return 306.716724_rt;
return 306.7167469519991_rt;
}
else if constexpr (spec == Ca40) {
return 342.05212000000006_rt;
return 342.05218528000114_rt;
}
else if constexpr (spec == Ti44) {
return 375.47488000000004_rt;
return 375.47496160800074_rt;
}
else if constexpr (spec == Cr48) {
return 411.46891200000005_rt;
return 411.4679399359957_rt;
}
else if constexpr (spec == Fe52) {
return 447.697848_rt;
return 447.6996182639923_rt;
}
else if constexpr (spec == Ni56) {
return 483.995624_rt;
return 483.9956965919919_rt;
}


Expand Down
17 changes: 9 additions & 8 deletions networks/CNO_He_burn/partition_functions.H
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ namespace part_fun {

// interpolation routine

template <int npts>
template <typename T>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void interpolate_pf(const amrex::Real t9, const amrex::Real (&temp_array)[npts], const amrex::Real (&pf_array)[npts],
void interpolate_pf(const amrex::Real t9, const T& temp_array, const T& pf_array,
amrex::Real& pf, amrex::Real& dpf_dT) {

if (t9 >= temp_array[0] && t9 < temp_array[npts-1]) {
if (t9 >= temp_array.lo() && t9 < temp_array.hi()) {

// find the largest temperature element <= t9 using a binary search

int left = 0;
int right = npts;
int left = temp_array.lo();
int right = temp_array.hi();

while (left < right) {
int mid = (left + right) / 2;
if (temp_array[mid] > t9) {
if (temp_array(mid) > t9) {
right = mid;
} else {
left = mid + 1;
Expand All @@ -44,11 +44,12 @@ namespace part_fun {

// construct the slope -- this is (log10(pf_{i+1}) - log10(pf_i)) / (T_{i+1} - T_i)

amrex::Real slope = (pf_array[idx+1] - pf_array[idx]) / (temp_array[idx+1] - temp_array[idx]);
amrex::Real slope = (pf_array(idx+1) - pf_array(idx)) /
(temp_array(idx+1) - temp_array(idx));

// find the PF

amrex::Real log10_pf = pf_array[idx] + slope * (t9 - temp_array[idx]);
amrex::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)
Expand Down
14 changes: 14 additions & 0 deletions networks/CNO_He_burn/partition_functions_data.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <AMReX_Array.H>
#include <string>
#include <table_rates.H>
#include <AMReX_Print.H>

#include <partition_functions.H>

using namespace amrex;

namespace part_fun {


}

Binary file removed networks/He-C-Fe-group/He-C-Fe-group.png
Binary file not shown.
142 changes: 0 additions & 142 deletions networks/He-C-Fe-group/He-C-Fe-group.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ifeq ($(USE_REACT),TRUE)
CEXE_headers += actual_network.H
CEXE_headers += tfactors.H
CEXE_headers += partition_functions.H
CEXE_sources += partition_functions_data.cpp
CEXE_headers += actual_rhs.H
CEXE_headers += reaclib_rates.H
CEXE_headers += table_rates.H
Expand Down
File renamed without changes.
Loading
Loading