Skip to content

Commit

Permalink
Merge branch 'development' into ppm_T
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Dec 1, 2023
2 parents 4a74df1 + 02a2d50 commit 2640678
Show file tree
Hide file tree
Showing 202 changed files with 122,713 additions and 52,966 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/check-makefiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: check makefiles

on:
push:
branches:
- development
- main
pull_request:
branches:
- development

jobs:
check-ifdefs:
runs-on: ubuntu-latest

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

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

- name: Cache pip
uses: actions/cache@v3
with:
# this path is specific to Ubuntu
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Run check-ifdefs
run: |
python .github/workflows/check_makefiles.py
46 changes: 46 additions & 0 deletions .github/workflows/check_makefiles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import re
import sys
from pathlib import Path

correct_params = {
"DEBUG": "FALSE",
"USE_MPI": "TRUE",
"USE_OMP": "FALSE",
"COMP": "gnu",
"USE_CUDA": "FALSE",
"USE_HIP": "FALSE",
"PRECISION": "DOUBLE",
"PROFILE": "FALSE"}


def find_source_files():
p = Path("./Exec")
files = list(p.glob(r"**/GNUmakefile"))
return files

def check_makefile(makefile):

with open(makefile) as mf:
for _line in mf:
if idx := _line.find("#") >= 0:
line = _line[:idx]
else:
line = _line

for key in correct_params:
if key in line:
try:
k, v = re.split(":=|\?=|=", line)
except ValueError:
sys.exit(f"invalid line: {line}")

if not v.strip() == correct_params[key]:
sys.exit(f"invalid param {key} in {makefile}")

if __name__ == "__main__":

for f in find_source_files():
check_makefile(f)



28 changes: 28 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
# 23.11

