Skip to content

Commit bfd4f31

Browse files
committed
Merge branch 'development' into rename_subch_nets
2 parents e426083 + b5a9fec commit bfd4f31

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+489
-227
lines changed

.clang-tidy

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Checks: >
1919
-misc-include-cleaner,
2020
-misc-non-private-member-variables-in-classes,
2121
-misc-use-anonymous-namespace,
22+
-misc-use-internal-linkage,
2223
modernize-*,
2324
-modernize-avoid-c-arrays,
2425
-modernize-use-trailing-return-type,
@@ -29,12 +30,14 @@ Checks: >
2930
-readability-avoid-const-params-in-decls,
3031
-readability-braces-around-statements,
3132
-readability-else-after-return,
33+
-readability-enum-initial-value,
3234
-readability-function-cognitive-complexity,
3335
-readability-function-size,
3436
-readability-identifier-length,
3537
-readability-implicit-bool-conversion,
3638
-readability-isolate-declaration,
3739
-readability-magic-numbers,
40+
-readability-math-missing-parentheses,
3841
-readability-named-parameter,
3942
-readability-simplify-boolean-expr,
4043
mpi-*,

.github/workflows/burn_cell_metal_chem.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Compile
3232
run: |
3333
cd unit_test/burn_cell_metal_chem
34-
make -j 2
34+
make -j 4
3535
3636
- name: Run and compare outputs for different Z values, also including cosmic ray ionization
3737
run: |

.github/workflows/burn_cell_primordial_chem.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Compile and run
3232
run: |
3333
cd unit_test/burn_cell_primordial_chem
34-
make -j 2
34+
make -j 4
3535
./main1d.gnu.DEBUG.ex inputs_primordial_chem amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
3636
3737
- name: Print backtrace

.github/workflows/c-linter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: AMReX-Astro/cpp-linter-action@main
2727
with:
2828
build_path: 'unit_test/test_react'
29-
make_options: '-j 2 USE_OMP=FALSE USE_MPI=FALSE USE_CUDA=FALSE DEBUG=TRUE'
29+
make_options: '-j 4 USE_OMP=FALSE USE_MPI=FALSE USE_CUDA=FALSE DEBUG=TRUE'
3030
ignore_files: 'amrex|util/gcem'
3131
header_filter: '(/conductivity/|/constants/|/EOS/|/integration/|/interfaces/|/networks/|/neutrinos/|/nse_solver/|/opacity/|/rates/|/screening/|/util/|^\./).*\.H$'
3232
config_file: ${GITHUB_WORKSPACE}/.clang-tidy

.github/workflows/castro-development.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
export MICROPHYSICS_HOME=${PWD}
4848
4949
cd Castro/Exec/science/flame_wave/
50-
make -j2 CCACHE=ccache USE_MPI=FALSE
50+
make -j 4 CCACHE=ccache USE_MPI=FALSE
5151
5252
ccache -s
5353
du -hs ~/.cache/ccache
@@ -64,7 +64,7 @@ jobs:
6464
export MICROPHYSICS_HOME=${PWD}
6565
6666
cd Castro/Exec/science/subchandra/
67-
make -j2 CCACHE=ccache USE_MPI=FALSE
67+
make -j 4 CCACHE=ccache USE_MPI=FALSE
6868
6969
ccache -s
7070
du -hs ~/.cache/ccache

.github/workflows/castro.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
export MICROPHYSICS_HOME=${PWD}
5252
5353
cd Castro/Exec/science/flame_wave/
54-
make -j2 CCACHE=ccache USE_MPI=FALSE
54+
make -j 4 CCACHE=ccache USE_MPI=FALSE
5555
5656
ccache -s
5757
du -hs ~/.cache/ccache
@@ -68,7 +68,7 @@ jobs:
6868
export MICROPHYSICS_HOME=${PWD}
6969
7070
cd Castro/Exec/science/subchandra/
71-
make -j2 CCACHE=ccache USE_MPI=FALSE
71+
make -j 4 CCACHE=ccache USE_MPI=FALSE
7272
7373
ccache -s
7474
du -hs ~/.cache/ccache

.github/workflows/clang-tidy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
2727
- name: Install dependencies
2828
run: |
29-
.github/workflows/dependencies_clang-tidy-apt-llvm.sh 17
29+
.github/workflows/dependencies_clang-tidy-apt-llvm.sh 19
3030
3131
- name: Compile burn_cell_sdc
3232
run: |
3333
cd unit_test/burn_cell_sdc
34-
make USE_MPI=FALSE USE_CLANG_TIDY=TRUE CLANG_TIDY=clang-tidy-17 CLANG_TIDY_WARN_ERROR=TRUE -j 4
34+
make USE_MPI=FALSE USE_CLANG_TIDY=TRUE CLANG_TIDY=clang-tidy-19 CLANG_TIDY_WARN_ERROR=TRUE -j 4
3535

