Skip to content

Commit

Permalink
Replace Castro microphysics with starkiller-astro Microphysics (#760)
Browse files Browse the repository at this point in the history
This implements the Microphysics part of #651. We replace the local Castro Microphysics directory with a dependence on the main starkiller-astro Microphysics directory. This means that obtaining Microphysics is now a requirement for using Castro. If the user sets MICROPHYSICS_HOME as before, then their workflow does not change. A new path is that Microphysics is a git submodule of Castro, so if the user does git submodule update --init --recursive then they will obtain the version of Microphysics that we specify in the repo, and if they do not have MICROPHYSICS_HOME set then this submodule will be used. The repo is now updated with git pull --recurse-submodules, so that updates to Microphysics come along when you pull.

A minor associated change is that we've standardized on NETWORK_INPUTS in all of the makefiles, instead of using GENERAL_NET_INPUTS with the hardcoded path.
  • Loading branch information
maxpkatz committed Feb 11, 2020
1 parent 58771cb commit f08a875
Show file tree
Hide file tree
Showing 109 changed files with 186 additions and 3,435 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Microphysics"]
path = Microphysics
url = https://github.com/starkiller-astro/Microphysics.git
21 changes: 21 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# 20.03

* We have updated our workflow when it comes to Castro's microphysics.
Previously Castro shipped with it a minimal set of microphysics that
allowed basic problem setups like Sedov to compile, and more advanced
setups (like ones that include nuclear burning) required downloading
the starkiller-astro Microphysics repository as an additional step.
Now, that Microphysics repository is a requirement for using Castro.
If you are a current user of the Microphysics repository and prefer
the current workflow where you maintain Microphysics as a separate
installation from Castro, no change in your workflow is necessary:
if MICROPHYSICS_HOME is set as an environment variable, Castro will
use the Microphysics installation in that directory. However we have
also added Microphysics as a git submodule to Castro, which is now
the required path if you previously were not using the more advanced
microphysics (but is also a possibility for those previously using a
standalone Microphysics installation). To obtain this, you can use
git submodule update --init --recursive from the top-level directory
of Castro. The developer team ensures that the version of Microphysics
that you obtain this way is consistent with the current version of Castro.
Then, you can keep up to date with the code mostly as normal, except now
using git pull --recurse-submodules instead of git pull. (#760)

* The names of the conserved state variables in C++ (Density, Xmom, etc.)
have been changed to match the names in Fortran (URHO, UMX, etc.).
For user code, this will only affect problem-specific setup code
Expand Down
63 changes: 27 additions & 36 deletions Exec/Make.Castro
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@ BLAS_LIBRARY ?= -lopenblas

TOP := $(CASTRO_HOME)

MICROPHYSICS_HOME ?= $(TOP)/Microphysics

# Check to make sure that Microphysics actually exists,
# using an arbitrary file that must exist to check.
# Throw an error if we don't have Microphysics.
ifeq ("$(wildcard $(MICROPHYSICS_HOME)/Make.Microphysics)","")
$(error Microphysics has not been downloaded. Please run "git submodule update --init" from the top level of the code)
endif

# the Castro microphysics locations
EOS_HOME ?= $(TOP)/Microphysics/EOS
NETWORK_HOME ?= $(TOP)/Microphysics/networks
COND_HOME ?= $(TOP)/Microphysics/conductivity
VISC_HOME ?= $(TOP)/Microphysics/viscosity
EOS_HOME ?= $(MICROPHYSICS_HOME)/EOS
NETWORK_HOME ?= $(MICROPHYSICS_HOME)/networks
COND_HOME ?= $(MICROPHYSICS_HOME)/conductivity
VISC_HOME ?= $(MICROPHYSICS_HOME)/viscosity

# default integrator
INTEGRATOR_DIR ?= VODE90
Expand Down Expand Up @@ -163,6 +172,8 @@ ifeq ($(USE_DIFFUSION), TRUE)
Bdirs += Source/diffusion
DEFINES += -DDIFFUSION
USE_MLMG = TRUE
USE_CONDUCTIVITY = TRUE
USE_VISCOSITY = TRUE
endif

ifeq ($(USE_HYBRID_MOMENTUM), TRUE)
Expand Down Expand Up @@ -257,29 +268,10 @@ Bpack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package)
# microphysics
#------------------------------------------------------------------------------

ifdef MICROPHYSICS_HOME
EOS_PATH := $(MICROPHYSICS_HOME)/EOS/$(strip $(EOS_DIR))
NETWORK_PATH := $(MICROPHYSICS_HOME)/networks/$(strip $(NETWORK_DIR))
EOS_PATH := $(MICROPHYSICS_HOME)/EOS/$(strip $(EOS_DIR))
NETWORK_PATH := $(MICROPHYSICS_HOME)/networks/$(strip $(NETWORK_DIR))
ifeq ($(USE_DIFFUSION), TRUE)
COND_PATH := $(MICROPHYSICS_HOME)/conductivity/$(strip $(CONDUCTIVITY_DIR))
endif
endif

# if the EOS / network / conductivity name exists in
# Castro/Microphysics, then use that version

ifneq "$(wildcard $(EOS_HOME)/$(strip $(EOS_DIR)) )" ""
EOS_PATH := $(EOS_HOME)/$(strip $(EOS_DIR))
endif

ifneq "$(wildcard $(NETWORK_HOME)/$(strip $(NETWORK_DIR)) )" ""
NETWORK_PATH := $(NETWORK_HOME)/$(strip $(NETWORK_DIR))
endif

ifeq ($(USE_DIFFUSION), TRUE)
ifneq "$(wildcard $(COND_HOME)/$(strip $(CONDUCTIVITY_DIR)) )" ""
COND_PATH := $(COND_HOME)/$(strip $(CONDUCTIVITY_DIR))
endif
VISC_PATH := $(VISC_HOME)/constant
endif

Expand All @@ -290,7 +282,7 @@ ifndef GENERAL_NET_INPUTS
ifneq "$(wildcard $(NETWORK_INPUTS))" ""
GENERAL_NET_INPUTS := $(NETWORK_INPUTS)
else
GENERAL_NET_INPUTS := $(CASTRO_HOME)/Microphysics/networks/general_null/$(NETWORK_INPUTS)
GENERAL_NET_INPUTS := $(MICROPHYSICS_HOME)/networks/general_null/$(NETWORK_INPUTS)
endif
endif

Expand All @@ -313,23 +305,24 @@ EXTERN_CORE += $(NETWORK_PATH)
# Network includes since it has actions that depend on variables set
# there.

ifdef MICROPHYSICS_HOME
EXTERN_CORE += $(MICROPHYSICS_HOME)/EOS
EXTERN_CORE += $(MICROPHYSICS_HOME)/networks
endif
EXTERN_CORE += $(MICROPHYSICS_HOME)/EOS
EXTERN_CORE += $(MICROPHYSICS_HOME)/networks
EXTERN_CORE += $(MICROPHYSICS_HOME)/interfaces

ifeq ($(USE_DIFFUSION), TRUE)
EXTERN_CORE += $(TOP)/Microphysics/conductivity
ifeq ($(USE_CONDUCTIVITY), TRUE)
EXTERN_CORE += $(COND_HOME)
EXTERN_CORE += $(COND_PATH)
endif

ifeq ($(USE_VISCOSITY), TRUE)
EXTERN_CORE += $(VISC_PATH)
endif

ifeq ($(USE_RAD), TRUE)
ifeq ($(Opacity_dir), null)
$(error The null opacity directory has been removed, please update to rad_power_law)
endif
OPAC_PATH := $(TOP)/Microphysics/opacity/$(Opacity_dir)
OPAC_PATH := $(MICROPHYSICS_HOME)/opacity/$(Opacity_dir)
EXTERN_CORE += $(OPAC_PATH)
endif

Expand Down Expand Up @@ -408,9 +401,7 @@ EXTERN_TEMPLATE := $(TOP)/Source/driver/extern_probin.template

# these are for finding runtime parameters
EXTERN_SEARCH += $(EXTERN_CORE) $(TOP)/constants $(TOP)/Util/model_parser $(TOP)/Util/conservative_interpolate
ifdef MICROPHYSICS_HOME
EXTERN_SEARCH += $(MICROPHYSICS_HOME)/networks/
endif
EXTERN_SEARCH += $(MICROPHYSICS_HOME)/networks/

EXTERN_PARAMETERS := $(shell $(AMREX_HOME)/Tools/F_scripts/findparams.py $(EXTERN_SEARCH))

Expand Down
6 changes: 3 additions & 3 deletions Exec/gravity_tests/DustCollapse/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ GPU_COMPATIBLE_PROBLEM = TRUE
# define the location of the CASTRO top directory
CASTRO_HOME := ../../..

# This sets the EOS directory in $(CASTRO_HOME)/EOS
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the EOS directory in $(CASTRO_HOME)/Networks
# This sets the EOS directory in $(MICROPHYSICS_HOME)/Networks
NETWORK_DIR := general_null
GENERAL_NET_INPUTS = $(CASTRO_HOME)/Microphysics/networks/$(NETWORK_DIR)/ignition.net
NETWORK_INPUTS = ignition.net

Bpack := ./Make.package
Blocs := .
Expand Down
10 changes: 1 addition & 9 deletions Exec/gravity_tests/StarGrav/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,12 @@ USE_REACT = FALSE

USE_PROB_PARAMS = TRUE

ifdef MICROPHYSICS_HOME

# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
EOS_DIR := helmholtz

# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
GENERAL_NET_INPUTS = $(MICROPHYSICS_HOME)/networks/$(NETWORK_DIR)/ignition_wdconvect.net

else

$(error Error: This problem requires the Microphysics repository. Please ensure that you have downloaded it and set $$MICROPHYSICS_HOME appropriately)

endif
NETWORK_INPUTS = ignition_wdconvect.net

Bpack := ./Make.package
Blocs := .
Expand Down
10 changes: 1 addition & 9 deletions Exec/gravity_tests/code_comp/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,12 @@ GPU_COMPATIBLE_PROBLEM = TRUE

USE_PROB_PARAMS = TRUE

ifdef MICROPHYSICS_HOME

# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
EOS_DIR := gamma_law_general

# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
GENERAL_NET_INPUTS = simple.net

else

$(error Error: This problem requires the Microphysics repository. Please ensure that you have downloaded it and set $$MICROPHYSICS_HOME appropriately)

endif
NETWORK_INPUTS = simple.net

Bpack := ./Make.package
Blocs := .
Expand Down
14 changes: 5 additions & 9 deletions Exec/gravity_tests/evrard_collapse/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@ USE_PROB_PARAMS = TRUE

GPU_COMPATIBLE_PROBLEM = TRUE

ifdef MICROPHYSICS_HOME
# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
EOS_DIR := gamma_law_general
else
$(error Error: This problem requires the Microphysics repository. Please ensure that you have downloaded it and set $$MICROPHYSICS_HOME appropriately)
endif

# This sets the network directory in Castro/Networks
# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
EOS_DIR := gamma_law_general

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
NETWORK_DIR := general_null
GENERAL_NET_INPUTS = $(CASTRO_HOME)/Microphysics/networks/$(NETWORK_DIR)/gammalaw.net
NETWORK_INPUTS = gammalaw.net

Bpack += $(TEST_DIR)/Make.package
Blocs += $(TEST_DIR)
Expand Down
10 changes: 1 addition & 9 deletions Exec/gravity_tests/hydrostatic_adjust/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,12 @@ USE_PROB_PARAMS = TRUE

CASTRO_HOME = ../../..

ifdef MICROPHYSICS_HOME

# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
EOS_DIR := helmholtz

# This sets the EOS directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
GENERAL_NET_INPUTS = $(MICROPHYSICS_HOME)/networks/$(NETWORK_DIR)/ignition.net

else

$(error Error: This problem requires the Microphysics repository. Please ensure that you have downloaded it and set $$MICROPHYSICS_HOME appropriately)

endif
NETWORK_INPUTS = ignition.net

Bpack := ./Make.package
Blocs := .
Expand Down
6 changes: 3 additions & 3 deletions Exec/gravity_tests/uniform_cube_sphere/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ GPU_COMPATIBLE_PROBLEM = TRUE

USE_PROB_PARAMS = TRUE

# This sets the EOS directory in $(CASTRO_HOME)/EOS
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in Castro/Networks
# This sets the network directory in $(MICROPHSICS_HOME)/Networks
NETWORK_DIR ?= general_null
GENERAL_NET_INPUTS = $(CASTRO_HOME)/Microphysics/networks/$(NETWORK_DIR)/gammalaw.net
NETWORK_INPUTS = gammalaw.net

Bpack += $(TEST_DIR)/Make.package
Blocs += $(TEST_DIR)
Expand Down
13 changes: 3 additions & 10 deletions Exec/hydro_tests/HCBubble/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,12 @@ USE_PROB_PARAMS = TRUE
# define the location of the CASTRO top directory
CASTRO_HOME := ../../..

ifdef MICROPHYSICS_HOME
# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
EOS_DIR := gamma_law_general
else
$(error Error: This problem requires the Microphysics repository. Please ensure that you have downloaded it and set $$MICROPHYSICS_HOME appropriately)
endif

# This sets the EOS directory in Castro/EOS
# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
EOS_DIR := gamma_law_general

# This sets the network directory in Castro/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
GENERAL_NET_INPUTS = $(CASTRO_HOME)/Microphysics/networks/$(NETWORK_DIR)/gammalaw.net
NETWORK_INPUTS = gammalaw.net

Bpack := ./Make.package
Blocs := .
Expand Down
6 changes: 3 additions & 3 deletions Exec/hydro_tests/KH/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ USE_PROB_PARAMS = TRUE

NUMADV := 1

# This sets the EOS directory in Castro/EOS
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR ?= gamma_law

# This sets the network directory in Castro/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
NETWORK_DIR ?= general_null
GENERAL_NET_INPUTS ?= $(CASTRO_HOME)/Microphysics/networks/$(NETWORK_DIR)/gammalaw.net
NETWORK_INPUTS ?= gammalaw.net

Bpack += $(TEST_DIR)/Make.package
Blocs += $(TEST_DIR)/.
Expand Down
5 changes: 3 additions & 2 deletions Exec/hydro_tests/Noh/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ COMP = gnu
USE_MPI = TRUE
USE_OMP = FALSE

# This sets the network directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in Castro/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
GENERAL_NET_INPUTS = $(CASTRO_HOME)/Microphysics/networks/$(NETWORK_DIR)/gammalaw.net
NETWORK_INPUTS = gammalaw.net

Bpack += $(TEST_DIR)/Make.package
Blocs += $(TEST_DIR)
Expand Down
6 changes: 3 additions & 3 deletions Exec/hydro_tests/RT/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ USE_PROB_PARAMS = TRUE
# define the location of the CASTRO top directory
CASTRO_HOME := ../../..

# This sets the EOS directory in $(CASTRO_HOME)/EOS
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(CASTRO_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
NETWORK_DIR := general_null
GENERAL_NET_INPUTS = $(CASTRO_HOME)/Microphysics/networks/$(NETWORK_DIR)/gammalaw.net
NETWORK_INPUTS = gammalaw.net

Bpack := ./Make.package
Blocs := .
Expand Down
6 changes: 3 additions & 3 deletions Exec/hydro_tests/Sedov/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ USE_PROB_PARAMS = TRUE
# define the location of the CASTRO top directory
CASTRO_HOME := ../../..

# This sets the EOS directory in Castro/EOS
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in Castro/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
NETWORK_DIR := general_null
GENERAL_NET_INPUTS = $(CASTRO_HOME)/Microphysics/networks/$(NETWORK_DIR)/gammalaw.net
NETWORK_INPUTS = gammalaw.net

Bpack := ./Make.package
Blocs := .
Expand Down
6 changes: 3 additions & 3 deletions Exec/hydro_tests/Sod/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ USE_PROB_PARAMS = TRUE
# define the location of the CASTRO top directory
CASTRO_HOME := ../../..

# This sets the EOS directory in Castro/EOS
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in Castro/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
GENERAL_NET_INPUTS = $(CASTRO_HOME)/Microphysics/networks/$(NETWORK_DIR)/gammalaw.net
NETWORK_INPUTS = gammalaw.net

Bpack := ./Make.package
Blocs := .
Expand Down
13 changes: 1 addition & 12 deletions Exec/hydro_tests/Sod_stellar/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,12 @@ USE_PROB_PARAMS = TRUE
# define the location of the CASTRO top directory
CASTRO_HOME := ../../..

ifdef MICROPHYSICS_HOME

# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
EOS_DIR := helmholtz

# This sets the EOS directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
GENERAL_NET_INPUTS = $(MICROPHYSICS_HOME)/networks/$(NETWORK_DIR)/ignition.net

else

$(error Error: This problem requires the Microphysics repository. Please ensure that you have downloaded it and set $$MICROPHYSICS_HOME appropriately)

endif

# This sets the network directory in Castro/Networks

NETWORK_INPUTS = ignition.net

Bpack := ./Make.package
#$(CASTRO_HOME)/Util/exact_riemann/Make.package
Expand Down
Loading

0 comments on commit f08a875

Please sign in to comment.