Skip to content

Commit

Permalink
Merge branch 'development' into exact_riemann_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Sep 3, 2024
2 parents 6f6083b + a79e5b0 commit f940f16
Show file tree
Hide file tree
Showing 45 changed files with 609 additions and 313 deletions.
49 changes: 49 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
# 24.09

* Code clean-ups / clang-tidy (#2942, #2949)

* update the `hse_convergence` readme to reflect current convergence
(#2946)

* update the `bubble_convergence` plotting script (#2947)

* new Frontier scaling numbers (#2948)

* more GPU error printing (@3944)

* science problem updates: `flame_wave` (#2943)

* documentation updates (#2939)

# 24.08

* lazy QueueReduction has been enabled for the timing diagnostics
(#2926)

* The `job_info` file output now correctly labels the compute time
as GPU-hours instead of CPU-hours when running on GPUs (#2930)

* We can now output warnings when running on GPUs if you build
with `USE_GPU_PRINTF=TRUE`(#2923, #2928)

* Code clean-ups / sync with Microphysics (#2900, #2901, #2905,
#2906, #2909, #2912, #2919, #2922, #2932, #2933, #2936, #2938,
#2940)

* The area weighting in the diagnostics in `subch_planar` was fixed
(#2885)

* A script to produce a resolution study for the `circular_det`
problem was added (#2857)

* science problem updates: `xrb_layered` (#2917), `nova` (#2913),
`wdmerger` (#2907, #2918, #2931), `Detonation` (#2902)

* updated scaling results on Frontier (#2904, #2914, #2915)

* more exact Riemann solver clean-up (#2896, #2897, #2898)
and clean-ups to the two shock solvers (#2895)

* fix issues with eigenvectors and clang-tidy in the MHD solver
(#2880)

# 24.07

* Reorganizing of the existing 2-shock and HLL Riemann solvers
Expand Down
49 changes: 32 additions & 17 deletions Docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,46 @@ Compiling
There are 2 things you can do to check what’s happening. First, inspect
the directories in ``VPATH_LOCATIONS``. This can be done via:

::
.. prompt:: bash

make print-VPATH_LOCATIONS
make print-VPATH_LOCATIONS

Next, ask make to tell you where it is finding each of the source
files. This is done through a script ``find_files_vpath.py``
that is hooked into Castro’s build system. You can run this as:

::
.. prompt:: bash

make file_locations
make file_locations

At the end of the report, it will list any files it cannot find in
the vpath. Some of these are to be expected (like ``extern.f90``
and ``buildInfo.cpp``—these are written at compile-time. But any
other missing files need to be investigated.
the vpath. Some of these are to be expected (like
``buildInfo.cpp``—these are written at compile-time). But any other
missing files need to be investigated.

#. *I put a copy of one of the header files (e.g. ``problem_tagging.H``)
in my problem setup but it does not seem to recognized / used by
the build system. Why doesn't my executable use my custom version
of the header?*

This is likely due to compiler caching / ccache. You need to
clear the cache and the build:

.. prompt:: bash

ccache -C
make clean

Then rebuild and it should be recognized.

#. *I’m still having trouble compiling. How can I find out what
all of the make variables are set to?*

Use:

::
.. prompt:: bash

make help
make help

This will tell you the value of all the compilers and their options.

Expand Down Expand Up @@ -104,7 +119,7 @@ Debugging

Given a MultiFab ``mf``, you can dump out the state as:

::
.. code:: c++

print_state(mf, IntVect(AMREX_D_DECL(10, 20, 30)));

Expand All @@ -119,7 +134,7 @@ Debugging
You can simply output a FAB to ``std::cout``. Imagine that you
are in an MFIter loop, with a MultiFab ``mf``:

::
.. code:: c++

S = FArrayBox& mf[mfi];
std::cout << S << std::endl;
Expand All @@ -143,9 +158,9 @@ Profiling
When you run, a file named ``gmon.out`` will be produced. This can
be processed with gprof by running:

::
.. prompt:: bash

gprof exec-name
gprof exec-name

where *exec-name* is the name of the executable. More detailed
line-by-line information can be obtained by passing the -l
Expand All @@ -159,9 +174,9 @@ Managing Runs

Create a file called ``dump_and_continue``, e.g., as:

::
.. prompt:: bash

touch dump_and_continue
touch dump_and_continue

This will force the code to output a checkpoint file that can be used
to restart. Other options are ``plot_and_continue`` to output
Expand Down Expand Up @@ -193,9 +208,9 @@ Managing Runs

The build information (including git hashes, modules, EoS, network, etc.) can be displayed by running the executable as

::
.. prompt:: bash

./Castro.exe --describe
./Castro.exe --describe

.. _ch:faq:vis:

Expand Down
3 changes: 3 additions & 0 deletions Exec/Make.Castro
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ endif
# Require C++17
CXXSTD := c++17

# Use Lazy QueueReduction for the timing outputs
LAZY := TRUE

# default integrator
INTEGRATOR_DIR ?= VODE

Expand Down
31 changes: 18 additions & 13 deletions Exec/gravity_tests/hse_convergence/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,34 @@ in the plotfiles.

To run this problem, use one of the convergence scripts:

* ``convergence_plm.sh`` :
* `convergence_plm.sh` :

this runs CTU + PLM using the default HSE BCs and default
use_pslope, then with reflect BCs, then without use_pslope, and
finally runs with reflect instead of HSE BCs.
this runs CTU + PLM using:
1. the default HSE BCs and `use_pslope`
2. the HSE BCs with reflection and `use_pslope`
3. reflect BCs instead of HSE BCs without `use_pslope`
4. reflect BCs with `use_pslope`

These tests show that the best results come from HSE BCs + reflect vel
These tests show that the best results (by far) come from
`use_pslope=1` and reflecting BCs

* convergence_ppm.sh :

this runs CTU + PPM in a similar set of configurations as PLM above
(with one additional one: grav_source_type = 4)
1. the default HSE BCs
2. HSE BCs with reflection
3. reflecting BCs
4. reflecting BCs with `use_pslope`

These tests show that the best results come from HSE BCs + reflect vel
These tests show that the best results (by far) come from
reflecting BCs with `use_pslope=1`, just like the PLM case.

* convergence_sdc.sh :

this uses the TRUE_SDC integration, first with SDC-2 + PLM and reflecting BCs,
the SDC-2 + PPM and reflecting BCs, then the same but HSE BCs, and finally
SDC-4 + reflect
this uses the TRUE_SDC integration, first with SDC-2 + PLM and
reflecting BCs, the SDC-2 + PPM and reflecting BCs, then the same
but HSE BCs, and finally SDC-4 + reflect

These tests show that the PLM + reflect (which uses the
well-balanced use_pslope) and the SDC-4 + reflect give the lowest
errors and expected (or better) convergence:


errors and expected (or better) convergence.
41 changes: 6 additions & 35 deletions Exec/gravity_tests/hse_convergence/convergence_plm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,43 +58,15 @@ pfile=`ls -t | grep -i hse_512_plt | head -1`
fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile}


## plm + hse reflect + no pslope

ofile=plm-hsereflect-nopslope.converge.out

RUNPARAMS="
castro.ppm_type=0
castro.use_pslope=0
castro.hse_interp_temp=1
castro.hse_reflect_vels=1
"""

${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out
pfile=`ls -t | grep -i hse_64_plt | head -1`
fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile}

${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out
pfile=`ls -t | grep -i hse_128_plt | head -1`
fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile}

${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out
pfile=`ls -t | grep -i hse_256_plt | head -1`
fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile}

${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out
pfile=`ls -t | grep -i hse_512_plt | head -1`
fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile}


## plm + reflect
## plm + reflect + nopslope

ofile=plm-reflect.converge.out
ofile=plm-reflect-nopslope.converge.out

RUNPARAMS="
castro.ppm_type=0
castro.use_pslope=1
castro.lo_bc=3
castro.hi_bc=3
castro.use_pslope=0
"""

${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out
Expand All @@ -114,16 +86,15 @@ pfile=`ls -t | grep -i hse_512_plt | head -1`
fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile}


## plm + reflect + pslope

## plm + reflect + nopslope

ofile=plm-reflect-nopslope.converge.out
ofile=plm-reflect-pslope.converge.out

RUNPARAMS="
castro.ppm_type=0
castro.lo_bc=3
castro.hi_bc=3
castro.use_pslope=0
castro.use_pslope=1
"""

${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out
Expand Down
12 changes: 7 additions & 5 deletions Exec/gravity_tests/hse_convergence/convergence_ppm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ pfile=`ls -t | grep -i hse_512_plt | head -1`
fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile}


## ppm + grav_source_type = 4
## ppm + reflect

ofile=ppm-grav4.converge.out
ofile=ppm-reflect.converge.out

RUNPARAMS="
castro.grav_source_type=4
castro.lo_bc=3
castro.hi_bc=3
"""

${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out
Expand All @@ -75,13 +76,14 @@ pfile=`ls -t | grep -i hse_512_plt | head -1`
fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile}


## ppm + reflect
## ppm + reflect + pslope

ofile=ppm-reflect.converge.out
ofile=ppm-reflect-pslope.converge.out

RUNPARAMS="
castro.lo_bc=3
castro.hi_bc=3
castro.use_pslope=1
"""

${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out
Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/Noh/problem_bc_fill.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void problem_bc_fill(int i, int j, int k,

eos_t zone_state;
zone_state.rho = rho_init * std::pow(1.0_rt + time / r, AMREX_SPACEDIM - 1);
zone_state.p = pres_init * std::pow(zone_state.rho / rho_init, 1.0_rt + eos_gamma);
zone_state.p = pres_init * std::pow(zone_state.rho / rho_init, 1.0_rt + eos_rp::eos_gamma);
for (int n = 0; n < NumSpec; ++n) {
zone_state.xn[n] = 1.0_rt / static_cast<Real>(NumSpec);
}
Expand Down
8 changes: 4 additions & 4 deletions Exec/hydro_tests/RT/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ void problem_initialize_state_data (int i, int j, int k,

if (r[AMREX_SPACEDIM-1] < problem::split[AMREX_SPACEDIM-1]) {
Real pres = problem::p0_base - problem::rho_1 * r[AMREX_SPACEDIM-1];
state(i,j,k,UEDEN) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEDEN) = pres / (eos_rp::eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_rp::eos_gamma - 1.0_rt);
} else {
Real pres = presmid - problem::rho_2 *
(r[AMREX_SPACEDIM-1] - problem::split[AMREX_SPACEDIM-1]);
state(i,j,k,UEDEN) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEDEN) = pres / (eos_rp::eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_rp::eos_gamma - 1.0_rt);
}

Real pertheight;
Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/Vortices_LWAcoustics/problem_initialize.H
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ void problem_initialize ()

// Define rho_0

problem::rho_0 = std::pow(problem::p_ref, 1.0_rt/eos_gamma);
problem::rho_0 = std::pow(problem::p_ref, 1.0_rt/eos_rp::eos_gamma);

// Define c_0

problem::c_0 = std::sqrt(eos_gamma * problem::p_ref / problem::rho_0);
problem::c_0 = std::sqrt(eos_rp::eos_gamma * problem::p_ref / problem::rho_0);

// Define r_c, radius of each vortex

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void problem_initialize_state_data (int i, int j, int k,

// internal energy

state(i,j,k,UEINT) = problem::p_ref / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = problem::p_ref / (eos_rp::eos_gamma - 1.0_rt);

// Total energy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ void problem_initialize_state_data (int i, int j, int k,
state(i,j,k,UMZ) = 0.0_rt;

// we are isentropic, so p = (dens/rho0)**Gamma_1
Real p = std::pow(state(i,j,k,URHO) / problem::rho0, eos_gamma);
Real eint = p / (eos_gamma - 1.0_rt);
Real p = std::pow(state(i,j,k,URHO) / problem::rho0, eos_rp::eos_gamma);
Real eint = p / (eos_rp::eos_gamma - 1.0_rt);

state(i,j,k,UEDEN) = eint;
state(i,j,k,UEINT) = eint;
Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/gamma_law_bubble/Problem_Derive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ void ca_derrhopert(const Box& bx, FArrayBox& derfab, int dcomp, int /*ncomp*/,
if (problem::do_isentropic) {
Real z = static_cast<Real>(j) * dx[AMREX_SPACEDIM-1];
density[j] = problem::dens_base *
std::pow((gravity::const_grav * problem::dens_base * (eos_gamma - 1.0_rt) * z/
(eos_gamma * problem::pres_base) + 1.0_rt), 1.0_rt/(eos_gamma - 1.0_rt));
std::pow((gravity::const_grav * problem::dens_base * (eos_rp::eos_gamma - 1.0_rt) * z/
(eos_rp::eos_gamma * problem::pres_base) + 1.0_rt), 1.0_rt/(eos_rp::eos_gamma - 1.0_rt));
} else {
Real z = (static_cast<Real>(j) + 0.5_rt) * dx[AMREX_SPACEDIM-1];
density[j] = problem::dens_base * std::exp(-z/H);
Expand Down
Loading

0 comments on commit f940f16

Please sign in to comment.