Skip to content

Commit

Permalink
Merge branch 'development' into add_cubic_interp
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Feb 10, 2024
2 parents 006ab3a + 80422fc commit ec24f0d
Show file tree
Hide file tree
Showing 96 changed files with 17,730 additions and 721 deletions.
7 changes: 6 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,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 @@ -17,11 +16,17 @@ 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,
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
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 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"
2 changes: 1 addition & 1 deletion .github/workflows/c-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
tar xfz v2.28.0.tar.gz
cd hypre-2.28.0/src
./configure --with-cxxstandard=17 --without-MPI
make -j 2
make -j 4
make install
cd ../../
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-ifdefs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: "pip"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/compiler-warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
- name: Compile Detonation
run: |
cd Exec/science/Detonation
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE -j 2
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE -j 4
- name: Compile subchandra
run: |
cd Exec/science/subchandra
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE -j 2
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE -j 4
- name: Compile wdmerger
run: |
cd Exec/science/wdmerger
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE -j 2
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE -j 4
4 changes: 2 additions & 2 deletions .github/workflows/detonation-sdc-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Compile Detonation
run: |
cd Exec/science/Detonation
make DIM=1 USE_MPI=FALSE -j 2 USE_SIMPLIFIED_SDC=TRUE
make DIM=1 USE_MPI=FALSE -j 4 USE_SIMPLIFIED_SDC=TRUE
- name: Run Detonation
run: |
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Build the fextrema tool
run: |
cd external/amrex/Tools/Plotfile
make programs=fextrema -j 2
make programs=fextrema -j 4
- name: Check the extrema
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/good_defines.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ AMREX_PARTICLES
AMREX_SPACEDIM
AMREX_USE_CUDA
AMREX_USE_GPU
AMREX_USE_HIP
AMREX_USE_OMP
AUX_THERMO
BL_FORT_USE_LOWERCASE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gpu_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
tar xfz v2.28.0.tar.gz
cd hypre-2.28.0/src
CUDA_HOME=/usr/local/cuda HYPRE_CUDA_SM=60 ./configure --with-cxxstandard=17 --with-cuda --enable-unified-memory --without-MPI
make -j 2
make -j 4
make install
cd ../../
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
- name: compile flame_wave
run: |
cd Exec/science/flame_wave
make COMP=gnu USE_HIP=TRUE USE_MPI=FALSE USE_OMP=FALSE USE_CUDA=FALSE -j 2
make COMP=gnu USE_HIP=TRUE USE_MPI=FALSE USE_OMP=FALSE USE_CUDA=FALSE -j 4
4 changes: 2 additions & 2 deletions .github/workflows/mhd-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Compile OrszagTang
run: |
cd Exec/mhd_tests/OrszagTang
make USE_MPI=TRUE -j 2
make USE_MPI=TRUE -j 4
- name: Run OrszagTang-3d
run: |
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Build the fextrema tool
run: |
cd external/amrex/Tools/Plotfile
make programs=fextrema -j 2
make programs=fextrema -j 4
- name: Check the extrema
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rad-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
tar xfz v2.26.0.tar.gz
cd hypre-2.26.0/src
./configure --with-cxxstandard=17
make -j 2
make -j 4
make install
cd ../../
Expand All @@ -47,7 +47,7 @@ jobs:
- name: Build the fextrema tool
run: |
cd external/amrex/Tools/Plotfile
make programs=fextrema -j 2
make programs=fextrema -j 4
- name: Check the extrema
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reacting-convergence-true-sdc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Compile reacting_convergence
run: |
cd Exec/reacting_tests/reacting_convergence
make DIM=2 USE_MPI=FALSE -j 2 USE_TRUE_SDC=TRUE
make DIM=2 USE_MPI=FALSE -j 4 USE_TRUE_SDC=TRUE
- name: Run reacting_convergence
run: |
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Build the fextrema tool
run: |
cd external/amrex/Tools/Plotfile
make programs=fextrema -j 2
make programs=fextrema -j 4
- name: Check the extrema
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/uniform_cube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Compile uniform_cube
run: |
cd Exec/gravity_tests/uniform_cube
make USE_MPI=FALSE -j 2
make USE_MPI=FALSE -j 4
- name: Run uniform_cube
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/uniform_sphere.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Compile uniform_sphere
run: |
cd Exec/gravity_tests/uniform_sphere
make USE_MPI=FALSE -j 2
make USE_MPI=FALSE -j 4
- name: Run uniform_sphere
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.02

* Lot's of code fixes from coverity and clang-tidy (#2736, #2734,
#2735, #2731, #2732, #2733)

