Skip to content

Commit

Permalink
chore: Add testcase for multiple grids in mesh2d (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
veenstrajelmer authored Mar 11, 2024
1 parent ce8119e commit 3e72e79
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/dflowfm/test_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,31 @@ def test_create_2d():
mesh2d.create_rectilinear(extent=bbox, dx=0.5, dy=0.75)

mesh2d_output = mesh2d.get_mesh2d()
assert np.isclose(min(mesh2d_output.node_x), 1)
assert np.isclose(max(mesh2d_output.node_x), 3)
assert np.isclose(min(mesh2d_output.node_y), -2)
assert np.isclose(max(mesh2d_output.node_y), 4)
assert mesh2d_output.node_x.size == 45
assert mesh2d_output.edge_nodes.size == 152


def test_create_2d_multiple_grids():
bbox = (1.0, -2.0, 3.0, 4.0)
bbox2 = (-2.0, -2.0, 0.0, 4.0)

mesh2d = Mesh2d(meshkernel=MeshKernel())
mesh2d.create_rectilinear(extent=bbox, dx=0.5, dy=0.75)
mesh2d.create_rectilinear(extent=bbox2, dx=0.5, dy=0.75)

mesh2d_output = mesh2d.get_mesh2d()
assert np.isclose(min(mesh2d_output.node_x), -2)
assert np.isclose(max(mesh2d_output.node_x), 3)
assert np.isclose(min(mesh2d_output.node_y), -2)
assert np.isclose(max(mesh2d_output.node_y), 4)
assert mesh2d_output.node_x.size == 90
assert mesh2d_output.edge_nodes.size == 304


@pytest.mark.parametrize(
"deletemeshoption,inside,nnodes,nedgenodes,nfaces",
[
Expand Down

0 comments on commit 3e72e79

Please sign in to comment.