Skip to content

Commit b7d4da6

Browse files
committed
misc: Add more verbose comment to non-superstepping solution transfer code
1 parent ce39a89 commit b7d4da6

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

examples/timestepping/acoustic_superstep_2d.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ def acoustic_model(model, t0, t1, t2, critical_dt, source, step=1, snapshots=1):
6666
idx = nt1 % 3
6767
if step == 1:
6868
# Non-superstep case
69+
# In this case we need to create a new `TimeFunction` and copy
70+
# the previous soluton into that new function. This is necessary
71+
# when a rotating buffer is used in the `TimeFunction` and the
72+
# order of the timesteps is not necessarily the right order for
73+
# resuming the simulation. We also create a new stencil that
74+
# writes to the new `TimeFunction`.
6975
new_u = TimeFunction(
7076
name="new_u",
7177
grid=model.grid,
@@ -120,14 +126,14 @@ def acoustic_model(model, t0, t1, t2, critical_dt, source, step=1, snapshots=1):
120126
if args.model == 'layered':
121127
source = (500, 20)
122128
t2 = 0.65
123-
critical_dt=0.002357
129+
critical_dt = 0.002357
124130
zlim = 30
125131
else: # Marmousi
126132
# This requires the `devitocodes/data` repository, which we
127133
# assume to be checked out at `$VIRTUAL_ENV/src/data`.
128134
source = (1500, 1500)
129135
t2 = 0.5
130-
critical_dt=0.0013728
136+
critical_dt = 0.0013728
131137
zlim = 20
132138
tmp_model = demo_model(
133139
'marmousi-isotropic',

0 commit comments

Comments
 (0)