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:
  • points (ArrayLike)

  • index (int | None)

  • sort_points (bool)

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