porepy.viz.fracture_visualization module

Visualization tools for fracture networks and wells. Plots 1d fractures as lines in a 2d domain using pyplot. Also plots wells as points.

plot_fractures(pts, edges, domain=None, colortag=None, ax=None, **kwargs)[source]

Plot 2d fractures as lines in a domain.

The function is primarily intended for data exploration.

Parameters
  • pts (np.ndarray, dims 2 x npt) – Coordinates of the fracture endpoints.

  • edges (np.ndarray, dims 2 x n_edges) – Indices of fracture start and endpoints.

  • domain (dictionary, optional) – Domain size. Should contain fields xmin, xmax, ymin, ymax. If not given a bounding box is computed

  • colortag (np.ndarray, dim n_edges, optional) – Colorcoding for fractures (e.g. by fracture family). If provided, different colors will be asign to the different families. Defaults to all fractures being black.

  • ax (matplotlib.axes.Axes, optional) – If not given an axis, an axis will be created.

  • kwargs (optional) –

    Keyword arguments passed on to matplotlib. fig_id: figure id dpi: plot: Boolean flag determining whether the plot is drawn to canvas domain: Boolean flag determining whether the domain shall be plotted in red

    (or white)

    line_style: style of drawing lines pts_coord: Boolean flag determining whether the point coordinates are plotted axis_equal: Boolean flag determining whether both axes are treated equally axis: Boolean flag determining whether the axes are conforming with domain save: Boolean flag determining whether the figure is saved

Returns

The axis the fractures are plotted in

Return type

matplotlib.axes.Axes

Raises
  • ValueError if axis and figure id are provided both

  • ValueError if keywords dpi and ax are provided both

plot_wells(d, w, colortag=None, **kwargs)[source]

Plot 2d wells as points in a domain.

The function is primarily intended for data exploration.

Parameters
  • d (dict) – Domain size. Should contain fields xmin, xmax, ymin, ymax.

  • w (np.ndarray, dims 2 x npt) – Coordinates of the wells.

  • colortag (np.ndarray, dim n_w, optional) – Colorcoding for wells. If provided, different colors will be asign to the different wells. Defaults to all wells being black.

  • kwargs – Keyword arguments passed on to matplotlib. plot: Boolean flag determining wether the figure is plotted

Raises

NotImplementedError if more than 6 colors are requested