Skip to content

Commit 6555855

Browse files
committed
deploy: 95580df
1 parent 9947d5a commit 6555855

File tree

81 files changed

+3847
-164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3847
-164
lines changed

404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</li>
5353
<li class="toctree-l1"><a class="reference internal" href="/tutorials/06_elastic/">Elastic modeling with constant parameters</a>
5454
</li>
55-
<li class="toctree-l1"><a class="reference internal" href="/tutorials/07_elastic_varying_parameters/">Elastic modeling with varying parameters</a>
55+
<li class="toctree-l1"><a class="" href="/tutorials/07_elastic_varying_parameters.md">Elastic modeling with varying parameters</a>
5656
</li>
5757
</ul>
5858
<p class="caption"><span class="caption-text">The Leading Edge tutorials</span></p>

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
</li>
7070
<li class="toctree-l1"><a class="reference internal" href="tutorials/06_elastic/">Elastic modeling with constant parameters</a>
7171
</li>
72-
<li class="toctree-l1"><a class="reference internal" href="tutorials/07_elastic_varying_parameters/">Elastic modeling with varying parameters</a>
72+
<li class="toctree-l1"><a class="" href="tutorials/07_elastic_varying_parameters.md">Elastic modeling with varying parameters</a>
7373
</li>
7474
</ul>
7575
<p class="caption"><span class="caption-text">The Leading Edge tutorials</span></p>
@@ -213,5 +213,5 @@ <h2 id="related-literature">Related literature</h2>
213213

214214
<!--
215215
MkDocs version : 1.6.1
216-
Build Date UTC : 2025-04-24 12:36:13.202701+00:00
216+
Build Date UTC : 2025-04-24 12:42:55.966430+00:00
217217
-->

search.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</li>
5353
<li class="toctree-l1"><a class="reference internal" href="./tutorials/06_elastic/">Elastic modeling with constant parameters</a>
5454
</li>
55-
<li class="toctree-l1"><a class="reference internal" href="./tutorials/07_elastic_varying_parameters/">Elastic modeling with varying parameters</a>
55+
<li class="toctree-l1"><a class="" href="./tutorials/07_elastic_varying_parameters.md">Elastic modeling with varying parameters</a>
5656
</li>
5757
</ul>
5858
<p class="caption"><span class="caption-text">The Leading Edge tutorials</span></p>

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tutorials/01_modelling/index.html

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</li>
6666
<li class="toctree-l1"><a class="reference internal" href="../06_elastic/">Elastic modeling with constant parameters</a>
6767
</li>
68-
<li class="toctree-l1"><a class="reference internal" href="../07_elastic_varying_parameters/">Elastic modeling with varying parameters</a>
68+
<li class="toctree-l1"><a class="" href="../07_elastic_varying_parameters.md">Elastic modeling with varying parameters</a>
6969
</li>
7070
</ul>
7171
<p class="caption"><span class="caption-text">The Leading Edge tutorials</span></p>
@@ -110,7 +110,7 @@ <h2 id="modelling-workflow">Modelling workflow</h2>
110110
<li><strong>Receiver</strong> - A set of microphones or hydrophones are used to measure the resulting wave and create a set of measurements called a <em>Shot Record</em>. These measurements are recorded at multiple locations, and usually at the surface of the domain or at the bottom of the ocean in some marine cases.</li>
111111
</ul>
112112
<p>In order to create a numerical model of a seismic survey, we need to solve the wave equation and implement source and receiver interpolation to inject the source and record the seismic wave at sparse point locations in the grid.</p>
113-
<p><img alt="ship" src="https://lh6.googleusercontent.com/gEPgCb9K0cm_10iFOBL98swm_rzfWAmrDNxwMHHljzVq6yxMGK27qO4PneK14ma5qY63DWBEP5t5_KBRRUcKKAf8NqCXUBmMfZutnOsDHFCd0J6zKuT8v9rITjHbOGCmF-KP5ps" /></p>
113+
<p><img src='./survey-ship-diagram.png' width=400></p>
114114
<h2 id="the-acoustic-seismic-wave-equation">The acoustic seismic wave equation</h2>
115115
<p>The acoustic wave equation for the square slowness <span class="arithmatex"><span class="MathJax_Preview">m</span><script type="math/tex">m</script></span>, defined as <span class="arithmatex"><span class="MathJax_Preview">m=\frac{1}{c^2}</span><script type="math/tex">m=\frac{1}{c^2}</script></span>, where <span class="arithmatex"><span class="MathJax_Preview">c</span><script type="math/tex">c</script></span> is the speed of sound in the given physical media, and a source <span class="arithmatex"><span class="MathJax_Preview">q</span><script type="math/tex">q</script></span> is given by:</p>
116116
<div class="arithmatex">
@@ -183,10 +183,10 @@ <h2 id="define-the-physical-problem">Define the physical problem</h2>
183183

