Skip to content

Commit 36ff64c

Browse files
authored
Merge branch 'development' into retry_retry
2 parents 7d5f342 + 29b594f commit 36ff64c

33 files changed

+174
-208
lines changed

.clang-tidy

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Checks: >
66
clang-diagnostic-*,
77
cppcoreguidelines-*,
88
-cppcoreguidelines-avoid-c-arrays,
9-
-cppcoreguidelines-avoid-goto,
109
-cppcoreguidelines-avoid-magic-numbers,
1110
-cppcoreguidelines-avoid-non-const-global-variables,
1211
-cppcoreguidelines-init-variables,
@@ -16,11 +15,19 @@ Checks: >
1615
-cppcoreguidelines-non-private-member-variables-in-classes,
1716
-cppcoreguidelines-owning-memory,
1817
-cppcoreguidelines-pro-*,
18+
misc-*,
19+
-misc-const-correctness,
20+
-misc-include-cleaner,
21+
-misc-non-private-member-variables-in-classes,
22+
-misc-no-recursion,
23+
-misc-use-anonymous-namespace,
1924
modernize-*,
2025
-modernize-avoid-c-arrays,
2126
-modernize-use-trailing-return-type,
2227
-modernize-use-using,
2328
performance-*,
29+
-performance-avoid-endl,
30+
portability-*,
2431
readability-*,
2532
-readability-avoid-const-params-in-decls,
2633
-readability-braces-around-statements,

.github/dependabot.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Dependabot configuration
2+
# ref: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
3+
version: 2
4+
updates:
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"
9+
target-branch: "development"
10+
11+
- package-ecosystem: "pip"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
target-branch: "development"
16+

.github/workflows/castro-development.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
.github/workflows/dependencies/dependencies.sh
3030
.github/workflows/dependencies/dependencies_ccache.sh
3131
- name: Set Up Cache
32-
uses: actions/cache@v3
32+
uses: actions/cache@v4
3333
with:
3434
path: ~/.cache/ccache
3535
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
@@ -78,7 +78,7 @@ jobs:
7878
PR_NUMBER: ${{ github.event.number }}
7979
run: |
8080
echo $PR_NUMBER > pr_number.txt
81-
- uses: actions/upload-artifact@v3
81+
- uses: actions/upload-artifact@v4
8282
with:
8383
name: pr_number
8484
path: pr_number.txt

.github/workflows/castro.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
.github/workflows/dependencies/dependencies.sh
3434
.github/workflows/dependencies/dependencies_ccache.sh
3535
- name: Set Up Cache
36-
uses: actions/cache@v3
36+
uses: actions/cache@v4
3737
with:
3838
path: ~/.cache/ccache
3939
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
@@ -82,7 +82,7 @@ jobs:
8282
PR_NUMBER: ${{ github.event.number }}
8383
run: |
8484
echo $PR_NUMBER > pr_number.txt
85-
- uses: actions/upload-artifact@v3
85+
- uses: actions/upload-artifact@v4
8686
with:
8787
name: pr_number
8888
path: pr_number.txt

.github/workflows/check_powi.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
2020

2121
- name: Setup Python
22-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: '3.10'
2525

2626
- name: Cache pip
27-
uses: actions/cache@v3
27+
uses: actions/cache@v4
2828
with:
2929
# this path is specific to Ubuntu
3030
path: ~/.cache/pip

