Coverage for fixtures\flow_basic_unstructured_fixture.py: 100%

1 import numpy as np

2 import pytest

3 import xarray as xr

4 import xugrid as xu

5

6 import imod

7

8

9@pytest.fixture(scope="function")

10 def basic_unstructured_dis(basic_dis):

11 idomain, top, bottom = basic_dis

12 idomain_ugrid = xu.UgridDataArray.from_structured(idomain)

13 top_mf6 = top.sel(layer=1) # Top for modlfow 6 shouldn't contain layer dim

14

15 return idomain_ugrid, top_mf6, bottom

16

17

18@pytest.fixture(scope="module")

19 def circle_dis():

20 """Basic model discretization"""

21

22 grid_triangles = imod.data.circle()

23 grid = grid_triangles.tesselate_centroidal_voronoi()

24

25 nface = grid.n_face

26 nlayer = 15

27

28 layer = np.arange(nlayer, dtype=int) + 1

29

30 idomain = xu.UgridDataArray(

31 xr.DataArray(

32 np.ones((nlayer, nface), dtype=np.int32),

33 coords={"layer": layer},

34 dims=["layer", grid.face_dimension],

35 ),

36 grid=grid,

37 )

38 top = 0.0

39 bottom = xr.DataArray(top - (layer * 10.0), dims=["layer"])

40

41 return idomain, top, bottom