Skip to content

Commit

Permalink
Merge branch 'development' into joss_paper
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Dec 1, 2024
2 parents 20bcbc6 + 161b785 commit 0a94076
Show file tree
Hide file tree
Showing 41 changed files with 234 additions and 131 deletions.
3 changes: 3 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Checks: >
-misc-include-cleaner,
-misc-non-private-member-variables-in-classes,
-misc-use-anonymous-namespace,
-misc-use-internal-linkage,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-use-trailing-return-type,
Expand All @@ -29,12 +30,14 @@ Checks: >
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-else-after-return,
-readability-enum-initial-value,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-math-missing-parentheses,
-readability-named-parameter,
-readability-simplify-boolean-expr,
mpi-*,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/burn_cell_metal_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Compile
run: |
cd unit_test/burn_cell_metal_chem
make -j 2
make -j 4
- name: Run and compare outputs for different Z values, also including cosmic ray ionization
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/burn_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Compile and run
run: |
cd unit_test/burn_cell_primordial_chem
make -j 2
make -j 4
./main1d.gnu.DEBUG.ex inputs_primordial_chem amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Print backtrace
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/c-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: AMReX-Astro/cpp-linter-action@main
with:
build_path: 'unit_test/test_react'
make_options: '-j 2 USE_OMP=FALSE USE_MPI=FALSE USE_CUDA=FALSE DEBUG=TRUE'
make_options: '-j 4 USE_OMP=FALSE USE_MPI=FALSE USE_CUDA=FALSE DEBUG=TRUE'
ignore_files: 'amrex|util/gcem'
header_filter: '(/conductivity/|/constants/|/EOS/|/integration/|/interfaces/|/networks/|/neutrinos/|/nse_solver/|/opacity/|/rates/|/screening/|/util/|^\./).*\.H$'
config_file: ${GITHUB_WORKSPACE}/.clang-tidy
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/castro-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
export MICROPHYSICS_HOME=${PWD}
cd Castro/Exec/science/flame_wave/
make -j2 CCACHE=ccache USE_MPI=FALSE
make -j 4 CCACHE=ccache USE_MPI=FALSE
ccache -s
du -hs ~/.cache/ccache
Expand All @@ -64,7 +64,7 @@ jobs:
export MICROPHYSICS_HOME=${PWD}
cd Castro/Exec/science/subchandra/
make -j2 CCACHE=ccache USE_MPI=FALSE
make -j 4 CCACHE=ccache USE_MPI=FALSE
ccache -s
du -hs ~/.cache/ccache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/castro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
export MICROPHYSICS_HOME=${PWD}
cd Castro/Exec/science/flame_wave/
make -j2 CCACHE=ccache USE_MPI=FALSE
make -j 4 CCACHE=ccache USE_MPI=FALSE
ccache -s
du -hs ~/.cache/ccache
Expand All @@ -68,7 +68,7 @@ jobs:
export MICROPHYSICS_HOME=${PWD}
cd Castro/Exec/science/subchandra/
make -j2 CCACHE=ccache USE_MPI=FALSE
make -j 4 CCACHE=ccache USE_MPI=FALSE
ccache -s
du -hs ~/.cache/ccache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- name: Install dependencies
run: |
.github/workflows/dependencies_clang-tidy-apt-llvm.sh 17
.github/workflows/dependencies_clang-tidy-apt-llvm.sh 19
- name: Compile burn_cell_sdc
run: |
cd unit_test/burn_cell_sdc
make USE_MPI=FALSE USE_CLANG_TIDY=TRUE CLANG_TIDY=clang-tidy-17 CLANG_TIDY_WARN_ERROR=TRUE -j 4
make USE_MPI=FALSE USE_CLANG_TIDY=TRUE CLANG_TIDY=clang-tidy-19 CLANG_TIDY_WARN_ERROR=TRUE -j 4
2 changes: 1 addition & 1 deletion .github/workflows/cmake_build_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
run: |
mkdir build && cd build
cmake .. -DBUILD_UNIT_TEST=true -DBUILD_AMReX=true
make -j2
make -j 4
ctest --output-on-failure
6 changes: 3 additions & 3 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_react
make NETWORK_DIR=aprox13 USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
make NETWORK_DIR=aprox13 USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 4
- name: compile test_react (ignition_reaclib/URCA-simple)
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_react
make realclean
make NETWORK_DIR=ignition_reaclib/URCA-simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
make NETWORK_DIR=ignition_reaclib/URCA-simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 4
- name: compile test_nse_net (ase)
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_nse_net
make USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
make USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 4
3 changes: 1 addition & 2 deletions .github/workflows/macos_build_cell_metal_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ jobs:
- name: Install dependencies
run: |
brew install cmake openmpi python3 || true
brew link --overwrite python@3.11
- name: Compile and run
run: |
mkdir build && cd build
cmake .. -DBUILD_UNIT_TEST_MC=true -DBUILD_AMReX=true
make -j2
make -j 4
ctest --output-on-failure
3 changes: 1 addition & 2 deletions .github/workflows/macos_build_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ jobs:
- name: Install dependencies
run: |
brew install cmake openmpi python3 || true
brew link --overwrite python@3.11
- name: Compile and run
run: |
mkdir build && cd build
cmake .. -DBUILD_UNIT_TEST_PC=true -DBUILD_AMReX=true
make -j2
make -j 4
ctest --output-on-failure
2 changes: 1 addition & 1 deletion .github/workflows/test_neutrinos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Build the fextrema tool
run: |
cd external/amrex/Tools/Plotfile
make programs=fextrema -j 2
make programs=fextrema -j 4
- name: Compile
run: |
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/test_partition_functions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: test_partition_functions

