flopy.utils.gridutil module

Grid utilities

get_disu_kwargs(nlay, nrow, ncol, delr, delc, tp, botm, return_vertices=False)[source]

Create args needed to construct a DISU package for a regular MODFLOW grid.

Parameters:
  • nlay (int) – Number of layers

  • nrow (int) – Number of rows

  • ncol (int) – Number of columns

  • delr (numpy.ndarray) – Column spacing along a row

  • delc (numpy.ndarray) – Row spacing along a column

  • tp (int or numpy.ndarray) – Top elevation(s) of cells in the model’s top layer

  • botm (numpy.ndarray) – Bottom elevation(s) for each layer

  • return_vertices (bool) – If true, then include vertices and cell2d in kwargs

get_disv_kwargs(nlay, nrow, ncol, delr, delc, tp, botm, xoff=0.0, yoff=0.0)[source]

Create args needed to construct a DISV package.

Parameters:
  • nlay (int) – Number of layers

  • nrow (int) – Number of rows

  • ncol (int) – Number of columns

  • delr (float or numpy.ndarray) – Column spacing along a row with shape (ncol)

  • delc (float or numpy.ndarray) – Row spacing along a column with shape (nrow)

  • tp (float or numpy.ndarray) – Top elevation(s) of cells in the model’s top layer with shape (nrow, ncol)

  • botm (list of floats or numpy.ndarray) – Bottom elevation(s) of all cells in the model with shape (nlay, nrow, ncol)

  • xoff (float) – Value to add to all x coordinates. Optional (default = 0.)

  • yoff (float) – Value to add to all y coordinates. Optional (default = 0.)

get_lni(ncpl, nodes) List[Tuple[int, int]][source]

Get layer index and within-layer node index (both 0-based).

Node count per layer may be an int or array-like of integers.

An integer ncpl indicates all layers have the same node count. If an integer ncpl is less than any specified node numbers, the grid is understood to have at least enough layers to contain them.

If ncpl is array-like it is understood to describe node count

per zero-indexed layer.

Parameters:
  • ncpl (node count per layer (int or array-like of ints)) –

  • nodes (node numbers (array-like of nodes)) –

Return type:

A list of tuples (layer index, node index)

uniform_flow_field(qx, qy, qz, shape, delr=None, delc=None, delv=None)[source]