Skip to content

Commit cd10d2e

Browse files
author
Joost Delsman
committed
isort
2 parents 3d32903 + f6bfd6d commit cd10d2e

File tree

10 files changed

+190
-68
lines changed

10 files changed

+190
-68
lines changed

docs/api/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Fixed
1919
Changed
2020
~~~~~~~
2121

22+
- Removed ``meshzoo`` dependency.
23+
2224
Added
2325
~~~~~
2426

examples/mf6/Henry.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
with hydrostatic seawater with a density of 1025 kg m:sup:`-3`. This is
2727
represented by a General Head Boundary package.
2828
"""
29+
30+
# sphinx_gallery_thumbnail_number = -1
31+
2932
# %%
3033
# We'll start with the usual imports. As this is a simple (synthetic)
3134
# structured model, we can make due with few packages.
@@ -264,11 +267,11 @@
264267
#
265268
# We'll open the head and concentration files.
266269

267-
head = imod.mf6.open_hds(
270+
head = imod.mf6.out.open_hds(
268271
modeldir / "flow/flow.hds",
269272
modeldir / "flow/dis.dis.grb",
270273
)
271-
conc = imod.mf6.open_hds(
274+
conc = imod.mf6.out.open_conc(
272275
modeldir / "transport/transport.ucn",
273276
modeldir / "flow/dis.dis.grb",
274277
)
@@ -283,6 +286,6 @@
283286
# We can check the concentration to see that a fresh-saline interface has been
284287
# formed:
285288

286-
conc.isel(y=0, time=-1).plot.contourf(yincrease=False)
289+
conc.isel(y=0, time=-1).plot.contourf(yincrease=False, cmap="RdYlBu_r")
287290

288291
# %%

examples/mf6/circle.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
# We'll start with the following imports:
2323

2424
import matplotlib.pyplot as plt
25-
import meshzoo
2625
import numpy as np
2726
import xarray as xr
2827
import xugrid as xu
@@ -33,18 +32,19 @@
3332
# Create a mesh
3433
# -------------
3534
#
36-
# The first steps consists of generating a mesh. In this example, our geometry
37-
# is so simple that we don't need complex mesh generators. Instead we will use
38-
# ``meshzoo``, which can generate a number of meshes for simple domains such as
39-
# triangles, rectangles, regular polygons, or disks.
40-
#
41-
# We can use the nodes and the cell node connectivity directly to initialize a
42-
# xugrid Ugrid2d object, and we'll create a quick plot to take a look at the
43-
# grid.
35+
# The first steps consists of generating a mesh. In this example, we'll use data
36+
# included with iMOD Python for a circular mesh. Note that this is a `Ugrid2D
37+
# object. <https://deltares.github.io/xugrid/api/xugrid.Ugrid2d.html>`_
38+
# For more information on working with unstructured grids see the
39+
# `Xugrid documentation <https://deltares.github.io/xugrid/index.html>`_
40+
41+
grid = imod.data.circle()
42+
43+
grid
4444

45-
nodes, triangles = meshzoo.disk(6, 6)
46-
nodes *= 1000.0
47-
grid = xu.Ugrid2d(*nodes.T, -1, triangles)
45+
46+
# %%
47+
# We can plot this object as follows:
4848

4949
fig, ax = plt.subplots()
5050
xu.plot.line(grid, ax=ax)
@@ -68,7 +68,7 @@
6868
# groundwater; with small flows in the center and larger flows as the recharge
6969
# accumulates while the groundwater flows towards the exterior boundary.
7070

71-
nface = len(triangles)
71+
nface = grid.n_face
7272
nlayer = 2
7373

7474
idomain = xu.UgridDataArray(

0 commit comments

Comments
 (0)