Skip to content

Commit

Permalink
Merge branch 'development' into ROCK4
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Feb 2, 2024
2 parents 45c1c07 + 29b594f commit 8ea19a4
Show file tree
Hide file tree
Showing 41 changed files with 3,271 additions and 926 deletions.
9 changes: 8 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Checks: >
clang-diagnostic-*,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-goto,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-init-variables,
Expand All @@ -16,11 +15,19 @@ Checks: >
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-*,
misc-*,
-misc-const-correctness,
-misc-include-cleaner,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-misc-use-anonymous-namespace,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-use-trailing-return-type,
-modernize-use-using,
performance-*,
-performance-avoid-endl,
portability-*,
readability-*,
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
Expand Down
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Dependabot configuration
# ref: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "development"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
target-branch: "development"

4 changes: 2 additions & 2 deletions .github/workflows/castro-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
.github/workflows/dependencies/dependencies.sh
.github/workflows/dependencies/dependencies_ccache.sh
- name: Set Up Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/castro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
.github/workflows/dependencies/dependencies.sh
.github/workflows/dependencies/dependencies_ccache.sh
- name: Set Up Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check_powi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Cache pip
uses: actions/cache@v3
uses: actions/cache@v4
with:
# this path is specific to Ubuntu
path: ~/.cache/pip
Expand Down
18 changes: 18 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# 24.02

* Lots of general code cleaning from coverity and clang-tidy
(#1450, #1452, #1453, #1460, #1459, #1457, #1458)

* Fixed a bug in the VODE pivoting when a cached Jacobian is used
(#1456)

* Added reverse rates to CNO_extras (#1445)

* Sync networks up with pynucastro to get constexpr mion/bion
(#1437)

* NSE+SDC improvements (#1431)

* Start of moving the runtime parameters from globals to structs
(#1422)

# 24.01

* The quantum corrections for the Chabrier screening are
Expand Down
4 changes: 2 additions & 2 deletions EOS/breakout/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ template <typename I>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
bool is_input_valid (I input)
{
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");

bool valid = true;

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

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

Expand Down
4 changes: 2 additions & 2 deletions EOS/gamma_law/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ template <typename I>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
bool is_input_valid (I input)
{
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");

bool valid = true;

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

// Get the mass of a nucleon from m_u.
const Real m_nucleon = C::m_u;
Expand Down
4 changes: 2 additions & 2 deletions EOS/helmholtz/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ template <typename I, typename T>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void actual_eos (I input, T& state)
{
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");

using namespace helmholtz;

Expand Down Expand Up @@ -1489,7 +1489,7 @@ bool is_input_valid (I input)
{
amrex::ignore_unused(input);

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

bool valid = true;

Expand Down
4 changes: 2 additions & 2 deletions EOS/multigamma/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ template <typename I>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
bool is_input_valid (I input)
{
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");

bool valid = true;

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

// Get the mass of a nucleon from Avogadro's number.
const Real m_nucleon = 1.0_rt / C::n_A;
Expand Down
4 changes: 2 additions & 2 deletions EOS/polytrope/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ template <typename I>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
bool is_input_valid (I input)
{
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");

bool valid = true;

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

Real dens = state.rho;
Real temp = state.T;
Expand Down
4 changes: 2 additions & 2 deletions EOS/primordial_chem/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ template <typename I>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
bool is_input_valid (I input)
{
static_assert(std::is_same<I, eos_input_t>::value, "input must be either eos_input_rt or eos_input_re");
static_assert(std::is_same_v<I, eos_input_t>, "input must be either eos_input_rt or eos_input_re");

bool valid = false;

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

const Real gasconstant = C::n_A * C::k_B;
const Real protonmass = C::m_p;
Expand Down
4 changes: 2 additions & 2 deletions EOS/rad_power_law/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ template <typename I>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
bool is_input_valid (I input)
{
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");

bool valid = true;

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

switch (input) {

Expand Down
4 changes: 2 additions & 2 deletions EOS/tillotson/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ template <typename I>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
bool is_input_valid (I input)
{
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");

bool valid = false;

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

// First make T and e consistent with each other.
// We assume a simple relationship between energy and temperature.
Expand Down
4 changes: 2 additions & 2 deletions EOS/ztwd/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ template <typename I>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
bool is_input_valid (I input)
{
static_assert(std::is_same<I, eos_input_t>::value, "input must be an eos_input_t");
static_assert(std::is_same_v<I, eos_input_t>, "input must be an eos_input_t");

bool valid = true;

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

Real dens = state.rho;
Real temp = state.T;
Expand Down
8 changes: 4 additions & 4 deletions integration/VODE/actual_integrator.H
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ void actual_integrator (BurnT& state, Real dt)
for (int n = 0; n < NumSpec; ++n) {
xn_in[n] = state.xn[n];
}
Real T_in = state.T;
const Real T_in = state.T;
#endif
Real e_in = state.e;
const Real e_in = state.e;

// Call the integration routine.

Expand Down Expand Up @@ -173,14 +173,14 @@ void actual_integrator (BurnT& state, Real dt)
std::cout << "dt = " << std::setprecision(16) << dt << std::endl;
std::cout << "temp start = " << std::setprecision(16) << T_in << std::endl;
std::cout << "xn start = ";
for (double x : xn_in) {
for (const double x : xn_in) {
std::cout << std::setprecision(16) << x << " ";
}
std::cout << std::endl;
std::cout << "dens current = " << std::setprecision(16) << state.rho << std::endl;
std::cout << "temp current = " << std::setprecision(16) << state.T << std::endl;
std::cout << "xn current = ";
for (double x : state.xn) {
for (const double x : state.xn) {
std::cout << std::setprecision(16) << x << " ";
}
std::cout << std::endl;
Expand Down
18 changes: 9 additions & 9 deletions integration/VODE/vode_dvhin.H
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ void dvhin (BurnT& state, DvodeT& vstate, Real& H0, int& NITER, int& IER)
const Real PT1 = 0.1e0_rt;

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

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

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

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

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

Real hnew;
Real hnew{};

if (do_iterations) {

while (true) {

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

Real HRAT = hnew / HG;
const Real HRAT = hnew / HG;
if ((HRAT > 0.5_rt) && (HRAT < 2.0_rt)) {
break;
}
Expand Down
Loading

0 comments on commit 8ea19a4

Please sign in to comment.