Skip to content

Commit

Permalink
convert all pynucastro nets to C++ (#809)
Browse files Browse the repository at this point in the history
this uses the latest version of pynucastro to write out Starkiller C++ networks
  • Loading branch information
zingale authored Nov 30, 2021
1 parent eadaf26 commit c45dec4
Show file tree
Hide file tree
Showing 165 changed files with 39,549 additions and 1,052,453 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ extern_parameters_F.H
# old plotfiles
*.old.*[0-9]


# Jupyter stuff
.ipynb_checkpoints/

20180319default2
18 changes: 10 additions & 8 deletions networks/ECSN/Make.package
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
F90EXE_sources += actual_network.F90
F90EXE_sources += reaclib_rates.F90
F90EXE_sources += table_rates.F90
f90EXE_sources += physical_constants.f90
F90EXE_sources += network_properties.F90
CEXE_headers += network_properties.H

ifeq ($(USE_REACT),TRUE)
F90EXE_sources += actual_rhs.F90

USE_SCREENING = TRUE
USE_NEUTRINOS = TRUE
DEFINES += -DNETWORK_HAS_CXX_IMPLEMENTATION

CEXE_sources += actual_network_data.cpp
CEXE_headers += actual_network.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
3 changes: 0 additions & 3 deletions networks/ECSN/_parameters
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
@namespace: network

# Turn off thermal neutrino losses
disable_thermal_neutrinos logical .false.
273 changes: 0 additions & 273 deletions networks/ECSN/actual_network.F90

This file was deleted.

82 changes: 82 additions & 0 deletions networks/ECSN/actual_network.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#ifndef actual_network_H
#define actual_network_H

#include <AMReX_REAL.H>
#include <AMReX_Array.H>

#include <fundamental_constants.H>
#include <network_properties.H>

using namespace amrex;

void actual_network_init();

const std::string network_name = "pynucastro-cxx";

namespace network
{
extern AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, NumSpec> bion;
extern AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, NumSpec> mion;
}

namespace Rates
{

enum NetworkRates
{
k_ne20__he4_o16 = 1,
k_he4_o16__ne20 = 2,
k_he4_ne20__mg24 = 3,
k_he4_mg24__si28 = 4,
k_p_al27__si28 = 5,
k_he4_al27__p31 = 6,
k_he4_si28__s32 = 7,
k_p_p31__s32 = 8,
k_o16_o16__p_p31 = 9,
k_o16_o16__he4_si28 = 10,
k_he4_mg24__p_al27 = 11,
k_p_al27__he4_mg24 = 12,
k_he4_si28__p_p31 = 13,
k_p_p31__he4_si28 = 14,
k_f20__o20 = 15,
k_ne20__f20 = 16,
k_o20__f20 = 17,
k_f20__ne20 = 18,
NumRates = k_f20__ne20
};

// For each rate, we need: rate, drate/dT, screening, dscreening/dT

const int NumGroups = 4;

// number of reaclib rates

const int NrateReaclib = 14;
const int NumReaclibSets = 34;

// number of tabular rates

const int NrateTabular = 4;

}

namespace reaclib_rates
{

// Temperature coefficient arrays (numbers correspond to reaction
// numbers in net_info)

extern AMREX_GPU_MANAGED amrex::Array2D<amrex::Real, 1, 7, 1, Rates::NumReaclibSets> ctemp_rate;

// Index into ctemp_rate, dimension 2, where each rate's
// coefficients start

extern AMREX_GPU_MANAGED amrex::Array1D<int, 1, Rates::NrateReaclib> rate_start_idx;

// Reaction multiplicities-1 (how many rates contribute - 1)

extern AMREX_GPU_MANAGED amrex::Array1D<int, 1, Rates::NrateReaclib> rate_extra_mult;

}

#endif
Loading

0 comments on commit c45dec4

Please sign in to comment.