porepy.fracs.line_fracture module

Contains classes representing fractures of 1D, i.e. manifolds of dimension 1 embedded in 2D.

class LineFracture(points, index=None, sort_points=True)[source]

Bases: Fracture

A class representing linear fracture in 2D.

Parameters
compute_centroid()[source]

Method for computing the centroid of the fracture.

Returns

Array containing the 2D coordinates of the centroid.

Return type

ndarray

compute_normal()[source]

Method computing normal vectors of the fracture

Returns

numpy.ndarray(2 x 1)

Normal vector of the fracture.

Return type

ndarray

length()[source]

Compute length of the fracture.

Returns

Fracture length as a float.

local_coordinates()[source]

Method for computing the 1d vertex coordinates in a local system.

The first coordinate is set at x=0, the second at x=self.length().

Returns

numpy.ndarray(1 x 2)

The coordinates of the two vertices in the single local dimension.

Return type

ndarray

sort_points()[source]

Sort the vertices.

For fractures defined by a two-vertex line segment, sorting is trivial. Returns ——- numpy.ndarray(dtype=int)

The indices corresponding to the sorting.

Return type

ndarray

center: np.ndarray

Centroid of the fracture (shape=(nd, )).

index: Optional[int]

Index of fracture.

Intended use in FractureNetwork2d and FractureNetwork3d. Exact use is not clear (several fractures can be given same index), use with care.

normal: np.ndarray

Normal vector (shape=(nd, )).

orig_pts: np.ndarray

Original fracture vertices (shape=(nd, num_points)).

The original points are kept in case the fracture geometry is modified.

pts: np.ndarray

Fracture vertices (shape=(nd, num_points)), stored in the implemented order.

Note that the points passed to init will mutate.