on: [pull_request]
jobs:
test_partition_functions:
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
run: |
cd unit_test/test_part_func
make clean
make -j 4
- name: Run test_part_func
run: |
cd unit_test/test_part_func
./main3d.gnu.ex > test.out
- name: Compare to stored output
run: |
cd unit_test/test_part_func
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/part_func.out
2 changes: 1 addition & 1 deletion .github/workflows/test_rhs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Build the fextrema tool
run: |
cd external/amrex/Tools/Plotfile
make programs=fextrema -j 2
make programs=fextrema -j 4
- name: Compile, test_rhs (VODE, ignition_simple)
run: |
Expand Down
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# 24.12

* documentation improvements (#1661, #1667, #1670)

* optimize tabular NSE EOS calls (#1668)

* CI fixes (#1666, #1671, #1675) and new partition function CI
(#1673)

* `burn_cell` can now initialize all mass fractions to be equal
(#1665)

# 24.10

* metal chemistry updates (#1648) with ices (#1650) and cosmic rays (#1651)
Expand Down
10 changes: 3 additions & 7 deletions integration/VODE/vode_dvhin.H
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,13 @@ void dvhin (BurnT& state, DvodeT& vstate, amrex::Real& H0, int& NITER, int& IER)

}

// Iteration done. Apply bounds, bias factor, and sign. Then exit.
// Iteration done. Apply bounds and bias factor. Then exit.
H0 = hnew * 0.5_rt;
if (H0 < HLB) {
H0 = HLB;
}
if (H0 > HUB) {
H0 = HUB;
}
H0 = std::clamp(H0, HLB, HUB);

}

// apply sign
H0 = std::copysign(H0, vstate.tout - vstate.t);
NITER = iter;
IER = 0;
Expand Down
2 changes: 1 addition & 1 deletion networks/aprox13/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ namespace NSE_INDEX
#endif

namespace Rates {
enum NetworkRates {
enum NetworkRates: std::uint8_t {
He4_He4_He4_to_C12 = 1,
C12_He4_to_O16,
C12_C12_to_Ne20_He4,
Expand Down
2 changes: 1 addition & 1 deletion networks/aprox21/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ namespace NSE_INDEX
#endif

namespace Rates {
enum NetworkRates {
enum NetworkRates : std::uint8_t {
H1_H1_to_He3 = 1,
H1_H1_H1_to_He3,
P_to_N,
Expand Down
2 changes: 1 addition & 1 deletion networks/iso7/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace NSE_INDEX
#endif

namespace Rates {
enum NetworkRates {
enum NetworkRates : std::uint8_t {
C12_He4_to_O16 = 1,
He4_He4_He4_to_C12,
C12_C12_to_Ne20_He4,
Expand Down
2 changes: 1 addition & 1 deletion networks/rprox/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace network

namespace Rates
{
enum NetworkRates
enum NetworkRates : std::uint8_t
{
He4_He4_He4_to_C12 = 1,
C12_H1_to_N13,
Expand Down
3 changes: 0 additions & 3 deletions networks/subch_base/subch_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ def doit():
net.make_ap_pg_approx(intermediate_nuclei=["cl35", "k39", "sc43", "v47", "mn51", "co55"])
net.remove_nuclei(["cl35", "k39", "sc43", "v47", "mn51", "co55"])

# finally, the aprox nets don't include the reverse rates for
# C12+C12, C12+O16, and O16+O16, so remove those

print(f"number of nuclei: {len(net.unique_nuclei)}")
print(f"number of rates: {len(net.rates)}")

Expand Down
3 changes: 0 additions & 3 deletions networks/subch_simple/subch_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ def doit():
net.make_ap_pg_approx(intermediate_nuclei=["cl35", "k39", "sc43", "v47", "mn51", "co55"])
net.remove_nuclei(["cl35", "k39", "sc43", "v47", "mn51", "co55"])

# finally, the aprox nets don't include the reverse rates for
# C12+C12, C12+O16, and O16+O16, so remove those

print(f"number of nuclei: {len(net.unique_nuclei)}")
print(f"number of rates: {len(net.rates)}")

Expand Down
8 changes: 4 additions & 4 deletions nse_tabular/nse_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ nse_T_abar_from_e(const amrex::Real rho, const amrex::Real e_in, const amrex::Re
amrex::Real abar_old = nse_state.abar;

// call the EOS with the initial guess for T
eos_extra_t eos_state;
eos_re_extra_t eos_state;
eos_state.rho = rho;
eos_state.T = T;
eos_state.aux[iye] = Ye;
Expand Down Expand Up @@ -156,7 +156,7 @@ nse_rho_abar_from_e(const amrex::Real T, const amrex::Real e_in, const amrex::Re
amrex::Real abar_old = nse_state.abar;

// call the EOS with the initial guess for rho
eos_extra_t eos_state;
eos_re_extra_t eos_state;
eos_state.rho = rho;
eos_state.T = T;
eos_state.aux[iye] = Ye;
Expand Down Expand Up @@ -247,7 +247,7 @@ nse_T_abar_from_p(const amrex::Real rho, const amrex::Real p_in, const amrex::Re
amrex::Real abar_old = nse_state.abar;

// call the EOS with the initial guess for T
eos_extra_t eos_state;
eos_rep_extra_t eos_state;
eos_state.rho = rho;
eos_state.T = T;
eos_state.aux[iye] = Ye;
Expand Down Expand Up @@ -338,7 +338,7 @@ nse_rho_abar_from_p(const amrex::Real T, const amrex::Real p_in, const amrex::Re
amrex::Real abar_old = nse_state.abar;

// call the EOS with the initial guess for rho
eos_extra_t eos_state;
eos_rep_extra_t eos_state;
eos_state.rho = rho;
eos_state.T = T;
eos_state.aux[iye] = Ye;
Expand Down
3 changes: 3 additions & 0 deletions sphinx_docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,11 @@ def get_version():

linkcheck_retries = 3
linkcheck_timeout = 100
linkcheck_allow_unauthorized = True
linkcheck_ignore = [r"https://doi.org/10.1103/[Pp]hys[Rr]ev*"]
user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0"


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
Expand Down
10 changes: 9 additions & 1 deletion sphinx_docs/source/data_structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ EOS
``eos_t``
---------

.. index:: eos_t

The main data structure for interacting with the EOS is ``eos_t``.
This is a collection of data specifying the microphysical state of the
fluid that we are evaluating. This has many components. For a
Expand Down Expand Up @@ -49,6 +51,8 @@ Networks
``burn_t``
----------

.. index:: burn_t

The main data structure for interacting with the reaction networks is
``burn_t``. This holds the composition (mass fractions), thermodynamic
state, and a lot of internal information used by the reaction network
Expand Down Expand Up @@ -89,14 +93,18 @@ the user will only need to fill/use the following information:
``rate_t``, ``rate_fr_t``
-------------------------

The ``rate_t`` and ``rate_fr_t`` structures are used internally in a network to pass the
.. index:: rate_t

The ``rate_t`` structure is used internally in a network to pass the
raw reaction rate information (usually just the temperature-dependent
terms) between various subroutines. It does not come out of the
network-specific righthand side or Jacobian routines.

``burn_type.H``
---------------

.. index:: burn_type.H

In addition to defining the ``burn_t`` type, the header ``burn_type.H``
also defines integer indices into the solution vector that can be used
to access the different components of the state:
Expand Down
Loading

0 comments on commit 0a94076

Please sign in to comment.