porepy.fracs.fracture module
A module containing the abstract base class for all fractures.
- class Fracture(points, index=None, sort_points=True)[source]
Bases:
ABC
Abstract base class for representing a single fracture.
This base class provides general functionalities agnostic to the dimension of the fracture and the ambient dimension. It contains various utility methods, mainly intended for the use together with the FractureNetwork class.
A fracture is defined by its num_points vertices, stored in an nd x num_points numpy-array, where nd is the assumed ambient dimension. The order/sorting of vertices has to be implemented explicitly.
Dimension-dependent routines are implemented as abstract methods.
PorePy currently only supports planar and convex fractures fully. As a work-around, the fracture can be split into convex parts.
- abstract compute_centroid()[source]
Abstract method for computing and returning the centroid of the fracture.
Note that convexity is assumed.
- Return type
- abstract compute_normal()[source]
Abstract method for computing and returning the normal vector.
- Return type
- copy()[source]
Return a copy of the fracture with the current vertices.
Note
The original
points
(as given when the fracture was initialized) will not be preserved.- Returns
Fracture with the same points.
- Return type
- is_vertex(p, tol=1e-4)[source]
Check whether a given point is a vertex of the fracture.
- abstract local_coordinates()[source]
Abstract method for computing the local coordinates.
The compuation is performed on the vertex coordinates in a local system and its local dimension \(d\) is assumed to be \(d = nd - 1\), i.e. the fracture has co-dimension 1.
- Returns
Coordinates of the vertices in local dimensions (shape=(d, num_points)).
- Return type
- abstract sort_points()[source]
Abstract method to sort the vertices as needed for geometric algorithms.
- Returns
Array of integer indices corresponding to the sorting.
- Return type
- index: Optional[int]
Index of fracture.
Intended use in
FractureNetwork2d
andFractureNetwork3d
. Exact use is not clear (several fractures can be given same index), use with care.