184184
<span class="n">plot_velocity</span><span class="p">(</span><span class="n">model</span><span class="p">)</span>
185185
</code></pre></div>
186-
<pre><code>Operator `initdamp` run in 0.01 s
187-
Operator `padfunc` run in 0.01 s
186+
<pre><code>Operator `initdamp` ran in 0.01 s
187+
Operator `pad_vp` ran in 0.01 s
188188
</code></pre>
189-
<p><img alt="png" src="../01_modelling_files/01_modelling_5_1.png" /></p>
189+
<p><img alt="svg" src="../01_modelling_files/01_modelling_5_1.svg" /></p>
190190
<h1 id="acquisition-geometry">Acquisition geometry</h1>
191191
<p>To fully define our problem setup we also need to define the source that injects the wave to model and the set of receiver locations at which to sample the wavefield. The source time signature will be modelled using a Ricker wavelet defined as</p>
192192
<div class="arithmatex">
@@ -221,7 +221,7 @@ <h1 id="acquisition-geometry">Acquisition geometry</h1>
221221
<span class="c1"># We can plot the time signature to see the wavelet</span>
222222
<span class="n">src</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
223223
</code></pre></div>
224-
<p><img alt="png" src="../01_modelling_files/01_modelling_9_0.png" /></p>
224+
<p><img alt="svg" src="../01_modelling_files/01_modelling_9_0.svg" /></p>
225225
<p>Similarly to our source object, we can now define our receiver geometry as a symbol of type <code>Receiver</code>. It is worth noting here that both utility classes, <code>RickerSource</code> and <code>Receiver</code> are thin wrappers around the Devito's <code>SparseTimeFunction</code> type, which encapsulates sparse point data and allows us to inject and interpolate values into and out of the computational grid. As we have already seen, both types provide a <code>.coordinates</code> property to define the position within the domain of all points encapsulated by that symbol. </p>
226226
<p>In this example we will position receivers at the same depth as the source, every <span class="arithmatex"><span class="MathJax_Preview">10m</span><script type="math/tex">10m</script></span> along the x axis. The <code>rec.data</code> property will be initialized, but left empty, as we will compute the receiver readings during the simulation.</p>
227227
<div class="highlight"><pre><span></span><code><span class="c1">#NBVAL_IGNORE_OUTPUT</span>
@@ -240,7 +240,7 @@ <h1 id="acquisition-geometry">Acquisition geometry</h1>
240240
<span class="n">plot_velocity</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">source</span><span class="o">=</span><span class="n">src</span><span class="o">.</span><span class="n">coordinates</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
241241
<span class="n">receiver</span><span class="o">=</span><span class="n">rec</span><span class="o">.</span><span class="n">coordinates</span><span class="o">.</span><span class="n">data</span><span class="p">[::</span><span class="mi">4</span><span class="p">,</span> <span class="p">:])</span>
242242
</code></pre></div>
243-
<p><img alt="png" src="../01_modelling_files/01_modelling_11_0.png" /></p>
243+
<p><img alt="svg" src="../01_modelling_files/01_modelling_11_0.svg" /></p>
244244
<h1 id="finite-difference-discretization">Finite-difference discretization</h1>
245245
<p>Devito is a finite-difference DSL that solves the discretized wave-equation on a Cartesian grid. The finite-difference approximation is derived from Taylor expansions of the continuous field after removing the error term.</p>
246246
<h2 id="time-discretization">Time discretization</h2>
@@ -300,7 +300,9 @@ <h2 id="wave-equation">Wave equation</h2>
300300
<span class="kn">from</span><span class="w"> </span><span class="nn">devito</span><span class="w"> </span><span class="kn">import</span> <span class="n">Eq</span><span class="p">,</span> <span class="n">solve</span>
301301