* Fix the boundary condition logic at a wall for Detonation (#2722)

* Reimplement the shock detection algorithm to account for sources
and do a better job in multidimensions (#2711, #2710, #2709, #2704)

* Start the process of moving the runtime parameters to structs (#2688)

# 24.01

* An option for unlimited PPM reconstruction was added (#2670)
Expand Down
38 changes: 19 additions & 19 deletions Diagnostics/DustCollapse/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ int main(int argc, char* argv[])
#if (AMREX_SPACEDIM == 1)
int nbins = domain.length(0);
#elif (AMREX_SPACEDIM == 2)
auto x_maxdist = fmax(fabs(problo[0]), fabs(probhi[0]));
auto y_maxdist = fmax(fabs(problo[1] - yctr), fabs(probhi[1] - yctr));
auto x_maxdist = std::max(std::abs(problo[0]), std::abs(probhi[0]));
auto y_maxdist = std::max(std::abs(problo[1] - yctr), std::abs(probhi[1] - yctr));

auto max_dist = sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist);
auto max_dist = std::sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist);

int nbins = int(max_dist / dx_fine);
#else
auto x_maxdist = fmax(fabs(problo[0] - xctr), fabs(probhi[0] - xctr));
auto y_maxdist = fmax(fabs(problo[1] - yctr), fabs(probhi[1] - yctr));
auto z_maxdist = fmax(fabs(problo[2] - zctr), fabs(probhi[2] - zctr));
auto x_maxdist = std::max(std::abs(problo[0] - xctr), std::abs(probhi[0] - xctr));
auto y_maxdist = std::max(std::abs(problo[1] - yctr), std::abs(probhi[1] - yctr));
auto z_maxdist = std::max(std::abs(problo[2] - zctr), std::abs(probhi[2] - zctr));

auto max_dist = sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist +
auto max_dist = std::sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist +
z_maxdist*z_maxdist);

int nbins = int(max_dist / dx_fine);
Expand Down Expand Up @@ -147,7 +147,7 @@ int main(int argc, char* argv[])
// over levels, we will compare to the finest level index space to
// determine if we've already output here
int mask_size = domain.length().max();
Vector<int> imask(pow(mask_size, AMREX_SPACEDIM), 1);
Vector<int> imask(std::pow(mask_size, AMREX_SPACEDIM), 1);

// counter
int cnt = 0;
Expand All @@ -172,17 +172,17 @@ int main(int argc, char* argv[])
const Box& bx = mfi.tilebox();

#if (AMREX_SPACEDIM == 1)
fdustcollapse1d(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
fdustcollapse1d(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
nbins, dens.dataPtr(),
imask.dataPtr(), mask_size, r1, dens_comp, &cnt);
#elif (AMREX_SPACEDIM == 2)

fdustcollapse2d(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
fdustcollapse2d(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
nbins, dens.dataPtr(), volcount.dataPtr(),
imask.dataPtr(), mask_size, r1,
ZFILL(level_dx), dx_fine, yctr, dens_comp);
AMREX_ZFILL(level_dx), dx_fine, yctr, dens_comp);
#else
fdustcollapse3d(bx.loVect(), bx.hiVect(),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
Expand Down Expand Up @@ -210,21 +210,21 @@ int main(int argc, char* argv[])
// analytic expression for the radius as a function of time t = 0.00
Real max_dens = 1.e9;

if (fabs(data.Time()) <= 1.e-8)
if (std::abs(data.Time()) <= 1.e-8)
max_dens = 1.e9;
else if (fabs(data.Time() - 0.01) <= 1.e-8)
else if (std::abs(data.Time() - 0.01) <= 1.e-8)
max_dens = 1.043345e9;
else if (fabs(data.Time() - 0.02) <= 1.e-8)
else if (std::abs(data.Time() - 0.02) <= 1.e-8)
max_dens = 1.192524e9;
else if (fabs(data.Time() - 0.03) <= 1.e-8)
else if (std::abs(data.Time() - 0.03) <= 1.e-8)
max_dens = 1.527201e9;
else if (fabs(data.Time() - 0.04) <= 1.e-8)
else if (std::abs(data.Time() - 0.04) <= 1.e-8)
max_dens = 2.312884e9;
else if (fabs(data.Time() - 0.05) <= 1.e-8)
else if (std::abs(data.Time() - 0.05) <= 1.e-8)
max_dens = 4.779133e9;
else if (fabs(data.Time() - 0.06) <= 1.e-8)
else if (std::abs(data.Time() - 0.06) <= 1.e-8)
max_dens = 24.472425e9;
else if (fabs(data.Time() - 0.065) <= 1.e-8)
else if (std::abs(data.Time() - 0.065) <= 1.e-8)
max_dens = 423.447291e9;
else {
Print() << "Dont know the maximum density at this time: " << data.Time() <<std::endl;
Expand Down
2 changes: 1 addition & 1 deletion Diagnostics/Radiation/Radiation_utils.H
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void WriteSlicefile(const int nbins, const Vector<Real> r,
slicefile << std::setw(w) << r[i];

for (auto it=vars.begin(); it!=vars.end(); ++it) {
if(fabs((*it)[i]) < SMALL) (*it)[i] = 0.0;
if(std::abs((*it)[i]) < SMALL) (*it)[i] = 0.0;
slicefile << std::setw(w) << (*it)[i];
}

Expand Down
12 changes: 6 additions & 6 deletions Diagnostics/Radiation/gaussian_pulse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ int main(int argc, char* argv[])

// compute the size of the radially-binned array -- we'll do it to
// the furtherest corner of the domain
double x_maxdist = max(fabs(probhi[0] - xctr), fabs(problo[0] - xctr));
double y_maxdist = max(fabs(probhi[1] - yctr), fabs(problo[1] - yctr));
double maxdist = sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist);
double x_maxdist = std::max(std::abs(probhi[0] - xctr), std::abs(problo[0] - xctr));
double y_maxdist = std::max(std::abs(probhi[1] - yctr), std::abs(problo[1] - yctr));
double maxdist = std::sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist);

double dx_fine = *(std::min_element(dx.begin(), dx.end()));

Expand Down Expand Up @@ -102,7 +102,7 @@ int main(int argc, char* argv[])
// over levels, we will compare to the finest level index space to
// determine if we've already output here
int mask_size = domain.length().max();
Vector<int> imask(pow(mask_size, AMREX_SPACEDIM), 1);
Vector<int> imask(std::pow(mask_size, AMREX_SPACEDIM), 1);

// loop over the data, starting at the finest grid, and if we haven't
// already stored data in that grid location (according to imask),
Expand All @@ -123,11 +123,11 @@ int main(int argc, char* argv[])
for (MFIter mfi(lev_data_mf, true); mfi.isValid(); ++mfi) {
const Box& bx = mfi.tilebox();

fgaussian_pulse(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
fgaussian_pulse(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
nbins, rad_bin.dataPtr(), ncount.dataPtr(),
imask.dataPtr(), mask_size, r1,
rad_comp, ZFILL(dx), dx_fine, xctr, yctr);
rad_comp, AMREX_ZFILL(dx), dx_fine, xctr, yctr);

}

Expand Down
8 changes: 4 additions & 4 deletions Diagnostics/Radiation/lgt_frnt1d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main(int argc, char* argv[])

// compute the size of the radially-binned array -- we'll do it to
// the furtherest corner of the domain
double maxdist = fabs(probhi[0] - problo[0]);
double maxdist = std::abs(probhi[0] - problo[0]);
double dx_fine = *(std::min_element(dx.begin(), dx.end()));
int nbins = int(maxdist / dx_fine);

Expand Down Expand Up @@ -93,7 +93,7 @@ int main(int argc, char* argv[])
// over levels, we will compare to the finest level index space to
// determine if we've already output here
int mask_size = domain.length().max();
Vector<int> imask(pow(mask_size, AMREX_SPACEDIM), 1);
Vector<int> imask(std::pow(mask_size, AMREX_SPACEDIM), 1);

// loop over the data, starting at the finest grid, and if we haven't
// already stored data in that grid location (according to imask),
Expand All @@ -114,13 +114,13 @@ int main(int argc, char* argv[])
for (MFIter mfi(lev_data_mf, true); mfi.isValid(); ++mfi) {
const Box& bx = mfi.tilebox();

flgt_frnt1d(ARLIM_3D(bx.loVect()), ARLIM_3D(bx.hiVect()),
flgt_frnt1d(AMREX_ARLIM_3D(bx.loVect()), AMREX_ARLIM_3D(bx.hiVect()),
BL_TO_FORTRAN_FAB(lev_data_mf[mfi]),
nbins, dens_bin.dataPtr(), vel_bin.dataPtr(),
pres_bin.dataPtr(), rad_bin.dataPtr(),
imask.dataPtr(), mask_size, r1,
dens_comp, xmom_comp, pres_comp, rad_comp,
ZFILL(dx), dx_fine);
AMREX_ZFILL(dx), dx_fine);
}

// adjust r1 for the next lowest level
Expand Down
Loading

0 comments on commit ec24f0d

Please sign in to comment.