Fracture#
This is the Fracture module that contains the Fracture class. The Fracture class is used to create a Fracture object.
Notes
This module contains the fracture class.
- class andfn.fracture.Fracture(label, t, radius, center, normal, aperture=1e-06, ncoef=5, nint=10, elements=None, **kwargs)[source]#
Bases:
object
- __init__(label, t, radius, center, normal, aperture=1e-06, ncoef=5, nint=10, elements=None, **kwargs)[source]#
Initializes the fracture class.
- Parameters:
label (str) – The label of the fracture.
t (float) – The transmissivity of the fracture.
radius (float) – The radius of the fracture.
center (np.ndarray) – The center of the fracture.
normal (np.ndarray) – The normal vector of the fracture.
ncoef (int) – The number of coefficients for the bounding circle that bounds the fracture.
nint (int) – The number of integration points for the bounding circle that bounds the fracture.
elements (list) – A list of elements that the fracture is associated with. If elements is None the bounding circle will be created.
kwargs (dict) – Additional keyword arguments.
- __str__()[source]#
Returns the string representation of the fracture.
- Returns:
The string representation of the fracture.
- Return type:
str
- add_element(new_element)[source]#
Adds a new element to the fracture.
- Parameters:
new_element (Element) – The element to add to the fracture.
- calc_flow_net(n_points, margin=0.1)[source]#
Calculates the flow net for the fracture.
- Parameters:
n_points (int) – The number of points to use for the flow net.
margin (float) – The margin around the fracture to use for the flow net.
- calc_head(z)[source]#
Calculates the head for the fracture at a point z in the complex plane.
- Parameters:
z (complex) – A point in the complex z plane.
- Returns:
head – The head for the fracture at the point z.
- Return type:
float
- calc_omega(z, exclude=None)[source]#
Calculates the omega for the fracture excluding element “exclude”.
- Parameters:
z (complex | np.ndarray) – A point in the complex z plane.
exclude (any) – Label of element to exclude from the omega calculation.
- Returns:
omega – The complex potential for the fracture.
- Return type:
complex | np.ndarray
- calc_w(z, exclude=None)[source]#
Calculates the complex discharge vector for the fracture excluding element “exclude”.
- Parameters:
z (complex) – A point in the complex z plane.
exclude (any) – Label of element to exclude from the omega calculation.
- Returns:
w – The complex discharge vector for the fracture.
- Return type:
complex
- check_discharge()[source]#
Checks so the discharge in the fracture adds up to zero.
- Returns:
The total discharge in the fracture.
- Return type:
float
- consolidate()[source]#
Consolidates the fracture into a structured array.
- Returns:
fracture_struc_array (np.ndarray) – The structured array for the fracture.
fracture_index_array (np.ndarray) – The structured array for the fracture index.
- consolidate_hpc()[source]#
Consolidates the fracture into a structured array for HPC.
- Returns:
fracture_struc_array (np.ndarray) – The structured array for the fracture.
fracture_index_array (np.ndarray) – The structured array for the fracture index.
- get_discharge_elements()[source]#
Returns the elements in the fracture that have a discharge.
- Returns:
A list of elements in the fracture that have a discharge.
- Return type:
list
- get_discharge_entries()[source]#
Returns the elements in the fracture that have a discharge.
- Returns:
The number of discharge entries required in the discharge matrix.
- Return type:
int
- get_max_min_head()[source]#
Returns the maximum and minimum head from the constant head elements for the fracture.
- Returns:
head – A list containing the maximum and minimum head for the fracture.
- Return type:
list
- get_total_discharge()[source]#
Returns the total discharge from absolute values in the fracture.
- Returns:
The total discharge in the fracture.
- Return type:
float
- head_from_phi(phi)[source]#
Calculates the head from the phi for the fracture.
- Parameters:
phi (float) – The phi for the fracture.
- Returns:
head – The head for the fracture.
- Return type:
float
- phi_from_head(head)[source]#
Calculates the head from the phi for the fracture.
- Parameters:
head (float) – The head for the .
- Returns:
phi – The phi for the fracture.
- Return type:
float
- set_new_label(new_label)[source]#
Sets a new label for the fracture.
- Parameters:
new_label (str) – The new label for the fracture.
- unconsolidate(fracture_struc_array, fracture_index_array)[source]#
Unconsolidates the fracture from the structured array.
- Parameters:
fracture_struc_array (np.ndarray) – The structured array for the fracture.
fracture_index_array (np.ndarray)
- unconsolidate_hpc(fracture_struc_array, fracture_index_array)[source]#
Unconsolidates the fracture from the structured array for HPC.
- Parameters:
fracture_struc_array (np.ndarray) – The structured array for the fracture.
fracture_index_array (np.ndarray) – The structured array for the fracture index.