302302
<span class="n">stencil</span> <span class="o">=</span> <span class="n">Eq</span><span class="p">(</span><span class="n">u</span><span class="o">.</span><span class="n">forward</span><span class="p">,</span> <span class="n">solve</span><span class="p">(</span><span class="n">pde</span><span class="p">,</span> <span class="n">u</span><span class="o">.</span><span class="n">forward</span><span class="p">))</span>
303+
<span class="n">stencil</span>
303304
</code></pre></div>
305+
<p><span class="arithmatex"><span class="MathJax_Preview">\displaystyle u{\left(t + dt,x,y \right)} = \frac{- \frac{- \frac{2.0 u{\left(t,x,y \right)}}{dt^{2}} + \frac{u{\left(t - dt,x,y \right)}}{dt^{2}}}{\operatorname{vp}^{2}{\left(x,y \right)}} + \frac{\partial^{2}}{\partial x^{2}} u{\left(t,x,y \right)} + \frac{\partial^{2}}{\partial y^{2}} u{\left(t,x,y \right)} + \frac{\operatorname{damp}{\left(x,y \right)} u{\left(t,x,y \right)}}{dt}}{\frac{\operatorname{damp}{\left(x,y \right)}}{dt} + \frac{1}{dt^{2} \operatorname{vp}^{2}{\left(x,y \right)}}}</span><script type="math/tex">\displaystyle u{\left(t + dt,x,y \right)} = \frac{- \frac{- \frac{2.0 u{\left(t,x,y \right)}}{dt^{2}} + \frac{u{\left(t - dt,x,y \right)}}{dt^{2}}}{\operatorname{vp}^{2}{\left(x,y \right)}} + \frac{\partial^{2}}{\partial x^{2}} u{\left(t,x,y \right)} + \frac{\partial^{2}}{\partial y^{2}} u{\left(t,x,y \right)} + \frac{\operatorname{damp}{\left(x,y \right)} u{\left(t,x,y \right)}}{dt}}{\frac{\operatorname{damp}{\left(x,y \right)}}{dt} + \frac{1}{dt^{2} \operatorname{vp}^{2}{\left(x,y \right)}}}</script></span></p>
304306
<h1 id="source-injection-and-receiver-interpolation">Source injection and receiver interpolation</h1>
305307
<p>With a numerical scheme to solve the homogenous wave equation, we need to add the source to introduce seismic waves and to implement the measurement operator, and interpolation operator. This operation is linked to the discrete scheme and needs to be done at the proper time step. The semi-discretized in time wave equation with a source reads:</p>
306308
<div class="arithmatex">
@@ -339,26 +341,26 @@ <h1 id="devito-operator-and-solve">Devito operator and solve</h1>
339341
<div class="highlight"><pre><span></span><code><span class="c1">#NBVAL_IGNORE_OUTPUT</span>
340342
<span class="n">op</span><span class="p">(</span><span class="n">time</span><span class="o">=</span><span class="n">time_range</span><span class="o">.</span><span class="n">num</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">dt</span><span class="o">=</span><span class="n">model</span><span class="o">.</span><span class="n">critical_dt</span><span class="p">)</span>
341343
</code></pre></div>
342-
<pre><code>Operator `Kernel` run in 0.04 s
344+
<pre><code>Operator `Kernel` ran in 0.01 s
343345

344346

345347

346348

347349

348350
PerformanceSummary([(PerfKey(name='section0', rank=None),
349-
PerfEntry(time=0.01473899999999997, gflopss=0.0, gpointss=0.0, oi=0.0, ops=0, itershapes=[])),
351+
PerfEntry(time=0.004936999999999981, gflopss=0.0, gpointss=0.0, oi=0.0, ops=0, itershapes=[])),
350352
(PerfKey(name='section1', rank=None),
351-
PerfEntry(time=0.009967999999999994, gflopss=0.0, gpointss=0.0, oi=0.0, ops=0, itershapes=[])),
353+
PerfEntry(time=2.600000000000001e-05, gflopss=0.0, gpointss=0.0, oi=0.0, ops=0, itershapes=[])),
352354
(PerfKey(name='section2', rank=None),
353-
PerfEntry(time=0.005742000000000012, gflopss=0.0, gpointss=0.0, oi=0.0, ops=0, itershapes=[]))])
355+
PerfEntry(time=0.0007560000000000057, gflopss=0.0, gpointss=0.0, oi=0.0, ops=0, itershapes=[]))])
354356
</code></pre>
355357
<p>After running our operator kernel, the data associated with the receiver symbol <code>rec.data</code> has now been populated due to the interpolation expression we inserted into the operator. This allows us the visualize the shot record:</p>
356358
<div class="highlight"><pre><span></span><code><span class="c1">#NBVAL_IGNORE_OUTPUT</span>
357359
<span class="kn">from</span><span class="w"> </span><span class="nn">examples.seismic</span><span class="w"> </span><span class="kn">import</span> <span class="n">plot_shotrecord</span>
358360

359361
<span class="n">plot_shotrecord</span><span class="p">(</span><span class="n">rec</span><span class="o">.</span><span class="n">data</span><span class="p">,</span> <span class="n">model</span><span class="p">,</span> <span class="n">t0</span><span class="p">,</span> <span class="n">tn</span><span class="p">)</span>
360362
</code></pre></div>
361-
<p><img alt="png" src="../01_modelling_files/01_modelling_22_0.png" /></p>
363+
<p><img alt="svg" src="../01_modelling_files/01_modelling_22_0.svg" /></p>
362364
<div class="highlight"><pre><span></span><code><span class="k">assert</span> <span class="n">np</span><span class="o">.</span><span class="n">isclose</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">rec</span><span class="o">.</span><span class="n">data</span><span class="p">),</span> <span class="mi">370</span><span class="p">,</span> <span class="n">rtol</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
363365
</code></pre></div>
364366

-44 Bytes
Loading

0 commit comments

Comments
 (0)