Skip to content

Commit 22c355a

Browse files
committed
Undo the code block changes
1 parent b3f448b commit 22c355a

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

FWI_forward_adjoint/FWIpart1.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ At the core of Devito's symbolic API are two symbolic types that behave like Sym
6767
6868
To demonstrate Devito's symbolic capabilities, let us consider a time-dependent function $\mathbf{u}(\text{time}, x, y)$ representing the discrete forward wavefield. We can define this as a `TimeFunction` object in Devito:
6969
70-
```
71-
python
70+
```python
7271
u = TimeFunction(name="u", shape=model.shape_domain, time_order=2,
7372
space_order=2, save=True, time_dim=nt)
7473
```
@@ -83,8 +82,7 @@ derivatives using shorthand expressions, such as `u.dx` and `u.dx2` to
8382
denote $\frac{\partial u}{\partial x}$ and $\frac{\partial^2
8483
u}{\partial x^2}$ respectively.
8584
86-
```
87-
python
85+
```python
8886
In []: u
8987
Out[]: u(time, x, y)
9088
@@ -97,8 +95,7 @@ python
9795
9896
Using the automatic derivation of derivative expressions we can now implement a discretized expression for Equation @WE without the source term $q(x,y,t;x_s, y_s)$. The `model` object which we created earlier, already contains the squared slowness $\mathbf{m}$ and damping term $\mathbf{\eta}$ as `Function` objects:
9997
100-
```
101-
python
98+
```python
10299
# Set up discretized wave equation
103100
pde = model.m * u.dt2 - u.laplace + model.damp * u.dt
104101
```
@@ -117,8 +114,7 @@ $${#WEstencil}
117114
118115
In Python, we can rearrange our `pde` expression automatically using the SymPy utility function `solve`, to create a stencil expression that defines the update of the wavefield for the new time step $\mathbf{u}(\text{time}+s)$, which is expressed as `u.forward` in Devito:
119116
120-
```
121-
python
117+
```python
122118
# Rearrange PDE to obtain new wavefield at next time step
123119
stencil = Eq(u.forward, solve(pde, u.forward)[0])
124120
```
@@ -150,8 +146,7 @@ The `src.inject` now injects the current time sample of the Ricker wavelet (weig
150146
151147
There is a corresponding wrapper function for receivers as well, which creates a `SparseFunction` object for a given number `npoint` of receivers, number `nt` of time samples and specified receiver coordinates `rec_coords` (with `ndim=2`, since we have a two-dimensional example).
152148
153-
```
154-
python
149+
```python
155150
# create receiver array from receiver coordinates
156151
rec = Receiver(name='rec', npoint=101, ntime=nt, ndim=2, coordinates=rec_coords)
157152
rec_term = rec.interpolate(u, offset=model.nbpml)
@@ -184,8 +179,7 @@ simple Python function call by supplying the number of timesteps
184179
to extract the final wavefield and shotrecord directly from the
185180
symbolic function objects.
186181
187-
```
188-
python
182+
```python
189183
# Generate wavefield snapshots and a shot record
190184
op_fwd(time=n_timesteps, dt=model.critical_dt)
191185

0 commit comments

Comments
 (0)