Skip to content

Commit b52d1d3

Browse files
committed
tests with variable dt: turn on var dt switch
1 parent 1ae5151 commit b52d1d3

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

tests/python/physics/coalescence_golovin.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ def calc_golovin(res,t,n0,v0,b):
117117
opts_init.sd_conc = 0
118118
opts_init.sd_const_multi = 1000
119119
opts_init.n_sd_max = int(float(n_zero) / opts_init.sd_const_multi + 10)
120+
121+
opts.dt = opts_dt
122+
if opts_dt < 0:
123+
n_step = simulation_time / opts_init.dt
124+
else:
125+
assert(simulation_time % opts_dt == 0)
126+
opts_init.variable_dt_switch=True
127+
n_step = simulation_time / opts_dt
120128

121129
try:
122130
prtcls = lgrngn.factory(lgrngn.backend_t.OpenMP, opts_init)
@@ -125,13 +133,6 @@ def calc_golovin(res,t,n0,v0,b):
125133

126134
prtcls.init(th, rv, rhod)
127135
init_number_of_particles = partno()
128-
129-
opts.dt = opts_dt
130-
if opts_dt < 0:
131-
n_step = simulation_time / opts_init.dt
132-
else:
133-
assert(simulation_time % opts_dt == 0)
134-
n_step = simulation_time / opts_dt
135136

136137
#simulation loop
137138
for step in range(int(n_step)):

tests/python/physics/lgrngn_cond.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ def test(RH_formula, _step_count, substep_count, exact_substep, constp, opts_dt)
8080
opts_init.sstp_cond=substep_count
8181
opts_init.exact_sstp_cond=exact_substep
8282
opts_init.RH_formula = RH_formula
83+
if opts_dt > 0:
84+
opts_init.variable_dt_switch=True
8385
opts.dt = opts_dt
8486

8587
# adjust number of steps if opts_dt overrides opts_init.dt

0 commit comments

Comments
 (0)