Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/good_defines.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ BL_LANG_FORT
BL_LAZY
BL_USE_SETBUF
MODEL_PARSER
DIM_MODEL
DIFFUSION
DO_PROBLEM_POST_INIT
DO_PROBLEM_POST_RESTART
Expand Down
28 changes: 25 additions & 3 deletions Exec/Make.Castro
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,36 @@ ifeq ($(USE_ALL_CASTRO), TRUE)
Source/problems Source/sources
endif

MAX_NPTS_MODEL ?= 10000
NUM_MODELS ?= 1
DIM_MODEL ?= 1

# Only 1 or 2 dimensions are supported for now.
ifeq ($(filter $(DIM_MODEL),1 2),)
$(error Invalid DIM_MODEL=$(DIM_MODEL). Must be 1 or 2.)
endif

ifeq ($(DIM_MODEL), 1)
MAX_NPTS_MODEL ?= 10000
else ifeq ($(DIM_MODEL), 2)
MAX_NPTS_X_MODEL ?= 10000
MAX_NPTS_Y_MODEL ?= 10000
endif

ifeq ($(USE_MODEL_PARSER), TRUE)
Bdirs += Util/model_parser
DEFINES += -DMODEL_PARSER -DNPTS_MODEL=$(MAX_NPTS_MODEL) -DNUM_MODELS=$(NUM_MODELS)
DEFINES += -DMODEL_PARSER \
-DNUM_MODELS=$(NUM_MODELS) \
-DDIM_MODEL=$(DIM_MODEL)

ifeq ($(DIM_MODEL), 1)
DEFINES += -DNPTS_MODEL=$(MAX_NPTS_MODEL)
else ifeq ($(DIM_MODEL), 2)
DEFINES += -DNPTS_X_MODEL=$(MAX_NPTS_X_MODEL) \
-DNPTS_Y_MODEL=$(MAX_NPTS_Y_MODEL)
endif
endif


ifeq ($(USE_RNG_STATE_INIT), TRUE)
DEFINES += -DRNG_STATE_INIT
endif
Expand All @@ -195,7 +217,7 @@ ifeq ($(USE_MHD), TRUE)
endif

ifeq ($(USE_GRAV), TRUE)
Bdirs += Source/gravity Source/scf
Bdirs += Source/gravity Source/scf
DEFINES += -DGRAVITY
USE_MLMG = TRUE
endif
Expand Down
10 changes: 8 additions & 2 deletions Source/reactions/Castro_react.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ Castro::react_state(MultiFab& s, MultiFab& r, Real time, Real dt, const int stra
rr[2] = problo[2] + dx[2] * (static_cast<Real>(k) + 0.5_rt) - problem::center[2];
#endif

#if DIM_MODEL == 1
Real dist;

if (domain_is_plane_parallel) {
Expand All @@ -290,7 +291,9 @@ Castro::react_state(MultiFab& s, MultiFab& r, Real time, Real dt, const int stra
}

burn_state.T_fixed = interpolate(dist, model::itemp);

#elif DIM_MODEL == 2
burn_state.T_fixed = interpolate(rr[0], rr[1], model::itemp);
#endif
}
#endif

Expand Down Expand Up @@ -632,6 +635,7 @@ Castro::react_state(Real time, Real dt)
rr[2] = problo[2] + dx[2] * (static_cast<Real>(k) + 0.5_rt) - problem::center[2];
#endif

#if DIM_MODEL == 1
Real dist;

if (domain_is_plane_parallel) {
Expand All @@ -641,7 +645,9 @@ Castro::react_state(Real time, Real dt)
}

burn_state.T_fixed = interpolate(dist, model::itemp);

#elif DIM_MODEL == 2
burn_state.T_fixed = interpolate(rr[0], rr[1], model::itemp);
#endif
}
#endif

Expand Down
Loading