Skip to content

Commit

Permalink
Merge branch 'development' into new_shock_flag_call
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Apr 7, 2024
2 parents 89e58ce + 49dcb5a commit 312d00c
Show file tree
Hide file tree
Showing 51 changed files with 493 additions and 347 deletions.
2 changes: 0 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Checks: >
-cppcoreguidelines-init-variables,
-cppcoreguidelines-interfaces-global-init,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-no-malloc,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-*,
Expand All @@ -25,7 +24,6 @@ Checks: >
modernize-*,
-modernize-avoid-c-arrays,
-modernize-use-trailing-return-type,
-modernize-use-using,
performance-*,
-performance-avoid-endl,
portability-*,
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/c-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: cpp-linter

on: [pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
cpp-linter:
runs-on: ubuntu-latest
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/check_pr_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: check PR branch

on:
pull_request:
types:
- opened
- synchronize
- reopened
- edited

jobs:
check-PR-branch:
runs-on: ubuntu-latest
steps:
- name: PRs should not target main
run: |
if [[ "${{ github.base_ref }}" == "main" ]]; then
echo 'Pull requests must not be made against main. Please target development instead.'
exit 1
fi
36 changes: 36 additions & 0 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "clang-tidy"

on: [pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
clang_tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get submodules
run: |
git submodule update --init
cd external/Microphysics
git fetch; git checkout development
echo "MICROPHYSICS_HOME=$(pwd)" >> $GITHUB_ENV
cd ../amrex
git fetch; git checkout development
echo "AMREX_HOME=$(pwd)" >> $GITHUB_ENV
cd ../..
- name: Install dependencies
run: |
.github/workflows/dependencies_clang-tidy-apt-llvm.sh 17
- name: Compile flame_wave
run: |
echo $AMREX_HOME
echo $MICROPHYSICS_HOME
cd Exec/science/subchandra
make USE_MPI=FALSE USE_CLANG_TIDY=TRUE CLANG_TIDY=clang-tidy-17 CLANG_TIDY_WARN_ERROR=TRUE -j 4
5 changes: 5 additions & 0 deletions .github/workflows/compiler-warnings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: "compiler warnings"

on: [pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
compiler_warnings:
runs-on: ubuntu-latest
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/dependencies_clang-tidy-apt-llvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -eu -o pipefail

# `man apt.conf`:
# Number of retries to perform. If this is non-zero APT will retry
# failed files the given number of times.
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries

if [[ ! -f /etc/apt/trusted.gpg.d/apt.llvm.org.asc ]]; then
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
fi

source /etc/os-release # set UBUNTU_CODENAME

sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME} main"
sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-$1 main"

sudo apt-get update

sudo apt-get install -y --no-install-recommends \
clang-tidy-$1 libomp-$1-dev
5 changes: 5 additions & 0 deletions .github/workflows/detonation-sdc-compare.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: detonation-sdc

on: [pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
detonation-sdc:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/flame_wave-compare.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: flame_wave

on: [pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
flame_wave-2d:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/gpu_action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: GPU compilation

on: [pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
gpu-compilation:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/wdmerger_collision-compare.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: wdmerger_collision

on: [pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
wdmerger_collision-2d:
runs-on: ubuntu-latest
Expand Down
17 changes: 17 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# 24.04

* Some clang-tidy fixes (#2779, #2780, #2781, #2784, #2786, #2787, #2790,
#2791, #2792, #2793, #2797, #2798, #2799, #2800, #2801, #2804)

* Fix species initialization in the Detonation problem (#2806)
and let it work with NSE (#2765)

* Sync up with AMReX changes (#2794)

* wdmerger now reports composition of initial stars (#2767)

* flame_wave now checks if the `atm_delta` is too small (#2782)
and stores X(ash) (#2773)

* a bounds issue in the true SDC integration was fixed (#2775)

# 24.03

* Documentation updates (#2742, #2752, #2753)
Expand Down
6 changes: 4 additions & 2 deletions Docs/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ Derived variables
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
| variable name | description | derive routine | units |
+===================================+===================================================+=============================+=========================================+
| ``abar`` | Mean atomic mass | ``derabar`` | :math:`\amu` |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
| ``angular_momentum_x``, | Angular momentum / volume in the x, y, or z dir | ``derangmomx``, | :math:`{\rm g~cm^{-1}~s^{-1}}` |
| ``angular_momentum_y``, | computed as :math:`[(\rho \ub) \times {\bf r}]_n` | ``derangmomy``, | |
| ``angular_momentum_z`` | where :math:`{\bf r}` is the distance from | ``derangmomz`` | |
Expand All @@ -328,6 +330,8 @@ Derived variables
| | :math:`s = s(\rho, e, X_k)`, where `e` is | | |
| | computed from :math:`(\rho e)` | | |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
| ``enuc`` | Nuclear energy generation rate / gram | ``derenuc`` | :math:`{\rm erg~g^{-1}~s^{-1}}` |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
| ``Ertot`` | Total radiation energy density | ``derertot`` | |
| | (for multigroup radiation problems) | | |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
Expand Down Expand Up @@ -391,8 +395,6 @@ Derived variables
| ``y_velocity``, | :math:`\ub = (\rho \ub)/\rho` | | |
| ``z_velocity`` | | | |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
| ``enuc`` | Nuclear energy generation rate / gram | ``derenuc`` | :math:`{\rm erg~g^{-1}~s^{-1}}` |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+

problem-specific plotfile variables
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion Exec/Make.Castro
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ include $(AMREX_HOME)/Tools/GNUMake/Make.rules
clean::
$(SILENT) $(RM) extern.F90 prob_params_auto.F90 extern_parameters.H extern_parameters_F.H extern_parameters.cpp
$(SILENT) $(RM) AMReX_buildInfo.cpp
$(SILENT) $(RM) $(CASTRO_AUTO_SOURCE_DIR)/*.H $(CASTRO_AUTO_SOURCE_DIR)/*.[fF]90
$(SILENT) $(RM) $(CASTRO_AUTO_SOURCE_DIR)/*.H $(CASTRO_AUTO_SOURCE_DIR)/*.[fF]90 $(CASTRO_AUTO_SOURCE_DIR)/*.cpp

# these files are now created directly in the CASTRO_AUTO_SOURCE_DIR so eventually we
# can get rid of explicitly removing them (this is for backwards compatibility)
Expand Down
2 changes: 2 additions & 0 deletions Exec/Make.auto_source
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ AUTO_BUILD_SOURCES += $(CASTRO_AUTO_SOURCE_DIR)/castro_params.H

CPP_PARAMETERS := $(TOP)/Source/driver/_cpp_parameters

$(CASTRO_AUTO_SOURCE_DIR)/runtime_params.cpp: $(CASTRO_AUTO_SOURCE_DIR)/castro_params.H

$(CASTRO_AUTO_SOURCE_DIR)/castro_params.H: $(CPP_PARAMETERS)
@if [ ! -d $(CASTRO_AUTO_SOURCE_DIR) ]; then mkdir -p $(CASTRO_AUTO_SOURCE_DIR); fi
PYTHONPATH=$(MICROPHYSICS_HOME)/util/build_scripts $(TOP)/Source/driver/parse_castro_params.py -o $(CASTRO_AUTO_SOURCE_DIR) $(CPP_PARAMETERS)
Expand Down
12 changes: 6 additions & 6 deletions Exec/hydro_tests/Sedov/problem_initialize.H
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ void problem_initialize ()
}
}

Real xn_zone[NumSpec];
for (int n = 0; n < NumSpec; ++n) {
xn_zone[n] = 0.0_rt;
}
Real xn_zone[NumSpec] = {0.0};
xn_zone[0] = 1.0_rt;

eos_t eos_state;
Expand Down Expand Up @@ -96,17 +93,20 @@ void problem_initialize ()
vctr = (4.0_rt / 3.0_rt) * M_PI * problem::r_init * problem::r_init * problem::r_init;

#else

amrex::Abort("Sedov problem unsupported in 3D axisymmetric geometry.");

#endif

}
else if (coord_type == 2) {


#if AMREX_SPACEDIM == 1
// Must have AMREX_SPACEDIM == 1 for this coord_type.

vctr = (4.0_rt / 3.0_rt) * M_PI * problem::r_init * problem::r_init * problem::r_init;
#else
amrex::Abort("Sedov problem unsupported in 2-D or 3-D spherical geometry.");
#endif

}

Expand Down
Loading

0 comments on commit 312d00c

Please sign in to comment.