From cf6280ce10fd9833151b3be2857b2af9e15f3474 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Tue, 12 Dec 2023 13:40:21 -0500 Subject: [PATCH] add optional species sources for the conserved state --- Exec/Make.Castro | 4 ++++ Source/driver/_variables | 6 +++--- Source/driver/set_variables.py | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Exec/Make.Castro b/Exec/Make.Castro index cfd7e187a9..79e747b5c8 100644 --- a/Exec/Make.Castro +++ b/Exec/Make.Castro @@ -270,6 +270,10 @@ ifeq ($(USE_ROTATION), TRUE) DEFINES += -DROTATION endif +ifeq ($(USE_SPECIES_SOURCES), TRUE) + DEFINES += -DCONS_SPECIES_HAVE_SOURCES +endif + ifeq ($(USE_PARTICLES), TRUE) Bdirs += Source/particles endif diff --git a/Source/driver/_variables b/Source/driver/_variables index 36d05dfc06..b6408c82a8 100644 --- a/Source/driver/_variables +++ b/Source/driver/_variables @@ -16,9 +16,9 @@ energy-density UEDEN NSRC 1 None internal-energy UEINT NSRC 1 None temperature UTEMP NSRC 1 None - advected UFA None NumAdv None - species UFS None NumSpec None - auxiliary UFX None NumAux None + advected UFA [(NSRC, CONS_SPECIES_HAVE_SOURCES)] NumAdv None + species UFS [(NSRC, CONS_SPECIES_HAVE_SOURCES)] NumSpec None + auxiliary UFX [(NSRC, CONS_SPECIES_HAVE_SOURCES)] NumAux None shock USHK None 1 SHOCK_VAR mu_p UMUP None 1 NSE_NET mu_n UMUN None 1 NSE_NET diff --git a/Source/driver/set_variables.py b/Source/driver/set_variables.py index a70af00834..12c5cb5743 100755 --- a/Source/driver/set_variables.py +++ b/Source/driver/set_variables.py @@ -132,6 +132,7 @@ def doit(variables_file, odir, defines, nadv): count = fields[3] ifdef = fields[4] + print("here: ", name, var, adds_to_temp, count, ifdef) # we may be fed a pair of the form (SET, DEFINE), # in which case we only add to SET if we define # DEFINE @@ -153,6 +154,8 @@ def doit(variables_file, odir, defines, nadv): if adds_to_temp == "None": adds_to = None else: + if adds_to_temp.startswith("("): + print("here") adds_to = [adds_to_temp] # only recognize the index if we defined any required preprocessor variable