flopy.utils.cvfdutil module
- area_of_polygon(x, y)[source]
Calculates the signed area of an arbitrary polygon given its vertices https://stackoverflow.com/a/4682656/ (Joe Kington) http://softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm#2D%20Polygons
- get_disv_gridprops(verts, iverts, xcyc=None)[source]
Calculate disv grid properties from verts and iverts
- gridlist_to_disv_gridprops(gridlist)[source]
Take a list of flopy structured model grids and convert them into a dictionary that can be passed into the modflow6 disv package. Cells from a child grid will patched in to make a single set of vertices. Cells will be numbered according to consecutive numbering of active cells in the grid list.
- gridlist_to_verts(gridlist)[source]
Take a list of flopy structured model grids and convert them into vertices. The idomain can be set to remove cells in a parent grid. Cells from a child grid will patched in to make a single set of vertices. Cells will be numbered according to consecutive numbering of active cells in the grid list.
- segment_face(ivert, ivlist1, ivlist2, vertices)[source]
Check the vertex lists for cell 1 and cell 2. Add a new vertex to cell 1 if necessary.
- Parameters:
- Returns:
segmented – Return True if a face in cell 1 was split up by adding a new vertex
- Return type:
- shapefile_to_xcyc(shp)[source]
Get cell centroid coordinates
- Parameters:
shp (string) – Name of shape file
- Returns:
xcyc – x, y coordinates of all polygons in shp
- Return type:
ndarray
- to_cvfd(vertdict, nodestart=None, nodestop=None, skip_hanging_node_check=False, verbose=False)[source]
Convert a vertex dictionary into verts and iverts
- Parameters:
vertdict – vertdict is a dictionary {icell: [(x1, y1), (x2, y2), (x3, y3), …]}
nodestart (int) – starting node number. (default is zero)
nodestop (int) – ending node number up to but not including. (default is len(vertdict))
skip_hanging_node_check (bool) – skip the hanging node check. this may only be necessary for quad-based grid refinement. (default is False)
verbose (bool) – print messages to the screen. (default is False)
- Returns:
verts (ndarray) – array of x, y vertices
iverts (list) – list containing a list for each cell