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

Update pynucastro networks #1287

Merged
merged 13 commits into from
Sep 27, 2023
Merged
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
165 changes: 90 additions & 75 deletions networks/CNO_extras/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,44 @@ namespace Rates

enum NetworkRates
{
k_n13__c13__weak__wc12 = 1,
k_o14__n14__weak__wc12 = 2,
k_o15__n15__weak__wc12 = 3,
k_f17__o17__weak__wc12 = 4,
k_f18__o18__weak__wc12 = 5,
k_ne18__f18__weak__wc12 = 6,
k_ne19__f19__weak__wc12 = 7,
k_p_c12__n13 = 8,
k_he4_c12__o16 = 9,
k_p_c13__n14 = 10,
k_p_n13__o14 = 11,
k_p_n14__o15 = 12,
k_he4_n14__f18 = 13,
k_p_n15__o16 = 14,
k_he4_n15__f19 = 15,
k_he4_o14__ne18 = 16,
k_he4_o15__ne19 = 17,
k_p_o16__f17 = 18,
k_he4_o16__ne20 = 19,
k_p_o17__f18 = 20,
k_p_o18__f19 = 21,
k_p_f17__ne18 = 22,
k_p_f18__ne19 = 23,
k_p_f19__ne20 = 24,
k_he4_ne18__mg22 = 25,
k_he4_ne20__mg24 = 26,
k_c12_c12__he4_ne20 = 27,
k_he4_n13__p_o16 = 28,
k_p_n15__he4_c12 = 29,
k_he4_o14__p_f17 = 30,
k_c12_o16__he4_mg24 = 31,
k_p_o17__he4_n14 = 32,
k_p_o18__he4_n15 = 33,
k_p_f18__he4_o15 = 34,
k_p_f19__he4_o16 = 35,
k_p_ne20__he4_f17 = 36,
k_he4_he4_he4__c12 = 37,
NumRates = k_he4_he4_he4__c12
k_n13_to_c13_weak_wc12 = 1,
k_o14_to_n14_weak_wc12 = 2,
k_o15_to_n15_weak_wc12 = 3,
k_f17_to_o17_weak_wc12 = 4,
k_f18_to_o18_weak_wc12 = 5,
k_ne18_to_f18_weak_wc12 = 6,
k_ne19_to_f19_weak_wc12 = 7,
k_p_c12_to_n13 = 8,
k_he4_c12_to_o16 = 9,
k_p_c13_to_n14 = 10,
k_p_n13_to_o14 = 11,
k_p_n14_to_o15 = 12,
k_he4_n14_to_f18 = 13,
k_p_n15_to_o16 = 14,
k_he4_n15_to_f19 = 15,
k_he4_o14_to_ne18 = 16,
k_he4_o15_to_ne19 = 17,
k_p_o16_to_f17 = 18,
k_he4_o16_to_ne20 = 19,
k_p_o17_to_f18 = 20,
k_p_o18_to_f19 = 21,
k_p_f17_to_ne18 = 22,
k_p_f18_to_ne19 = 23,
k_p_f19_to_ne20 = 24,
k_he4_ne18_to_mg22 = 25,
k_he4_ne20_to_mg24 = 26,
k_c12_c12_to_he4_ne20 = 27,
k_he4_n13_to_p_o16 = 28,
k_p_n15_to_he4_c12 = 29,
k_he4_o14_to_p_f17 = 30,
k_c12_o16_to_he4_mg24 = 31,
k_p_o17_to_he4_n14 = 32,
k_p_o18_to_he4_n15 = 33,
k_p_f18_to_he4_o15 = 34,
k_p_f19_to_he4_o16 = 35,
k_p_ne20_to_he4_f17 = 36,
k_he4_he4_he4_to_c12 = 37,
NumRates = k_he4_he4_he4_to_c12
};

// number of reaclib rates
Expand All @@ -78,45 +78,60 @@ namespace Rates

