porepy.fracs.utils module
Frontend utility functions related to fractures and their meshing.
- fracture_length_2d(pts, edges)[source]
Find the length of 2D fracture traces.
- Parameters
pts (
np.ndarray, 2 x n_pts
) – Coordinates of start and endpoints of fractures.edges (
np.ndarary, 2 x n_fracs
) – Indices of start and endpoint of fractures, referring to columns in pts.
- Returns
Length of each fracture.
- Return type
np.ndarray, length n_fracs
- uniquify_points(pts, edges, tol)[source]
Uniquify a set of points by merging almost coinciding coordinates.
Also update fractures, and remove edges that consist of a single point (either after the points were merged, or because the input was a point edge).
- Parameters
pts (
np.ndarary, n_dim x n_pts
) – Coordinates of start and endpoints of the fractures.edges (
np.ndarray, n x n_fracs
) – Indices of start and endpoint of fractures, referring to columns in pts. Should contain at least two rows; additional rows representing fracture tags are also accepted.tol (
double
) – Tolerance used for merging points.
- Returns
Unique point array. np.ndarray (2 x n_fracs_update): Updated start and endpoints of
fractures.
- np.ndarray: Index (referring to input) of fractures deleted as they
effectively contained a single coordinate.
- Return type
np.ndarray (n_dim x n_pts_unique)