.github/workflows/cmake_build_cell_primordial_chem.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ jobs:
1818
run: |
1919
mkdir build && cd build
2020
cmake .. -DBUILD_UNIT_TEST=true -DBUILD_AMReX=true
21-
make -j2
21+
make -j 4
2222
ctest --output-on-failure

.github/workflows/cuda.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ jobs:
3232
run: |
3333
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
3434
cd unit_test/test_react
35-
make NETWORK_DIR=aprox13 USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
35+
make NETWORK_DIR=aprox13 USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 4
3636
3737
- name: compile test_react (ignition_reaclib/URCA-simple)
3838
run: |
3939
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
4040
cd unit_test/test_react
4141
make realclean
42-
make NETWORK_DIR=ignition_reaclib/URCA-simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
42+
make NETWORK_DIR=ignition_reaclib/URCA-simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 4
4343
4444
- name: compile test_nse_net (ase)
4545
run: |
4646
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
4747
cd unit_test/test_nse_net
48-
make USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
48+
make USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 4

.github/workflows/macos_build_cell_metal_chem.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
run: |
1818
mkdir build && cd build
1919
cmake .. -DBUILD_UNIT_TEST_MC=true -DBUILD_AMReX=true
20-
make -j2
20+
make -j 4
2121
ctest --output-on-failure

.github/workflows/macos_build_cell_primordial_chem.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
run: |
1818
mkdir build && cd build
1919
cmake .. -DBUILD_UNIT_TEST_PC=true -DBUILD_AMReX=true
20-
make -j2
20+
make -j 4
2121
ctest --output-on-failure

.github/workflows/test_neutrinos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Build the fextrema tool
3030
run: |
3131
cd external/amrex/Tools/Plotfile
32-
make programs=fextrema -j 2
32+
make programs=fextrema -j 4
3333
3434
- name: Compile
3535
run: |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: test_partition_functions
2+
3+
on: [pull_request]
4+
jobs:
5+
test_partition_functions:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
with:
10+
fetch-depth: 0
11+
12+
- name: Get AMReX
13+
run: |
14+
mkdir external
15+
cd external
16+
git clone https://github.com/AMReX-Codes/amrex.git
17+
cd amrex
18+
git checkout development
19+
echo 'AMREX_HOME=$(GITHUB_WORKSPACE)/external/amrex' >> $GITHUB_ENV
20+
echo $AMREX_HOME
21+
if [[ -n "${AMREX_HOME}" ]]; then exit 1; fi
22+
cd ../..
23+
24+
- name: Install dependencies
25+
run: |
26+
sudo apt-get update -y -qq
27+
sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0
28+
29+
- name: Compile
30+
run: |
31+
cd unit_test/test_part_func
32+
make clean
33+
make -j 4
34+
35+
- name: Run test_part_func
36+
run: |
37+
cd unit_test/test_part_func
38+
./main3d.gnu.ex > test.out
39+
40+
- name: Compare to stored output
41+
run: |
42+
cd unit_test/test_part_func
43+
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/part_func.out
44+

.github/workflows/test_rhs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Build the fextrema tool
3030
run: |
3131
cd external/amrex/Tools/Plotfile
32-
make programs=fextrema -j 2
32+
make programs=fextrema -j 4
3333
3434
- name: Compile, test_rhs (VODE, ignition_simple)
3535
run: |

CHANGES.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
# 24.11
1+
# 24.12
22

