Skip to content

Commit

Permalink
start of some cleaning of the prob_params stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Jan 4, 2024
1 parent 3e624f0 commit ddf7034
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Exec/gravity_tests/hse_convergence/_prob_params
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ temp_base real 1.0_rt y

pert_width real 1.0_rt y

do_pert logical .true. y
do_pert int 1 y
2 changes: 1 addition & 1 deletion Exec/science/wdmerger/_prob_params
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ onemg_wd_mg_frac real 0.05e0_rt y
# Parameters for interpolation from 1D model to 3D model

# Default to interpolation that preserves temperature; otherwise, use pressure
interp_temp logical .true. y
interp_temp integer 1 y

# Number of sub-grid-scale zones to use
nsub integer 1 y
Expand Down
11 changes: 5 additions & 6 deletions Util/scripts/write_probdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
max_step integer 1
small_dt real 1.d-10
xlo_boundary_type character ""
octant logical .false.
This specifies the parameter name, datatype, and default
This specifies the runtime parameter name, datatype, and default
value.
The optional 4th column indicates whether the parameter appears
Expand Down Expand Up @@ -153,7 +152,7 @@ def write_probin(prob_param_files, cxx_prefix):
params = []

print(" ")
print(f"write_probdata.py: creating prob_param C++ files")
print("write_probdata.py: creating prob_param C++ files")

# read the parameters defined in the parameter files

Expand Down Expand Up @@ -231,15 +230,15 @@ def write_probin(prob_param_files, cxx_prefix):
# we need access to _rt
fout.write(" using namespace amrex;\n")

fout.write(f" amrex::ParmParse pp(\"problem\");\n\n")
fout.write(" amrex::ParmParse pp(\"problem\");\n\n")
for p in params:
if p.is_array():
size = p.size
if (size == "nspec"):
if size == "nspec":
size = "NumSpec"
fout.write(f" for (int n = 0; n < {size}; n++) {{\n")
fout.write(f" problem::{p.name}[n] = {p.default_format(lang='C++')};\n")
fout.write(f" }}\n")
fout.write(" }}\n")
else:
fout.write(f" {p.get_default_string()}")

Expand Down

0 comments on commit ddf7034

Please sign in to comment.