static const std::vector<std::string> rate_names = {
"", // 0
"n13__c13__weak__wc12", // 1,
"o14__n14__weak__wc12", // 2,
"o15__n15__weak__wc12", // 3,
"f17__o17__weak__wc12", // 4,
"f18__o18__weak__wc12", // 5,
"ne18__f18__weak__wc12", // 6,
"ne19__f19__weak__wc12", // 7,
"p_c12__n13", // 8,
"he4_c12__o16", // 9,
"p_c13__n14", // 10,
"p_n13__o14", // 11,
"p_n14__o15", // 12,
"he4_n14__f18", // 13,
"p_n15__o16", // 14,
"he4_n15__f19", // 15,
"he4_o14__ne18", // 16,
"he4_o15__ne19", // 17,
"p_o16__f17", // 18,
"he4_o16__ne20", // 19,
"p_o17__f18", // 20,
"p_o18__f19", // 21,
"p_f17__ne18", // 22,
"p_f18__ne19", // 23,
"p_f19__ne20", // 24,
"he4_ne18__mg22", // 25,
"he4_ne20__mg24", // 26,
"c12_c12__he4_ne20", // 27,
"he4_n13__p_o16", // 28,
"p_n15__he4_c12", // 29,
"he4_o14__p_f17", // 30,
"c12_o16__he4_mg24", // 31,
"p_o17__he4_n14", // 32,
"p_o18__he4_n15", // 33,
"p_f18__he4_o15", // 34,
"p_f19__he4_o16", // 35,
"p_ne20__he4_f17", // 36,
"he4_he4_he4__c12" // 37,
"n13_to_c13_weak_wc12", // 1,
"o14_to_n14_weak_wc12", // 2,
"o15_to_n15_weak_wc12", // 3,
"f17_to_o17_weak_wc12", // 4,
"f18_to_o18_weak_wc12", // 5,
"ne18_to_f18_weak_wc12", // 6,
"ne19_to_f19_weak_wc12", // 7,
"p_c12_to_n13", // 8,
"he4_c12_to_o16", // 9,
"p_c13_to_n14", // 10,
"p_n13_to_o14", // 11,
"p_n14_to_o15", // 12,
"he4_n14_to_f18", // 13,
"p_n15_to_o16", // 14,
"he4_n15_to_f19", // 15,
"he4_o14_to_ne18", // 16,
"he4_o15_to_ne19", // 17,
"p_o16_to_f17", // 18,
"he4_o16_to_ne20", // 19,
"p_o17_to_f18", // 20,
"p_o18_to_f19", // 21,
"p_f17_to_ne18", // 22,
"p_f18_to_ne19", // 23,
"p_f19_to_ne20", // 24,
"he4_ne18_to_mg22", // 25,
"he4_ne20_to_mg24", // 26,
"c12_c12_to_he4_ne20", // 27,
"he4_n13_to_p_o16", // 28,
"p_n15_to_he4_c12", // 29,
"he4_o14_to_p_f17", // 30,
"c12_o16_to_he4_mg24", // 31,
"p_o17_to_he4_n14", // 32,
"p_o18_to_he4_n15", // 33,
"p_f18_to_he4_o15", // 34,
"p_f19_to_he4_o16", // 35,
"p_ne20_to_he4_f17", // 36,
"he4_he4_he4_to_c12" // 37,
};

}

#ifdef NSE_NET
namespace NSE_INDEX
{
constexpr int h1_index = 0;
constexpr int n_index = -1;
constexpr int he4_index = 1;

// 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<int, 1, Rates::NumRates, 1, 7, Order::C> rate_indices;
}
#endif

#endif
45 changes: 45 additions & 0 deletions networks/CNO_extras/actual_network_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,51 @@ namespace network
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, NumSpec> mion;
}

#ifdef NSE_NET
namespace NSE_INDEX
{
AMREX_GPU_MANAGED amrex::Array2D<int, 1, Rates::NumRates, 1, 7, Order::C> rate_indices {
-1, -1, 4, -1, -1, 3, -1,
-1, -1, 7, -1, -1, 5, -1,
-1, -1, 8, -1, -1, 6, -1,
-1, -1, 12, -1, -1, 10, -1,
-1, -1, 13, -1, -1, 11, -1,
-1, -1, 15, -1, -1, 13, -1,
-1, -1, 16, -1, -1, 14, -1,
-1, 0, 2, -1, -1, 4, -1,
-1, 1, 2, -1, -1, 9, -1,
-1, 0, 3, -1, -1, 5, -1,
-1, 0, 4, -1, -1, 7, -1,
-1, 0, 5, -1, -1, 8, -1,
-1, 1, 5, -1, -1, 13, -1,
-1, 0, 6, -1, -1, 9, -1,
-1, 1, 6, -1, -1, 14, -1,
-1, 1, 7, -1, -1, 15, -1,
-1, 1, 8, -1, -1, 16, -1,
-1, 0, 9, -1, -1, 12, -1,
-1, 1, 9, -1, -1, 17, -1,
-1, 0, 10, -1, -1, 13, -1,
-1, 0, 11, -1, -1, 14, -1,
-1, 0, 12, -1, -1, 15, -1,
-1, 0, 13, -1, -1, 16, -1,
-1, 0, 14, -1, -1, 17, -1,
-1, 1, 15, -1, -1, 18, -1,
-1, 1, 17, -1, -1, 19, -1,
-1, 2, 2, -1, 1, 17, -1,
-1, 1, 4, -1, 0, 9, -1,
-1, 0, 6, -1, 1, 2, -1,
-1, 1, 7, -1, 0, 12, -1,
-1, 2, 9, -1, 1, 19, -1,
-1, 0, 10, -1, 1, 5, -1,
-1, 0, 11, -1, 1, 6, -1,
-1, 0, 13, -1, 1, 8, -1,
-1, 0, 14, -1, 1, 9, -1,
-1, 0, 17, -1, 1, 12, -1,
1, 1, 1, -1, -1, 2, -1
};
}
#endif

void actual_network_init()
{
using namespace Species;
Expand Down
Loading