@@ -1788,51 +1788,51 @@ def test_vtk_export_disv1_model(function_tmpdir):
17881788 idomain = np .ones ((nlay , nrow , ncol )),
17891789 )
17901790
1791- with pytest . deprecated_call ():
1792- from flopy . utils . cvfdutil import gridlist_to_disv_gridprops
1793-
1794- gridprops = gridlist_to_disv_gridprops ([ mg ] )
1795- gridprops ["top" ] = 0
1796- gridprops ["botm" ] = np .zeros ((nlay , nrow * ncol ), dtype = float ) - 1
1797- gridprops ["nlay" ] = nlay
1798-
1799- disv = ModflowGwfdisv (gwf , ** gridprops )
1800- ic = ModflowGwfic (gwf , strt = 10 )
1801- npf = ModflowGwfnpf (gwf )
1802-
1803- # Export model without specifying packages_names parameter
1804- # create the vtk output
1805- gwf = sim .get_model ()
1806- vtkobj = Vtk (gwf , binary = False )
1807- vtkobj .add_model (gwf )
1808- f = function_tmpdir / "gwf.vtk"
1809- vtkobj .write (f )
1810-
1811- # load the output using the vtk standard library
1812- gridreader = vtkUnstructuredGridReader ()
1813- gridreader .SetFileName (str (f ))
1814- gridreader .Update ()
1815- grid = gridreader .GetOutput ()
1816-
1817- # get the points
1818- vtk_points = grid .GetPoints ()
1819- vtk_points = vtk_points .GetData ()
1820- vtk_points = vtk_to_numpy (vtk_points )
1821-
1822- # get cell locations (ia format of point to cell relationship)
1823- cell_locations = vtk_to_numpy (grid .GetCellLocationsArray ())
1824- cell_locations_answer = np .array ([0 , 8 , 16 , 24 , 32 , 40 , 48 , 56 , 64 ])
1825- print (f"Found cell locations { cell_locations } in vtk file." )
1826- print (f"Expecting cell locations { cell_locations_answer } " )
1827- errmsg = "vtk cell locations do not match expected result."
1828- assert np .allclose (cell_locations , cell_locations_answer ), errmsg
1829-
1830- cell_types = vtk_to_numpy (grid .GetCellTypesArray ())
1831- cell_types_answer = np .array (9 * [42 ])
1832- print (f"Found cell types { cell_types } in vtk file." )
1833- print (f"Expecting cell types { cell_types_answer } " )
1834- errmsg = "vtk cell types do not match expected result."
1835- assert np .allclose (cell_types , cell_types_answer ), errmsg
1791+ from flopy . utils . cvfdutil import get_disv_gridprops , gridlist_to_verts
1792+
1793+ verts , iverts = gridlist_to_verts ([ mg ])
1794+ gridprops = get_disv_gridprops ( verts , iverts )
1795+ gridprops ["top" ] = 0
1796+ gridprops ["botm" ] = np .zeros ((nlay , nrow * ncol ), dtype = float ) - 1
1797+ gridprops ["nlay" ] = nlay
1798+
1799+ disv = ModflowGwfdisv (gwf , ** gridprops )
1800+ ic = ModflowGwfic (gwf , strt = 10 )
1801+ npf = ModflowGwfnpf (gwf )
1802+
1803+ # Export model without specifying packages_names parameter
1804+ # create the vtk output
1805+ gwf = sim .get_model ()
1806+ vtkobj = Vtk (gwf , binary = False )
1807+ vtkobj .add_model (gwf )
1808+ f = function_tmpdir / "gwf.vtk"
1809+ vtkobj .write (f )
1810+
1811+ # load the output using the vtk standard library
1812+ gridreader = vtkUnstructuredGridReader ()
1813+ gridreader .SetFileName (str (f ))
1814+ gridreader .Update ()
1815+ grid = gridreader .GetOutput ()
1816+
1817+ # get the points
1818+ vtk_points = grid .GetPoints ()
1819+ vtk_points = vtk_points .GetData ()
1820+ vtk_points = vtk_to_numpy (vtk_points )
1821+
1822+ # get cell locations (ia format of point to cell relationship)
1823+ cell_locations = vtk_to_numpy (grid .GetCellLocationsArray ())
1824+ cell_locations_answer = np .array ([0 , 8 , 16 , 24 , 32 , 40 , 48 , 56 , 64 ])
1825+ print (f"Found cell locations { cell_locations } in vtk file." )
1826+ print (f"Expecting cell locations { cell_locations_answer } " )
1827+ errmsg = "vtk cell locations do not match expected result."
1828+ assert np .allclose (cell_locations , cell_locations_answer ), errmsg
1829+
1830+ cell_types = vtk_to_numpy (grid .GetCellTypesArray ())
1831+ cell_types_answer = np .array (9 * [42 ])
1832+ print (f"Found cell types { cell_types } in vtk file." )
1833+ print (f"Expecting cell types { cell_types_answer } " )
1834+ errmsg = "vtk cell types do not match expected result."
1835+ assert np .allclose (cell_types , cell_types_answer ), errmsg
18361836
18371837
18381838@pytest .mark .mf6
@@ -2228,7 +2228,7 @@ def test_mf6_chd_shapefile_export_unstructured(function_tmpdir, use_pandas, spar
22282228
22292229def disv_sim (name , tmpdir ):
22302230 from flopy .discretization import StructuredGrid
2231- from flopy .utils .cvfdutil import gridlist_to_disv_gridprops
2231+ from flopy .utils .cvfdutil import get_disv_gridprops , gridlist_to_verts
22322232
22332233 nlay , nrow , ncol = 3 , 3 , 3
22342234 mg = StructuredGrid (
@@ -2239,12 +2239,12 @@ def disv_sim(name, tmpdir):
22392239 idomain = np .ones ((nlay , nrow , ncol )),
22402240 )
22412241
2242- with pytest . deprecated_call ():
2243- gridprops = gridlist_to_disv_gridprops ([ mg ] )
2244- gridprops ["top" ] = 0
2245- ncpl = gridprops ["ncpl" ]
2246- gridprops ["botm" ] = np .zeros ((nlay , ncpl ), dtype = float ) - 1
2247- gridprops ["nlay" ] = nlay
2242+ verts , iverts = gridlist_to_verts ([ mg ])
2243+ gridprops = get_disv_gridprops ( verts , iverts )
2244+ gridprops ["top" ] = 0
2245+ ncpl = gridprops ["ncpl" ]
2246+ gridprops ["botm" ] = np .zeros ((nlay , ncpl ), dtype = float ) - 1
2247+ gridprops ["nlay" ] = nlay
22482248
22492249 sim = MFSimulation (sim_name = name , sim_ws = tmpdir , exe_name = "mf6" )
22502250 tdis = ModflowTdis (sim )
0 commit comments