CHANGES.md

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# 24.02
2+
3+
* Lots of general code cleaning from coverity and clang-tidy
4+
(#1450, #1452, #1453, #1460, #1459, #1457, #1458)
5+
6+
* Fixed a bug in the VODE pivoting when a cached Jacobian is used
7+
(#1456)
8+
9+
* Added reverse rates to CNO_extras (#1445)
10+
11+
* Sync networks up with pynucastro to get constexpr mion/bion
12+
(#1437)
13+
14+
* NSE+SDC improvements (#1431)
15+
16+
* Start of moving the runtime parameters from globals to structs
17+
(#1422)
18+
119
# 24.01
220

321
* The quantum corrections for the Chabrier screening are

EOS/breakout/actual_eos.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ template <typename I>
2929
AMREX_GPU_HOST_DEVICE AMREX_INLINE
3030
bool is_input_valid (I input)
3131
{
32-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
32+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
3333

3434
bool valid = true;
3535

@@ -48,7 +48,7 @@ template <typename I, typename T>
4848
AMREX_GPU_HOST_DEVICE AMREX_INLINE
4949
void actual_eos (I input, T& state)
5050
{
51-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
51+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
5252

5353
const Real R = C::k_B * C::n_A;
5454

EOS/gamma_law/actual_eos.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ template <typename I>
3434
AMREX_GPU_HOST_DEVICE AMREX_INLINE
3535
bool is_input_valid (I input)
3636
{
37-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
37+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
3838

3939
bool valid = true;
4040

@@ -50,7 +50,7 @@ template <typename I, typename T>
5050
AMREX_GPU_HOST_DEVICE AMREX_INLINE
5151
void actual_eos (I input, T& state)
5252
{
53-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
53+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
5454

5555
// Get the mass of a nucleon from m_u.
5656
const Real m_nucleon = C::m_u;

EOS/helmholtz/actual_eos.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ template <typename I, typename T>
12381238
AMREX_GPU_HOST_DEVICE AMREX_INLINE
12391239
void actual_eos (I input, T& state)
12401240
{
1241-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
1241+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
12421242

12431243
using namespace helmholtz;
12441244

@@ -1489,7 +1489,7 @@ bool is_input_valid (I input)
14891489
{
14901490
amrex::ignore_unused(input);
14911491

1492-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
1492+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
14931493

14941494
bool valid = true;
14951495

EOS/multigamma/actual_eos.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ template <typename I>
5353
AMREX_GPU_HOST_DEVICE AMREX_INLINE
5454
bool is_input_valid (I input)
5555
{
56-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
56+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
5757

5858
bool valid = true;
5959

@@ -70,7 +70,7 @@ template <typename I, typename T>
7070
AMREX_GPU_HOST_DEVICE AMREX_INLINE
7171
void actual_eos (I input, T& state)
7272
{
73-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
73+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
7474

7575
// Get the mass of a nucleon from Avogadro's number.
7676
const Real m_nucleon = 1.0_rt / C::n_A;

EOS/polytrope/actual_eos.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ template <typename I>
7979
AMREX_GPU_HOST_DEVICE AMREX_INLINE
8080
bool is_input_valid (I input)
8181
{
82-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
82+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
8383

8484
bool valid = true;
8585

@@ -122,7 +122,7 @@ template <typename I, typename T>
122122
AMREX_GPU_HOST_DEVICE AMREX_INLINE
123123
void actual_eos (I input, T& state)
124124
{
125-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
125+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
126126

127127
Real dens = state.rho;
128128
Real temp = state.T;

EOS/primordial_chem/actual_eos.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ template <typename I>
120120
AMREX_GPU_HOST_DEVICE AMREX_INLINE
121121
bool is_input_valid (I input)
122122
{
123-
static_assert(std::is_same<I, eos_input_t>::value, "input must be either eos_input_rt or eos_input_re");
123+
static_assert(std::is_same_v<I, eos_input_t>, "input must be either eos_input_rt or eos_input_re");
124124

125125
bool valid = false;
126126

@@ -137,7 +137,7 @@ template <typename I, typename T>
137137
AMREX_GPU_HOST_DEVICE AMREX_INLINE
138138
void actual_eos (I input, T& state)
139139
{
140-
static_assert(std::is_same<I, eos_input_t>::value, "input must be either eos_input_rt or eos_input_re");
140+
static_assert(std::is_same_v<I, eos_input_t>, "input must be either eos_input_rt or eos_input_re");
141141

142142
const Real gasconstant = C::n_A * C::k_B;
143143
const Real protonmass = C::m_p;

EOS/rad_power_law/actual_eos.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ template <typename I>
4949
AMREX_GPU_HOST_DEVICE AMREX_INLINE
5050
bool is_input_valid (I input)
5151
{
52-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
52+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
5353

5454
bool valid = true;
5555

@@ -70,7 +70,7 @@ template <typename I, typename T>
7070
AMREX_GPU_HOST_DEVICE AMREX_INLINE
7171
void actual_eos (I input, T& state)
7272
{
73-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
73+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
7474

7575
switch (input) {
7676

EOS/tillotson/actual_eos.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ template <typename I>
2727
AMREX_GPU_HOST_DEVICE AMREX_INLINE
2828
bool is_input_valid (I input)
2929
{
30-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
30+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
3131

3232
bool valid = false;
3333

@@ -47,7 +47,7 @@ template <typename I, typename T>
4747
AMREX_GPU_HOST_DEVICE AMREX_INLINE
4848
void actual_eos (I input, T& state)
4949
{
50-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
50+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
5151

5252
// First make T and e consistent with each other.
5353
// We assume a simple relationship between energy and temperature.

EOS/ztwd/actual_eos.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ template <typename I>
4242
AMREX_GPU_HOST_DEVICE AMREX_INLINE
4343
bool is_input_valid (I input)
4444
{
45-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
45+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
4646

4747
bool valid = true;
4848

@@ -129,7 +129,7 @@ template <typename I, typename T>
129129
AMREX_GPU_HOST_DEVICE AMREX_INLINE
130130
void actual_eos (I input, T& state)
131131
{
132-
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
132+
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");
133133

134134
Real dens = state.rho;
135135
Real temp = state.T;

integration/VODE/actual_integrator.H

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ void actual_integrator (BurnT& state, Real dt, bool is_retry=false)
9191
for (int n = 0; n < NumSpec; ++n) {
9292
xn_in[n] = state.xn[n];
9393
}
94-
Real T_in = state.T;
94+
const Real T_in = state.T;
9595
#endif
96-
Real e_in = state.e;
96+
const Real e_in = state.e;
9797

9898
// Call the integration routine.
9999

@@ -185,14 +185,14 @@ void actual_integrator (BurnT& state, Real dt, bool is_retry=false)
185185
std::cout << "dt = " << std::setprecision(16) << dt << std::endl;
186186
std::cout << "temp start = " << std::setprecision(16) << T_in << std::endl;
187187
std::cout << "xn start = ";
188-
for (double x : xn_in) {
188+
for (const double x : xn_in) {
189189
std::cout << std::setprecision(16) << x << " ";
190190
}
191191
std::cout << std::endl;
192192
std::cout << "dens current = " << std::setprecision(16) << state.rho << std::endl;
193193
std::cout << "temp current = " << std::setprecision(16) << state.T << std::endl;
194194
std::cout << "xn current = ";
195-
for (double x : state.xn) {
195+
for (const double x : state.xn) {
196196
std::cout << std::setprecision(16) << x << " ";
197197
}
198198
std::cout << std::endl;

integration/VODE/vode_dvhin.H

+9-9
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ void dvhin (BurnT& state, DvodeT& vstate, Real& H0, int& NITER, int& IER)
2626
const Real PT1 = 0.1e0_rt;
2727

2828
NITER = 0;
29-
Real TDIST = std::abs(vstate.tout - vstate.t);
30-
Real TROUND = UROUND * amrex::max(std::abs(vstate.t), std::abs(vstate.tout));
29+
const Real TDIST = std::abs(vstate.tout - vstate.t);
30+
const Real TROUND = UROUND * amrex::max(std::abs(vstate.t), std::abs(vstate.tout));
3131

3232
if (TDIST < 2.0_rt * TROUND) {
3333
// Error return for vstate.tout - vstate.t too small.
@@ -36,15 +36,15 @@ void dvhin (BurnT& state, DvodeT& vstate, Real& H0, int& NITER, int& IER)
3636
}
3737

3838
// Set a lower bound on h based on the roundoff level in vstate.t and vstate.tout.
39-
Real HLB = 100.0_rt * TROUND;
39+
const Real HLB = 100.0_rt * TROUND;
4040

4141
// Set an upper bound on h based on vstate.tout-vstate.t and the initial Y and YDOT.
4242
Real HUB = PT1 * TDIST;
4343

4444
for (int i = 1; i <= int_neqs; ++i) {
45-
Real atol = i <= NumSpec ? vstate.atol_spec : vstate.atol_enuc;
46-
Real DELYI = PT1 * std::abs(vstate.yh(i,1)) + atol;
47-
Real AFI = std::abs(vstate.yh(i,2));
45+
const Real atol = i <= NumSpec ? vstate.atol_spec : vstate.atol_enuc;
46+
const Real DELYI = PT1 * std::abs(vstate.yh(i,1)) + atol;
47+
const Real AFI = std::abs(vstate.yh(i,2));
4848
if (AFI * HUB > DELYI) {
4949
HUB = DELYI / AFI;
5050
}
@@ -61,14 +61,14 @@ void dvhin (BurnT& state, DvodeT& vstate, Real& H0, int& NITER, int& IER)
6161
do_iterations = false;
6262
}
6363

64-
Real hnew;
64+
Real hnew{};
6565

6666
if (do_iterations) {
6767

6868
while (true) {
6969

7070
// Estimate the second derivative as a difference quotient in f.
71-
Real H = std::copysign(HG, vstate.tout - vstate.t);
71+
const Real H = std::copysign(HG, vstate.tout - vstate.t);
7272
for (int i = 1; i <= int_neqs; ++i) {
7373
vstate.y(i) = vstate.yh(i,1) + H * vstate.yh(i,2);
7474
}
@@ -106,7 +106,7 @@ void dvhin (BurnT& state, DvodeT& vstate, Real& H0, int& NITER, int& IER)
106106
break;
107107
}
108108

109-
Real HRAT = hnew / HG;
109+
const Real HRAT = hnew / HG;
110110
if ((HRAT > 0.5_rt) && (HRAT < 2.0_rt)) {
111111
break;
112112
}

0 commit comments

Comments
 (0)