Skip to content

Commit

Permalink
MIN: Formatting Sneddon test module.
Browse files Browse the repository at this point in the history
  • Loading branch information
vlipovac committed Feb 13, 2025
1 parent 5552527 commit 7992f9d
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions tests/functional/test_sneddon_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import tests.functional.setups.manu_sneddon_2d as manu_sneddon_2d
from porepy.applications.convergence_analysis import ConvergenceAnalysis

# ----> Set up the material constants
# Set up the material constants
poi = 0.25
shear_modulus = 1
lam = (
Expand All @@ -21,8 +21,7 @@
def compute_frac_pts(
theta_rad: float, a: float, height: float, length: float
) -> np.ndarray:
"""
Assuming the fracture center is at the coordinate (height/2, length/2),
"""Assuming the fracture center is at the coordinate (height/2, length/2),
compute the endpoints of a fracture given its orientation and fracture length.
Parameters:
Expand All @@ -32,8 +31,9 @@ def compute_frac_pts(
length: Width of the domain.
Returns:
frac_pts : A 2x2 array where each column represents the coordinates of an end point of the fracture in 2D.
The first column corresponds to one end point, and the second column corresponds to the other.
A 2x2 array where each column represents the coordinates of an end point of the
fracture in 2D. The first column corresponds to one end point, and the second
column corresponds to the other.
"""
# Rotate the fracture with an angle theta_rad
Expand All @@ -46,17 +46,18 @@ def compute_frac_pts(
return frac_pts


# ----> Retrieve actual order of convergence
@pytest.fixture(scope="module")
def actual_ooc() -> dict:
"""
Prepare parameters and model for the convergence analysis of the moment balance equation.
"""Performs convergence analysis of the Sneddon setup.
This setup validates the linear elasticity model for the analytical Sneddon solution in 2D, describing the analytical displacement on the fracture.
The problem consists of a 2D domain with a fracture at a given angle and internal pressure.
This setup validates the linear elasticity model for the analytical Sneddon solution
in 2D, describing the analytical displacement on the fracture. The problem consists
of a 2D domain with a fracture at a given angle and internal pressure.
Returns:
A dictionary containing the experimental order of convergence for the displacement.
A dictionary containing the experimental order of convergence for the
displacement.
"""
# Angle of the fracture in degrees

Expand Down Expand Up @@ -103,9 +104,7 @@ def actual_ooc() -> dict:
return order_dict


def test_order_of_convergence(
actual_ooc,
) -> None:
def test_order_of_convergence(actual_ooc: dict) -> None:
"""Test observed order of convergence."""
# We the order of L2 convergence on the fracture of displacement to be about 1.0
assert 0.85 < actual_ooc["ooc_displacement"]

0 comments on commit 7992f9d

Please sign in to comment.