.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples\mf6\circle_partitioned.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_examples_mf6_circle_partitioned.py: Circle partitioned ================== This example illustrates a circular model that is split into 3 submodels. The split method returns a simulation object that can be run as is. In this case the 3 submodels are roughly equal sized partitions that have the shape of pie pieces. .. GENERATED FROM PYTHON SOURCE LINES 10-28 .. code-block:: Python import matplotlib.pyplot as plt from example_models import create_circle_simulation import imod from imod.mf6.multimodel.partition_generator import get_label_array simulation = create_circle_simulation() tmp_path = imod.util.temporary_directory() simulation.write(tmp_path / "original", False) idomain = simulation["GWF_1"]["disv"].dataset["idomain"] number_partitions = 5 submodel_labels = get_label_array(simulation, number_partitions) # Create a simulation that is split in subdomains according to the label array. new_sim = simulation.split(submodel_labels) .. GENERATED FROM PYTHON SOURCE LINES 29-30 Write the simulation input files for the new simulation. .. GENERATED FROM PYTHON SOURCE LINES 30-34 .. code-block:: Python new_sim.write(tmp_path, False) # run the split simulation new_sim.run() .. GENERATED FROM PYTHON SOURCE LINES 35-36 Visualize the computed heads in the top layer. .. GENERATED FROM PYTHON SOURCE LINES 36-40 .. code-block:: Python fig, ax = plt.subplots() head = new_sim.open_head() head["head"].isel(layer=0, time=-1).ugrid.plot.contourf(ax=ax) .. image-sg:: /examples/mf6/images/sphx_glr_circle_partitioned_001.png :alt: layer = 1, time = 1.0 :srcset: /examples/mf6/images/sphx_glr_circle_partitioned_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 41-42 Visualize the flow-horizontal-face-x componenty of the balances. .. GENERATED FROM PYTHON SOURCE LINES 42-48 .. code-block:: Python fig, ax = plt.subplots() balances = new_sim.open_flow_budget() balances["flow-horizontal-face-x"].isel(layer=0, time=-1).ugrid.plot() pass .. image-sg:: /examples/mf6/images/sphx_glr_circle_partitioned_002.png :alt: layer = 1, time = 1.0 :srcset: /examples/mf6/images/sphx_glr_circle_partitioned_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 4.043 seconds) .. _sphx_glr_download_examples_mf6_circle_partitioned.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: circle_partitioned.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: circle_partitioned.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: circle_partitioned.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_