Skip to content

Commit 95b7c38

Browse files
committed
examples: Update notebooks
1 parent 025d11a commit 95b7c38

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

examples/seismic/tutorials/16_ader_fd.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": "0",
66
"metadata": {},
77
"source": [
8-
"# 15 - ADER-FD\n",
8+
"# 16 - ADER-FD\n",
99
"\n",
1010
"This notebook demonstrates the implementation of a finite-difference scheme for solving the first-order formulation of the acoustic wave equation using ADER (Arbitrary-order-accuracy via DERivatives) time integration. This enables a temporal discretisation up the order of the spatial discretisation, whilst preventing the grid-grid decoupling (often referred to as checkerboarding) associated with solving first-order systems of equations on a single finite-difference grid.\n",
1111
"\n",

examples/userapi/02_apply.ipynb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"\n",
99
"This tutorial describes three fundamental user APIs:\n",
1010
"\n",
11-
"* Operator.apply\n",
12-
"* Operator.arguments\n",
13-
"* Operator.estimate_memory\n",
11+
"* `Operator.apply`\n",
12+
"* `Operator.arguments`\n",
13+
"* `Operator.estimate_memory`\n",
1414
"\n",
1515
"We will use a trivial `Operator` that, at each time step, increments by 1 all points in the physical domain."
1616
]
@@ -57,7 +57,7 @@
5757
"cell_type": "markdown",
5858
"metadata": {},
5959
"source": [
60-
"Under the hood, some code has been generated (`print(op)` to display the generated code), JIT-compiled, and executed. Since no additional arguments have been passed, `op` has used `u` as input. We can verify that the content of `u.data` is as expected"
60+
"Under the hood, some code has been generated, JIT-compiled, and executed. Note that one can print `op.ccode` to display the generated code. Since no additional arguments have been passed, `op` has used `u` as input. We can verify that the content of `u.data` is as expected"
6161
]
6262
},
6363
{
@@ -162,7 +162,7 @@
162162
"source": [
163163
"`'u'` stores a pointer to the allocated data; `'timers'` stores a pointer to a data structure used for C-level performance profiling.\n",
164164
"\n",
165-
"One may want to replace some of these default arguments. For example, we could increase the minimum iteration point along the spatial Dimensions `x` and `y`, and execute only the very first timestep:"
165+
"One may want to replace some of these default arguments. For example, we could reduce the maximum iteration point along the spatial Dimensions `x` and `y`, and execute only the very first timestep:"
166166
]
167167
},
168168
{
@@ -174,14 +174,14 @@
174174
"name": "stderr",
175175
"output_type": "stream",
176176
"text": [
177-
"Operator `Kernel` run in 0.00 s\n"
177+
"Operator `Kernel` ran in 0.01 s\n"
178178
]
179179
}
180180
],
181181
"source": [
182182
"#NBVAL_IGNORE_OUTPUT\n",
183183
"u.data[:] = 0. # Explicit reset to initial value\n",
184-
"summary = op.apply(x_m=2, y_m=2, time_M=0)"
184+
"summary = op.apply(x_M=1, y_M=1, time_M=0)"
185185
]
186186
},
187187
{
@@ -204,10 +204,10 @@
204204
" [0., 0., 0., 0.],\n",
205205
" [0., 0., 0., 0.]],\n",
206206
"\n",
207-
" [[0., 0., 0., 0.],\n",
208-
" [0., 0., 0., 0.],\n",
209-
" [0., 0., 1., 1.],\n",
210-
" [0., 0., 1., 1.]],\n",
207+
" [[1., 1., 1., 0.],\n",
208+
" [1., 1., 1., 0.],\n",
209+
" [1., 1., 1., 0.],\n",
210+
" [0., 0., 0., 0.]],\n",
211211
"\n",
212212
" [[0., 0., 0., 0.],\n",
213213
" [0., 0., 0., 0.],\n",
@@ -228,12 +228,14 @@
228228
"cell_type": "markdown",
229229
"metadata": {},
230230
"source": [
231+
"Side note: in practice, iterating over a subset of the grid by directly overriding the minimum and maximum values of a dimension is not advised. Instead, a `SubDomain` interface is available for this purpose (detailed in tutorial `03_subdomains`).\n",
232+
"\n",
231233
"Given a generic `Dimension` `d`, the naming convention is such that:\n",
232234
"\n",
233235
"* `d_m` is the minimum iteration point\n",
234236
"* `d_M` is the maximum iteration point\n",
235237
"\n",
236-
"Hence, `op.apply(..., d_m=4, d_M=7, ...)` will run `op` in the compact interval `[4, 7]` along `d`. For historical reasons, `d=...` aliases to `d_M=...`; in many Devito examples it happens to see `op.apply(..., time=10, ...)` -- this is just equivalent to `op.apply(..., time_M=10, ...)`.\n",
238+
"Hence, `op.apply(..., d_m=4, d_M=7, ...)` will run `op` in the compact interval `[4, 7]` along `d`. For historical reasons, `d=...` aliases to `d_M=...`; in many Devito examples it happens to see `op.apply(..., time=10, ...)` -- this is just equivalent to `op.apply(..., time_M=10, ...)`. `SpaceDimension`s, such as those attached to a `Grid` do not have a `d_m`, as these dimensions will essentially always be indexed from zero to `d_M` along each axis.\n",
237239
"\n",
238240
"If we try to specify an invalid iteration extreme, Devito will raise an exception."
239241
]

0 commit comments

Comments
 (0)