* Problem GNUmakefiles have been standardized and now allow for the
problem to be compiled elsewhere (#2640, #2641, #2642, #2643)

* The true-SDC Newton solver has been made more robust and faster
(#2586, #2602, #2605, #2606)

* Several problems that required the initial model grid spacing to
be specified in the inputs file now automatically compute it as
needed, including `flame_wave` (#2610), `convective_flame`,
`bubble_convergence`, and `hse_convergence` (#2624), `double_bubble`,
`gamma_law_bubble`, and `hse_convergence_general` (#2612)

* Outflow boundary conditions for the 4th order solver have been changed
to no longer use the one-sided stencil (#2607)

* The ca_rad_source hook in Fortran has been removed. The existing
problem_rad_source() hook in C++ can be used instead. (#2626)

* The compile option USE_AUX_UPDATE has been removed. If you want to
manually update the auxiliary parameters, you can use an external
source term or you can use the problem post-timestep hook. (#2614)

* The pressure is now always included in the x-momentum flux in 1-d
Cartesian, and this fixes an issue at jumps in refinement with the
pressure gradient (#2468)

* A bug was fixed in the 4th order diffusion operator that was introduced
when it was originally converted to C++ (#2592)

* The 2nd order Radau integrator had the wrong quadrature weights
(#2594)

# 23.10

* True-SDC no longer evolves density as part of the reaction system
Expand Down
2 changes: 1 addition & 1 deletion Diagnostics/DustCollapse/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Bpack := ./Make.package
Blocs := .
# EXTERN_SEARCH = .

CASTRO_HOME := ../..
CASTRO_HOME ?= ../..

INCLUDE_LOCATIONS += $(AMREX_HOME)/Src/Extern/amrdata
include $(AMREX_HOME)/Src/Extern/amrdata/Make.package
Expand Down
2 changes: 1 addition & 1 deletion Diagnostics/Radiation/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Bpack := ./Make.package
Blocs := .
# EXTERN_SEARCH = .

CASTRO_HOME := ../..
CASTRO_HOME ?= ../..

INCLUDE_LOCATIONS += $(AMREX_HOME)/Src/Extern/amrdata
include $(AMREX_HOME)/Src/Extern/amrdata/Make.package
Expand Down
2 changes: 1 addition & 1 deletion Diagnostics/Sedov/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Bpack := ./Make.package
Blocs := .
# EXTERN_SEARCH = .

CASTRO_HOME := ../..
CASTRO_HOME ?= ../..

#INCLUDE_LOCATIONS += $(AMREX_HOME)/Src/Extern/amrdata
#include $(AMREX_HOME)/Src/Extern/amrdata/Make.package
Expand Down
28 changes: 26 additions & 2 deletions Docs/source/reactions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,32 @@ in the inputs file. Reactions are enabled by setting::
the efficiency).

It is possible to set the maximum and minimum temperature and density for allowing
reactions to occur in a zone using the parameters ``castro.react_T_min``,
``castro.react_T_max``, ``castro.react_rho_min`` and ``castro.react_rho_max``.
reactions to occur in a zone using the parameters:

* ``castro.react_T_min`` and ``castro.react_T_max`` for temperature

* ``castro.react_rho_min`` and ``castro.react_rho_max`` for density

.. index:: castro.disable_shock_burning, USE_SHOCK_VAR

Burning can also be disabled inside shocks. This requires that the code be
compiled with::

USE_SHOCK_VAR = TRUE

in the ``GNUmakefile``. This will allocate storage for a shock flag in the conserved
state array. This flag is computed via a multidimensional shock detection algorithm
that looks for compression (:math:`\nabla \cdot \ub < 0`) along with a pressure jump
in the direction of compression. The runtime parameter::

castro.disable_shock_burning = 1

will skip reactions in a zone where we've detected a shock.

.. note::

Both the compilation with ``USE_SHOCK_VAR = TRUE`` and the runtime parameter
``castro.disable_shock_burning = 1`` are needed to turn off burning in shocks.

Reactions Flowchart
===================
Expand Down
12 changes: 10 additions & 2 deletions Exec/Make.Castro
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,19 @@ endif

# need to put any build suffices before Make.defs
ifeq ($(USE_SIMPLIFIED_SDC), TRUE)
USERSuffix = .SMPLSDC
ifneq ($(USERSuffix),)
USERSuffix := .SMPLSDC$(USERSuffix)
else
USERSuffix = .SMPLSDC
endif
endif

ifeq ($(USE_TRUE_SDC), TRUE)
USERSuffix = .TRUESDC
ifneq ($(USERSuffix),)
USERSuffix := .TRUESDC$(USERSuffix)
else
USERSuffix = .TRUESDC
endif
endif

USE_MLMG = FALSE
Expand Down
8 changes: 5 additions & 3 deletions Exec/gravity_tests/DustCollapse/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ USE_MHD = FALSE


# define the location of the CASTRO top directory
CASTRO_HOME := ../../..
CASTRO_HOME ?= ../../..

# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law
Expand All @@ -26,7 +26,9 @@ EOS_DIR := gamma_law
NETWORK_DIR := general_null
NETWORK_INPUTS = ignition.net

Bpack := ./Make.package
Blocs := .
PROBLEM_DIR ?= ./

Bpack := $(PROBLEM_DIR)/Make.package
Blocs := $(PROBLEM_DIR)

include $(CASTRO_HOME)/Exec/Make.Castro
8 changes: 5 additions & 3 deletions Exec/gravity_tests/StarGrav/GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CASTRO_HOME := ../../..
CASTRO_HOME ?= ../../..

PRECISION = DOUBLE
PROFILE = FALSE
Expand All @@ -23,7 +23,9 @@ EOS_DIR := helmholtz
NETWORK_DIR := general_null
NETWORK_INPUTS = ignition_wdconvect.net

Bpack := ./Make.package
Blocs := .
PROBLEM_DIR ?= ./

Bpack := $(PROBLEM_DIR)/Make.package
Blocs := $(PROBLEM_DIR)

include $(CASTRO_HOME)/Exec/Make.Castro
2 changes: 1 addition & 1 deletion Exec/gravity_tests/advecting_white_dwarf/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ NETWORK_DIR ?= general_null

NETWORK_INPUTS = ignition.net

PROBLEM_DIR ?= $(CASTRO_HOME)/Exec/gravity_tests/advecting_white_dwarf
PROBLEM_DIR ?= ./

Blocs = $(PROBLEM_DIR)
Bpack = $(PROBLEM_DIR)/Make.package
Expand Down
15 changes: 6 additions & 9 deletions Exec/gravity_tests/evrard_collapse/GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# Define the location of the CASTRO top directory,
# if not already defined by an environment variable.

CASTRO_HOME := ../../..

# Location of this directory. Useful if
# you're trying to compile this from another location.

TEST_DIR = $(CASTRO_HOME)/Exec/gravity_tests/evrard_collapse
CASTRO_HOME ?= ../../..

PRECISION = DOUBLE
PROFILE = FALSE
Expand All @@ -17,7 +12,7 @@ DIM = 3

COMP = gnu

USE_MPI = FALSE
USE_MPI = TRUE
USE_OMP = FALSE

USE_GRAV = TRUE
Expand All @@ -30,7 +25,9 @@ EOS_DIR := gamma_law
NETWORK_DIR := general_null
NETWORK_INPUTS = gammalaw.net

Bpack += $(TEST_DIR)/Make.package
Blocs += $(TEST_DIR)
PROBLEM_DIR ?= ./

Bpack += $(PROBLEM_DIR)/Make.package
Blocs += $(PROBLEM_DIR)

include $(CASTRO_HOME)/Exec/Make.Castro
8 changes: 5 additions & 3 deletions Exec/gravity_tests/hse_convergence/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ USE_MODEL_PARSER = TRUE

USE_MAESTRO_INIT = FALSE

CASTRO_HOME = ../../..
CASTRO_HOME ?= ../../..

# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
EOS_DIR := helmholtz
Expand All @@ -22,7 +22,9 @@ EOS_DIR := helmholtz
NETWORK_DIR := general_null
NETWORK_INPUTS := triple_alpha_plus_o.net

Bpack := ./Make.package
Blocs := .
PROBLEM_DIR ?= ./

Bpack := $(PROBLEM_DIR)/Make.package
Blocs := $(PROBLEM_DIR)

include $(CASTRO_HOME)/Exec/Make.Castro
2 changes: 0 additions & 2 deletions Exec/gravity_tests/hse_convergence/_prob_params
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

nx_model integer 128 y

dens_base real 1.0_rt y

temp_base real 1.0_rt y
Expand Down
2 changes: 0 additions & 2 deletions Exec/gravity_tests/hse_convergence/inputs.ppm.128
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,5 @@ amr.derive_plot_vars = ALL
problem.dens_base = 1.e7
problem.temp_base = 1.0e8

problem.nx_model = 128

# MICROPHYSICS
network.small_x = 1.e-10
2 changes: 0 additions & 2 deletions Exec/gravity_tests/hse_convergence/inputs.ppm.256
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,5 @@ amr.derive_plot_vars = ALL
problem.dens_base = 1.e7
problem.temp_base = 1.0e8

problem.nx_model = 256

# MICROPHYSICS
network.small_x = 1.e-10
2 changes: 0 additions & 2 deletions Exec/gravity_tests/hse_convergence/inputs.ppm.512
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,5 @@ amr.derive_plot_vars = ALL
problem.dens_base = 1.e7
problem.temp_base = 1.0e8

problem.nx_model = 512

# MICROPHYSICS
network.small_x = 1.e-10
2 changes: 0 additions & 2 deletions Exec/gravity_tests/hse_convergence/inputs.ppm.64
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,5 @@ amr.derive_plot_vars = ALL
problem.dens_base = 1.e7
problem.temp_base = 1.0e8

problem.nx_model = 64

# MICROPHYSICS
network.small_x = 1.e-10
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,5 @@ amr.derive_plot_vars = ALL
problem.dens_base = 1.e7
problem.temp_base = 1.0e8

problem.nx_model = 256

# MICROPHYSICS
network.small_x = 1.e-10
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,5 @@ amr.derive_plot_vars = ALL
problem.dens_base = 1.e7
problem.temp_base = 1.0e8

problem.nx_model = 256

# MICROPHYSICS
network.small_x = 1.e-10
12 changes: 11 additions & 1 deletion Exec/gravity_tests/hse_convergence/problem_initialize.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <model_parser.H>
#include <initial_model.H>
#include <network.H>
#include <global.H>

AMREX_INLINE
void problem_initialize ()
Expand Down Expand Up @@ -38,10 +39,19 @@ void problem_initialize ()

int nbuf = 8;

// we use the fine grid dx for the model resolution
auto fine_geom = global::the_amr_ptr->Geom(global::the_amr_ptr->maxLevel());

auto dx = fine_geom.CellSizeArray();
auto dx_model = dx[AMREX_SPACEDIM-1];

int nx_model = static_cast<int>((probhi[AMREX_SPACEDIM-1] -
problo[AMREX_SPACEDIM-1] + 1.e-8_rt) / dx_model);

// generate the initial model -- it will be stored in the model
// parser global data

generate_initial_model(problem::nx_model,
generate_initial_model(nx_model,
problo[AMREX_SPACEDIM-1], probhi[AMREX_SPACEDIM-1],
model_params, nbuf);

Expand Down
Loading

0 comments on commit 2640678

Please sign in to comment.