diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 60aff9d0e8..7e418249a8 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -41,8 +41,8 @@ jobs: make realclean make NETWORK_DIR=ignition_reaclib/URCA-simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2 - - name: compile test_ase (ase) + - name: compile test_nse_net (ase) run: | export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} - cd unit_test/test_ase + cd unit_test/test_nse_net make USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2 diff --git a/.github/workflows/nse_net.yml b/.github/workflows/nse_net.yml index e6e8741724..fc1124fe61 100644 --- a/.github/workflows/nse_net.yml +++ b/.github/workflows/nse_net.yml @@ -26,42 +26,42 @@ jobs: sudo apt-get update -y -qq sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0 - - name: Compile, test_ase (NSE_NET, ase) + - name: Compile, test_nse_net (NSE_NET, ase) run: | - cd unit_test/test_ase + cd unit_test/test_nse_net make realclean make -j 4 - - name: Run test_ase (NSE_NET, ase) + - name: Run test_nse_net (NSE_NET, ase) run: | - cd unit_test/test_ase + cd unit_test/test_nse_net ./main3d.gnu.ex inputs_ase amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out - name: Print backtrace - if: ${{ failure() && hashFiles('unit_test/test_ase/Backtrace.0') != '' }} - run: cat unit_test/test_ase/Backtrace.0 + if: ${{ failure() && hashFiles('unit_test/test_nse_net/Backtrace.0') != '' }} + run: cat unit_test/test_nse_net/Backtrace.0 - name: Compare to stored output (NSE_NET, ase) run: | - cd unit_test/test_ase - diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/ase_nse_net_unit_test.out + cd unit_test/test_nse_net + diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/nse_net_unit_test.out - - name: Compile, test_ase/make_table (NSE_NET, ase, make_table) + - name: Compile, test_nse_net/make_table (NSE_NET, ase, make_table) run: | - cd unit_test/test_ase/make_table + cd unit_test/test_nse_net/make_table make realclean make -j 4 - - name: Run, test_ase/make_table (NSE_NET, ase, make_table) + - name: Run, test_nse_net/make_table (NSE_NET, ase, make_table) run: | - cd unit_test/test_ase/make_table + cd unit_test/test_nse_net/make_table ./main3d.gnu.ex amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out - name: Print backtrace - if: ${{ failure() && hashFiles('unit_test/test_ase/make_table/Backtrace.0') != '' }} - run: cat unit_test/test_ase/make_table/Backtrace.0 + if: ${{ failure() && hashFiles('unit_test/test_nse_net/make_table/Backtrace.0') != '' }} + run: cat unit_test/test_nse_net/make_table/Backtrace.0 - name: Compare to stored output (NSE_NET, ase, make_table) run: | - cd unit_test/test_ase/make_table - diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/ase_nse_net_make_table_unit_test.out + cd unit_test/test_nse_net/make_table + diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/nse_net_make_table_unit_test.out diff --git a/.github/workflows/nse_test.yml b/.github/workflows/nse_test.yml deleted file mode 100644 index 1b898f0e8c..0000000000 --- a/.github/workflows/nse_test.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: nse_test - -on: [pull_request] -jobs: - nse_test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Get AMReX - run: | - mkdir external - cd external - git clone https://github.com/AMReX-Codes/amrex.git - cd amrex - git checkout development - echo 'AMREX_HOME=$(GITHUB_WORKSPACE)/external/amrex' >> $GITHUB_ENV - echo $AMREX_HOME - if [[ -n "${AMREX_HOME}" ]]; then exit 1; fi - cd ../.. - - - name: Install dependencies - run: | - sudo apt-get update -y -qq - sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0 - - - name: Compile, test_nse (aprox21) - run: | - cd unit_test/test_nse - make realclean - make NETWORK_DIR=aprox21 -j 4 - - - name: Run test_nse (aprox21) - run: | - cd unit_test/test_nse - ./main3d.gnu.ex inputs_aprox21 amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out - - - name: Print backtrace - if: ${{ failure() && hashFiles('unit_test/test_nse/Backtrace.0') != '' }} - run: cat unit_test/test_nse/Backtrace.0 - - - name: Compare to stored output (aprox21) - run: | - cd unit_test/test_nse - diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" -I "^0x" test.out ci-benchmarks/aprox21_ci.out - diff --git a/unit_test/test_nse/GNUmakefile b/unit_test/test_nse/GNUmakefile deleted file mode 100644 index be47b8580a..0000000000 --- a/unit_test/test_nse/GNUmakefile +++ /dev/null @@ -1,42 +0,0 @@ -PRECISION = DOUBLE -PROFILE = FALSE - -DEBUG = FALSE - -DIM = 3 - -COMP = gnu - -USE_MPI = FALSE -USE_OMP = FALSE - -USE_REACT = TRUE - -USE_NSE_NET = TRUE -EBASE = main - -BL_NO_FORT = TRUE - -# define the location of the Microphysics top directory -MICROPHYSICS_HOME := ../.. - -# This sets the EOS directory -EOS_DIR := helmholtz - -# This sets the network directory -NETWORK_DIR := aprox21 - -SCREEN_METHOD := chabrier1998 - -USE_SIMPLIFIED_SDC = TRUE - -CONDUCTIVITY_DIR := stellar - -INTEGRATOR_DIR = VODE - -EXTERN_SEARCH += . .. - -Bpack := ./Make.package -Blocs := . - -include $(MICROPHYSICS_HOME)/unit_test/Make.unit_test diff --git a/unit_test/test_nse/Make.package b/unit_test/test_nse/Make.package deleted file mode 100644 index 6bc6cd127c..0000000000 --- a/unit_test/test_nse/Make.package +++ /dev/null @@ -1,2 +0,0 @@ -CEXE_sources += main.cpp -CEXE_headers += nse_example.H diff --git a/unit_test/test_nse/README.md b/unit_test/test_nse/README.md deleted file mode 100644 index 27f809bb53..0000000000 --- a/unit_test/test_nse/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# nse_example - -`nse_example` finds the NSE mass fractions of a given state. -The density, temperature, and composition are set in the -inputs file. - -Upon completion, the new state is printed to the screen. \ No newline at end of file diff --git a/unit_test/test_nse/_parameters b/unit_test/test_nse/_parameters deleted file mode 100644 index 355960df5e..0000000000 --- a/unit_test/test_nse/_parameters +++ /dev/null @@ -1,17 +0,0 @@ -@namespace: unit_test - -run_prefix string "" - -small_temp real 1.e5 -small_dens real 1.e5 - -density real 1.e7 - -temperature real 3.e9 - -mu_p real -3.0 -mu_n real -12.0 - -y_e real 0.5 - - diff --git a/unit_test/test_nse/ci-benchmarks/aprox21_ci.out b/unit_test/test_nse/ci-benchmarks/aprox21_ci.out deleted file mode 100644 index bb3bd62e2e..0000000000 --- a/unit_test/test_nse/ci-benchmarks/aprox21_ci.out +++ /dev/null @@ -1,54 +0,0 @@ -Initializing AMReX (23.07-395-ge6c93bf22695)... -AMReX (23.07-395-ge6c93bf22695) initialized -starting the single zone burn... -0x7ffcbd574c90 -State Density (g/cm^3): 277355338.4 -State Temperature (K): 5197769252 -Mass Fraction (H1): 0.4 -Mass Fraction (He3): 0.2 -Mass Fraction (He4): 0.2 -Mass Fraction (C12): 0.01111111111 -Mass Fraction (N14): 0.01111111111 -Mass Fraction (O16): 0.01111111111 -Mass Fraction (Ne20): 0.01111111111 -Mass Fraction (Mg24): 0.01111111111 -Mass Fraction (Si28): 0.01111111111 -Mass Fraction (S32): 0.01111111111 -Mass Fraction (Ar36): 0.01111111111 -Mass Fraction (Ca40): 0.01111111111 -Mass Fraction (Ti44): 0.01111111111 -Mass Fraction (Cr48): 0.01111111111 -Mass Fraction (Cr56): 0.01111111111 -Mass Fraction (Fe52): 0.01111111111 -Mass Fraction (Fe54): 0.01111111111 -Mass Fraction (Fe56): 0.01111111111 -Mass Fraction (Ni56): 0.01111111111 -Mass Fraction (n): 0.01111111111 -Mass Fraction (p): 0.01111111111 -electron fraction is 0.5 -After solving: -chemical potential of proton is -5.581982209 -chemical potential of neutron is -12.0247581 -NSE state: -H1 : 0 -He3 : 6.726596351e-12 -He4 : 0.002680193661 -C12 : 2.088656717e-08 -N14 : 3.63235298e-13 -O16 : 8.472970972e-08 -Ne20 : 1.346294667e-09 -Mg24 : 5.596482124e-07 -Si28 : 0.0010080397 -S32 : 0.002046314471 -Ar36 : 0.00209146282 -Ca40 : 0.005238622021 -Ti44 : 0.0001839172934 -Cr48 : 0.002037708642 -Cr56 : 7.745054245e-22 -Fe52 : 0.03983693988 -Fe54 : 0.04496220141 -Fe56 : 1.685809845e-05 -Ni56 : 0.8982306026 -n : 9.441707272e-10 -p : 0.001666471811 -AMReX (23.07-395-ge6c93bf22695) finalized diff --git a/unit_test/test_nse/inputs_aprox13 b/unit_test/test_nse/inputs_aprox13 deleted file mode 100644 index 1f6020da45..0000000000 --- a/unit_test/test_nse/inputs_aprox13 +++ /dev/null @@ -1,21 +0,0 @@ -unit_test.small_temp = 1.e5 -unit_test.small_dens = 1.e5 - -unit_test.density = 1.e6 -unit_test.temperature = 3.e9 - -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.y_e = 0.5 diff --git a/unit_test/test_nse/inputs_aprox19 b/unit_test/test_nse/inputs_aprox19 deleted file mode 100644 index 3ac62abc70..0000000000 --- a/unit_test/test_nse/inputs_aprox19 +++ /dev/null @@ -1,30 +0,0 @@ -unit_test.small_temp = 1.e5 -unit_test.small_dens = 1.e5 - -unit_test.density = 1.e6 -unit_test.temperature = 3.e9 - -unit_test.X1 = 0.7 -unit_test.X2 = 0.025 -unit_test.X3 = 0.2 -unit_test.X4 = 0.025 -unit_test.X5 = 0.025 -unit_test.X6 = 0.025 -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.mu_p = -3.0 -unit_test.mu_n = -12.0 - -unit_test.y_e = 0.5 diff --git a/unit_test/test_nse/inputs_aprox21 b/unit_test/test_nse/inputs_aprox21 deleted file mode 100644 index 480b74ca54..0000000000 --- a/unit_test/test_nse/inputs_aprox21 +++ /dev/null @@ -1,32 +0,0 @@ -unit_test.small_temp = 1e5 -unit_test.small_dens = 1e5 - -unit_test.density = 277355338.38976681 -unit_test.temperature = 5197769252.1761198 - -unit_test.X1 = 0.4 -unit_test.X2 = 0.2 -unit_test.X3 = 0.2 -unit_test.X4 = 0.01111111111 -unit_test.X5 = 0.01111111111 -unit_test.X6 = 0.01111111111 -unit_test.X7 = 0.01111111111 -unit_test.X8 = 0.01111111111 -unit_test.X9 = 0.01111111111 -unit_test.X10 = 0.01111111111 -unit_test.X11 = 0.01111111111 -unit_test.X12 = 0.01111111111 -unit_test.X13 = 0.01111111111 -unit_test.X14 = 0.01111111111 -unit_test.X15 = 0.01111111111 -unit_test.X16 = 0.01111111111 -unit_test.X17 = 0.01111111111 -unit_test.X18 = 0.01111111111 -unit_test.X19 = 0.01111111111 -unit_test.X20 = 0.01111111111 -unit_test.X21 = 0.01111111111 - -unit_test.mu_p = -3.0 -unit_test.mu_n = -12.0 - -unit_test.y_e = 0.5 diff --git a/unit_test/test_nse/inputs_iso7 b/unit_test/test_nse/inputs_iso7 deleted file mode 100644 index 45d1a6c7cc..0000000000 --- a/unit_test/test_nse/inputs_iso7 +++ /dev/null @@ -1,16 +0,0 @@ -unit_test.small_temp = 1e5 -unit_test.small_dens = 1e5 - -unit_test.density = 1.e6 -unit_test.temperature = 3.e9 - -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.y_e = 0.5 - diff --git a/unit_test/test_nse/inputs_subch_full b/unit_test/test_nse/inputs_subch_full deleted file mode 100644 index 171b663f4e..0000000000 --- a/unit_test/test_nse/inputs_subch_full +++ /dev/null @@ -1,25 +0,0 @@ -unit_test.small_temp = 1.e5 -unit_test.small_dens = 1.e5 - -unit_test.density = 1.e6 -unit_test.temperature = 3.e9 - -unit_test.X1 = 0.5 -unit_test.X2 = 0.1 -unit_test.X3 = 0.1 -unit_test.X4 = 0.1 -unit_test.X5 = 0.1 -unit_test.X6 = 0.1 -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.mu_p = -3.0 -unit_test.mu_n = -12.0 - -unit_test.y_e = 0.5 - diff --git a/unit_test/test_nse/main.cpp b/unit_test/test_nse/main.cpp deleted file mode 100644 index 04ed4eec82..0000000000 --- a/unit_test/test_nse/main.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include -#include - -#include -#include -using namespace amrex; - -#include -#include -#include -#include -#include - -int main(int argc, char *argv[]) { - - amrex::Initialize(argc, argv); - - std::cout << "starting the single zone burn..." << std::endl; - - ParmParse ppa("amr"); - - init_unit_test(); - - // C++ EOS initialization (must be done after Fortran eos_init and init_extern_parameters) - eos_init(small_temp, small_dens); - - // C++ Network, RHS, screening, rates initialization - network_init(); - - nse_example_c(); - - amrex::Finalize(); -} diff --git a/unit_test/test_nse/nse_example.H b/unit_test/test_nse/nse_example.H deleted file mode 100644 index 5a712485d2..0000000000 --- a/unit_test/test_nse/nse_example.H +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef NSE_EXAMPLE_H -#define NSE_EXAMPLE_H - -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace unit_test_rp; - -AMREX_INLINE -void nse_example_c() -{ - - burn_t state; - - amrex::Real massfractions[NumSpec] = {-1.0}; - std::cout << massfractions << std::endl; - // Make sure user set all the mass fractions to values in the interval [0, 1] - for (int n = 1; n <= NumSpec; ++n) { - - massfractions[n-1] = get_xn(n); - - if (massfractions[n-1] < 0 || massfractions[n-1] > 1) { - amrex::Error("mass fraction for " + short_spec_names_cxx[n-1] + " not initialized in the interval [0,1]!"); - } - - } - - // Echo initial conditions at burn and fill burn state input - - std::cout << "State Density (g/cm^3): " << density << std::endl; - std::cout << "State Temperature (K): " << temperature << std::endl; - for (int n = 0; n < NumSpec; ++n) { - std::cout << "Mass Fraction (" << short_spec_names_cxx[n] << "): " << massfractions[n] << std::endl; - } - - state.T = temperature; - state.rho = density; - for (int n = 0; n < NumSpec; ++n) { - state.xn[n] = massfractions[n]; - } - - - // normalize -- just in case - - normalize_abundances_burn(state); - - // compute the initial Ye - - state.y_e = y_e; - - // composition(state); - - std::cout << "electron fraction is " << state.y_e << std::endl; - - // set initial chemical potential of proton and neutron - - state.mu_p = mu_p; - state.mu_n = mu_n; - - const bool assume_ye_valid = true; - amrex::Real eps = 1.0e-10_rt; - - // find the nse state - use_hybrid_solver = 1; - - auto NSE_STATE = get_actual_nse_state(state, eps, assume_ye_valid); - - std::cout << "After solving: " << std::endl; - std::cout << "chemical potential of proton is " << state.mu_p << std::endl; - std::cout << "chemical potential of neutron is " << state.mu_n << std::endl; - - std::cout << "NSE state: " << std::endl; - for (int n = 0; n < NumSpec; ++n) { - std::cout << short_spec_names_cxx[n] << " : " << NSE_STATE.xn[n]<< std::endl; - } -} -#endif diff --git a/unit_test/test_ase/GNUmakefile b/unit_test/test_nse_net/GNUmakefile similarity index 100% rename from unit_test/test_ase/GNUmakefile rename to unit_test/test_nse_net/GNUmakefile diff --git a/unit_test/test_ase/Make.package b/unit_test/test_nse_net/Make.package similarity index 100% rename from unit_test/test_ase/Make.package rename to unit_test/test_nse_net/Make.package diff --git a/unit_test/test_ase/README.md b/unit_test/test_nse_net/README.md similarity index 82% rename from unit_test/test_ase/README.md rename to unit_test/test_nse_net/README.md index f7069ddcdd..098db51823 100644 --- a/unit_test/test_ase/README.md +++ b/unit_test/test_nse_net/README.md @@ -1,6 +1,6 @@ -# test_ase +# test_nse_net -`test_ase` finds the NSE mass fractions of a given state. +`test_nse_net` finds the NSE mass fractions of a given state. The density, temperature, and composition are set in the inputs file. Then we update the NSE mass fraction to the current state to make sure we're in NSE. Then we diff --git a/unit_test/test_ase/_parameters b/unit_test/test_nse_net/_parameters similarity index 100% rename from unit_test/test_ase/_parameters rename to unit_test/test_nse_net/_parameters diff --git a/unit_test/test_ase/burn_cell.H b/unit_test/test_nse_net/burn_cell.H similarity index 100% rename from unit_test/test_ase/burn_cell.H rename to unit_test/test_nse_net/burn_cell.H diff --git a/unit_test/test_ase/ci-benchmarks/ase_nse_net_unit_test.out b/unit_test/test_nse_net/ci-benchmarks/nse_net_unit_test.out similarity index 100% rename from unit_test/test_ase/ci-benchmarks/ase_nse_net_unit_test.out rename to unit_test/test_nse_net/ci-benchmarks/nse_net_unit_test.out diff --git a/unit_test/test_ase/inputs_ase b/unit_test/test_nse_net/inputs_ase similarity index 100% rename from unit_test/test_ase/inputs_ase rename to unit_test/test_nse_net/inputs_ase diff --git a/unit_test/test_ase/main.cpp b/unit_test/test_nse_net/main.cpp similarity index 100% rename from unit_test/test_ase/main.cpp rename to unit_test/test_nse_net/main.cpp diff --git a/unit_test/test_ase/make_table/GNUmakefile b/unit_test/test_nse_net/make_table/GNUmakefile similarity index 100% rename from unit_test/test_ase/make_table/GNUmakefile rename to unit_test/test_nse_net/make_table/GNUmakefile diff --git a/unit_test/test_ase/make_table/Make.package b/unit_test/test_nse_net/make_table/Make.package similarity index 100% rename from unit_test/test_ase/make_table/Make.package rename to unit_test/test_nse_net/make_table/Make.package diff --git a/unit_test/test_ase/make_table/README.md b/unit_test/test_nse_net/make_table/README.md similarity index 100% rename from unit_test/test_ase/make_table/README.md rename to unit_test/test_nse_net/make_table/README.md diff --git a/unit_test/test_ase/make_table/_parameters b/unit_test/test_nse_net/make_table/_parameters similarity index 100% rename from unit_test/test_ase/make_table/_parameters rename to unit_test/test_nse_net/make_table/_parameters diff --git a/unit_test/test_ase/make_table/burn_cell.H b/unit_test/test_nse_net/make_table/burn_cell.H similarity index 100% rename from unit_test/test_ase/make_table/burn_cell.H rename to unit_test/test_nse_net/make_table/burn_cell.H diff --git a/unit_test/test_ase/make_table/ci-benchmarks/ase_nse_net_make_table_unit_test.out b/unit_test/test_nse_net/make_table/ci-benchmarks/nse_net_make_table_unit_test.out similarity index 100% rename from unit_test/test_ase/make_table/ci-benchmarks/ase_nse_net_make_table_unit_test.out rename to unit_test/test_nse_net/make_table/ci-benchmarks/nse_net_make_table_unit_test.out diff --git a/unit_test/test_ase/make_table/main.cpp b/unit_test/test_nse_net/make_table/main.cpp similarity index 100% rename from unit_test/test_ase/make_table/main.cpp rename to unit_test/test_nse_net/make_table/main.cpp