3-
* a new metal chemistry network was added (#1648, #1650, #1651)
3+
* documentation improvements (#1661, #1667, #1670)
44

5-
* add dust temperature to primordial chem (#1649)
5+
* optimize tabular NSE EOS calls (#1668)
66

7-
* documentation updates (#1652)
7+
* CI fixes (#1666, #1671, #1675) and new partition function CI
8+
(#1673)
9+
10+
* `burn_cell` can now initialize all mass fractions to be equal
11+
(#1665)
812

913
# 24.10
1014

integration/VODE/vode_dvhin.H

+3-7
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,13 @@ void dvhin (BurnT& state, DvodeT& vstate, amrex::Real& H0, int& NITER, int& IER)
122122

123123
}
124124

125-
// Iteration done. Apply bounds, bias factor, and sign. Then exit.
125+
// Iteration done. Apply bounds and bias factor. Then exit.
126126
H0 = hnew * 0.5_rt;
127-
if (H0 < HLB) {
128-
H0 = HLB;
129-
}
130-
if (H0 > HUB) {
131-
H0 = HUB;
132-
}
127+
H0 = std::clamp(H0, HLB, HUB);
133128

134129
}
135130

131+
// apply sign
136132
H0 = std::copysign(H0, vstate.tout - vstate.t);
137133
NITER = iter;
138134
IER = 0;

integration/integrator_setup_strang.H

-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ IntegratorT integrator_setup (BurnT& state, amrex::Real dt, bool is_retry)
9090

9191
burn_to_integrator(state, int_state);
9292

93-
// Save the initial composition, temperature, and energy for our later diagnostics.
94-
9593
return int_state;
9694
}
9795

networks/aprox13/actual_network.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ namespace NSE_INDEX
134134
#endif
135135

136136
namespace Rates {
137-
enum NetworkRates {
137+
enum NetworkRates: std::uint8_t {
138138
He4_He4_He4_to_C12 = 1,
139139
C12_He4_to_O16,
140140
C12_C12_to_Ne20_He4,

networks/aprox21/actual_network.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ namespace NSE_INDEX
152152
#endif
153153

154154
namespace Rates {
155-
enum NetworkRates {
155+
enum NetworkRates : std::uint8_t {
156156
H1_H1_to_He3 = 1,
157157
H1_H1_H1_to_He3,
158158
P_to_N,

networks/iso7/actual_network.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ namespace NSE_INDEX
114114
#endif
115115

116116
namespace Rates {
117-
enum NetworkRates {
117+
enum NetworkRates : std::uint8_t {
118118
C12_He4_to_O16 = 1,
119119
He4_He4_He4_to_C12,
120120
C12_C12_to_Ne20_He4,

networks/rprox/actual_network.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ namespace network
112112

113113
namespace Rates
114114
{
115-
enum NetworkRates
115+
enum NetworkRates : std::uint8_t
116116
{
117117
He4_He4_He4_to_C12 = 1,
118118
C12_H1_to_N13,

networks/subch_base

-1
This file was deleted.

networks/subch_simple

-1
This file was deleted.

nse_tabular/nse_eos.H

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ nse_T_abar_from_e(const amrex::Real rho, const amrex::Real e_in, const amrex::Re
6565
amrex::Real abar_old = nse_state.abar;
6666

6767
// call the EOS with the initial guess for T
68-
eos_extra_t eos_state;
68+
eos_re_extra_t eos_state;
6969
eos_state.rho = rho;
7070
eos_state.T = T;
7171
eos_state.aux[iye] = Ye;
@@ -156,7 +156,7 @@ nse_rho_abar_from_e(const amrex::Real T, const amrex::Real e_in, const amrex::Re
156156
amrex::Real abar_old = nse_state.abar;
157157

158158
// call the EOS with the initial guess for rho
159-
eos_extra_t eos_state;
159+
eos_re_extra_t eos_state;
160160
eos_state.rho = rho;
161161
eos_state.T = T;
162162
eos_state.aux[iye] = Ye;
@@ -247,7 +247,7 @@ nse_T_abar_from_p(const amrex::Real rho, const amrex::Real p_in, const amrex::Re
247247
amrex::Real abar_old = nse_state.abar;
248248

249249
// call the EOS with the initial guess for T
250-
eos_extra_t eos_state;
250+
eos_rep_extra_t eos_state;
251251
eos_state.rho = rho;
252252
eos_state.T = T;
253253
eos_state.aux[iye] = Ye;
@@ -338,7 +338,7 @@ nse_rho_abar_from_p(const amrex::Real T, const amrex::Real p_in, const amrex::Re
338338
amrex::Real abar_old = nse_state.abar;
339339

340340
// call the EOS with the initial guess for rho
341-
eos_extra_t eos_state;
341+
eos_rep_extra_t eos_state;
342342
eos_state.rho = rho;
343343
eos_state.T = T;
344344
eos_state.aux[iye] = Ye;

sphinx_docs/source/data_structures.rst

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ EOS
1313
``eos_t``
1414
---------
1515

16+
.. index:: eos_t
17+
1618
The main data structure for interacting with the EOS is ``eos_t``.
1719
This is a collection of data specifying the microphysical state of the
1820
fluid that we are evaluating. This has many components. For a
@@ -49,6 +51,8 @@ Networks
4951
``burn_t``
5052
----------
5153

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

92-
The ``rate_t`` and ``rate_fr_t`` structures are used internally in a network to pass the
96+
.. index:: rate_t
97+
98+
The ``rate_t`` structure is used internally in a network to pass the
9399
raw reaction rate information (usually just the temperature-dependent
94100
terms) between various subroutines. It does not come out of the
95101
network-specific righthand side or Jacobian routines.
96102

97103
``burn_type.H``
98104
---------------
99105

106+
.. index:: burn_type.H
107+
100108
In addition to defining the ``burn_t`` type, the header ``burn_type.H``
101109
also defines integer indices into the solution vector that can be used
102110
to access the different components of the state:

0 commit comments

Comments
 (0)