.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/hyp_oecs/plot_dg_ile.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_hyp_oecs_plot_dg_ile.py: Double gyre iLE =============== Compute the iLE field for the double gyre. .. GENERATED FROM PYTHON SOURCE LINES 9-16 .. code-block:: Python # Author: ajarvis import numpy as np import matplotlib.pyplot as plt from numbacs.flows import get_predefined_callable from numbacs.diagnostics import ile_2D_func .. GENERATED FROM PYTHON SOURCE LINES 17-20 Get flow -------------- Set the initial time, retrieve a jit-callable for the flow, and set up domain. .. GENERATED FROM PYTHON SOURCE LINES 20-34 .. code-block:: Python # set time at which to compute iLE t0 = 0.0 # retrieve function pointer, parameters, and domain for double gyre flow. vel_func, domain = get_predefined_callable("double_gyre") # set up domain nx, ny = 401, 201 x = np.linspace(domain[0][0], domain[0][1], nx) y = np.linspace(domain[1][0], domain[1][1], ny) dx = x[1] - x[0] dy = y[1] - y[0] .. GENERATED FROM PYTHON SOURCE LINES 35-38 iLE --------- Compute iLE from velocity function at t = t0. .. GENERATED FROM PYTHON SOURCE LINES 38-40 .. code-block:: Python ile = ile_2D_func(vel_func, x, y, t0=t0) .. GENERATED FROM PYTHON SOURCE LINES 41-44 Plot ---- Plot the results. .. GENERATED FROM PYTHON SOURCE LINES 44-48 .. code-block:: Python fig, ax = plt.subplots(dpi=200) ax.contourf(x, y, ile.T, levels=80) ax.set_aspect("equal") plt.show() .. image-sg:: /auto_examples/hyp_oecs/images/sphx_glr_plot_dg_ile_001.png :alt: plot dg ile :srcset: /auto_examples/hyp_oecs/images/sphx_glr_plot_dg_ile_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.726 seconds) .. _sphx_glr_download_auto_examples_hyp_oecs_plot_dg_ile.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_dg_ile.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_dg_ile.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_dg_ile.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_