@@ -201,10 +201,6 @@ def test_create_2d():
201
201
mesh2d = Mesh2d (meshkernel = MeshKernel ())
202
202
mesh2d .create_rectilinear (extent = bbox , dx = 0.5 , dy = 0.75 )
203
203
204
- # TODO: remove plotting
205
- # _, ax = plt.subplots()
206
- # mesh2d_output.plot_edges(ax=ax)
207
-
208
204
mesh2d_output = mesh2d .get_mesh2d ()
209
205
assert mesh2d_output .node_x .size == 45
210
206
assert mesh2d_output .edge_nodes .size == 152
@@ -237,11 +233,6 @@ def test_create_clip_2d(deletemeshoption, inside, nnodes, nedgenodes, nfaces):
237
233
assert mesh2d_output .edge_nodes .size == nedgenodes # 2x nedges
238
234
assert mesh2d_output .face_x .size == nfaces
239
235
240
- # TODO: remove plotting
241
- # _, ax = plt.subplots()
242
- # mesh2d_output.plot_edges(ax=ax)
243
- # ax.plot(polygon.x_coordinates, polygon.y_coordinates, "r-")
244
-
245
236
246
237
def test_create_refine_2d ():
247
238
@@ -269,11 +260,6 @@ def test_create_refine_2d():
269
260
assert fnc .shape == (100 , 4 )
270
261
assert (fnc == - 2147483648 ).sum () == 12 # amount of triangles
271
262
272
- # TODO: remove plotting
273
- # _, ax = plt.subplots()
274
- # mesh2d_output = mesh2d.get_mesh2d()
275
- # mesh2d_output.plot_edges(ax=ax)
276
-
277
263
278
264
cases = [
279
265
test_input_dir / "e02/f101_1D-boundaries/c01_steady-state-flow/Boundary_net.nc" ,
@@ -664,19 +650,18 @@ def test_create_triangular():
664
650
)
665
651
666
652
network .mesh2d_create_triangular_within_polygon (polygon )
667
- mesh2d_output = network ._mesh2d .get_mesh2d ()
668
-
653
+
669
654
assert np .array_equiv (
670
- mesh2d_output . node_x ,
655
+ network . _mesh2d . mesh2d_node_x ,
671
656
np .array ([6.0 , 4.0 , 2.0 , 0.0 ]),
672
657
)
673
658
assert np .array_equiv (
674
- mesh2d_output . node_y ,
659
+ network . _mesh2d . mesh2d_node_y ,
675
660
np .array ([2.0 , 7.0 , 6.0 , 0.0 ]),
676
661
)
677
662
assert np .array_equiv (
678
- mesh2d_output . edge_nodes ,
679
- np .array ([[2 , 3 ], [3 , 0 ], [0 , 2 ], [0 , 1 ], [1 , 2 ]]). ravel () ,
663
+ network . _mesh2d . mesh2d_edge_nodes ,
664
+ np .array ([[2 , 3 ], [3 , 0 ], [0 , 2 ], [0 , 1 ], [1 , 2 ]]),
680
665
)
681
666
682
667
@@ -691,11 +676,11 @@ def test_add_1d2d_links():
691
676
# Create Mesh2d
692
677
network .mesh2d_create_rectilinear_within_extent (extent = (- 5 , - 5 , 5 , 5 ), dx = 1 , dy = 1 )
693
678
694
- # network._mesh1d._set_mesh1d() #TODO: already set with updated code
695
- # network._mesh2d._set_mesh2d() #TODO: already set with updated code
696
- network . _mesh1d . meshkernel . mesh1d_get (). node_x
697
- network . _mesh2d . meshkernel . mesh2d_get (). node_x
698
-
679
+ m1d_nnodes = network ._mesh1d .meshkernel . mesh1d_get (). node_x . size
680
+ m2d_nnodes = network ._mesh2d .meshkernel . mesh2d_get (). node_x . size
681
+ assert m1d_nnodes == 12
682
+ assert m2d_nnodes == 121
683
+
699
684
# Get required arguments
700
685
node_mask = network ._mesh1d .get_node_mask ([branchid ])
701
686
exterior = GeometryList (
0 commit comments