Skip to content

Commit

Permalink
Add option to leave out callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
MTCam committed Apr 11, 2022
1 parent 2f38c9c commit b719e4c
Show file tree
Hide file tree
Showing 22 changed files with 42 additions and 219 deletions.
29 changes: 26 additions & 3 deletions combozzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def main(ctx_factory=cl.create_some_context, use_logmgr=True,
nrestart = 1000
do_checkpoint = 0
boundary_report = 0
do_callbacks = 0

# }}} Time stepping control

Expand Down Expand Up @@ -339,6 +340,10 @@ def main(ctx_factory=cl.create_some_context, use_logmgr=True,
do_checkpoint = int(input_data["do_checkpoint"])
except KeyError:
pass
try:
do_callbacks = int(input_data["do_callbacks"])
except KeyError:
pass
try:
nviz = int(input_data["nviz"])
except KeyError:
Expand Down Expand Up @@ -451,7 +456,7 @@ def main(ctx_factory=cl.create_some_context, use_logmgr=True,
print(f"\t{single_gas_only=},{dummy_rhs_only=}")
print(f"\t{periodic_boundary=},{adiabatic_boundary=}")
print(f"\t{timestepping_on=}, {inviscid_only=}")
print(f"\t{av_on=}, {sponge_on=}")
print(f"\t{av_on=}, {sponge_on=}, {do_callbacks=}")
print(f"\t{nspecies=}")
print("---- timestepping ------")
print(f"\tcurrent_dt = {current_dt}")
Expand Down Expand Up @@ -1029,6 +1034,24 @@ def my_post_step(step, t, dt, state):

from mirgecom.inviscid import inviscid_flux_rusanov

def dummy_pre_step(step, t, dt, state):
if logmgr:
logmgr.tick_before()
return state, dt

def dummy_post_step(step, t, dt, state):
if logmgr:
set_dt(logmgr, dt)
logmgr.tick_after()
return state, dt

pre_step_func = dummy_pre_step
post_step_func = dummy_post_step

if do_callbacks:
pre_step_func = my_pre_step
post_step_func = my_post_step

def cfd_rhs(t, state):
cv, tseed = state
from mirgecom.gas_model import make_fluid_state
Expand Down Expand Up @@ -1091,8 +1114,8 @@ def dummy_rhs(t, state):

current_step, current_t, current_state = \
advance_state(rhs=my_rhs, timestepper=timestepper,
pre_step_callback=my_pre_step, istep=current_step,
post_step_callback=my_post_step, dt=current_dt,
pre_step_callback=pre_step_func, istep=current_step,
post_step_callback=post_step_func, dt=current_dt,
state=make_obj_array([current_cv, temperature_seed]),
t=current_t, t_final=t_final)

Expand Down
2 changes: 1 addition & 1 deletion dist_scale/3d/run_config.yaml
40 changes: 0 additions & 40 deletions dist_scale/3d/run_config/weak_1.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions dist_scale/3d/run_config/weak_16.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions dist_scale/3d/run_config/weak_2.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions dist_scale/3d/run_config/weak_4.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions dist_scale/3d/run_config/weak_8.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p1s1.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 1
order: 2
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p1s1024.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 1
order: 2
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p1s128.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 1
order: 2
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p1s256.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 1
order: 2
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p1s512.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 1
order: 2
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p1s64.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 1
order: 2
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p1s8.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 1
order: 2
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p2s1.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 2
order: 3
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p2s128.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 2
order: 3
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p2s256.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 2
order: 3
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p2s512.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 2
order: 3
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p2s64.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 2
order: 3
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/p2p3_combustion_config/case_p2s8.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 2
order: 3
domain_xlen: 1.
domain_ylen: 1.
domain_zlen: 1.
Expand Down
2 changes: 1 addition & 1 deletion grid_scale/3d/run_config
2 changes: 1 addition & 1 deletion grid_scale/3d/run_logs

0 comments on commit b719e4c

Please sign in to comment.