.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/basic/parallel.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_basic_parallel.py: Parallel ======== Minimal example of parallel bubble solving .. GENERATED FROM PYTHON SOURCE LINES 7-38 .. image-sg:: /auto_examples/basic/images/sphx_glr_parallel_001.png :alt: parallel :srcset: /auto_examples/basic/images/sphx_glr_parallel_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/pttools/checkouts/stable/pttools/bubble/alpha.py:40: NumbaWarning: The TBB threading layer requires TBB version 2021 update 6 or later i.e., TBB_INTERFACE_VERSION >= 12060. Found TBB_INTERFACE_VERSION = 12050. The TBB threading layer is disabled. return alpha_n_max_deflagration_bag(v_wall, n_xi) | .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from pttools.analysis import BubbleGridVWAlpha, VwAlphaPlot from pttools.bubble import get_kappa_omega from pttools.models import BagModel def main(): # Create the arrays of v_wall and alpha_n points that will be used for the grid v_walls = np.linspace(0.05, 0.95, 20) alpha_ns = np.linspace(0.05, 0.3, 20) # Create the equation of state model = BagModel(a_s=1.1, a_b=1, V_s=1) # Parallel computation grid = BubbleGridVWAlpha(model, v_walls, alpha_ns, get_kappa_omega) # bubbles = grid.bubbles kappas = grid.data[0] # omegas = grid.data[1] # Plotting plot = VwAlphaPlot(grid) plot.contourf_plusminus(kappas, label=r"$\kappa$") plot.chapman_jouguet() if __name__ == "__main__": main() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (1 minutes 11.101 seconds) **Estimated memory usage:** 428 MB .. _sphx_glr_download_auto_examples_basic_parallel.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: parallel.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: parallel.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: parallel.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_