Skip to content

Delete code previously marked for deprecation #1416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/porepy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
# Modules
from porepy.fracs import utils as frac_utils
from porepy.fracs import meshing, fracture_importer
from porepy.grids import coarsening, partition, refinement
from porepy.grids import partition, refinement
from porepy.numerics import displacement_correlation

# Applications
Expand Down
10 changes: 4 additions & 6 deletions src/porepy/applications/md_grids/mdg_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,17 @@ def seven_fractures_one_L_intersection(


def benchmark_regular_2d(
meshing_args: dict, is_coarse: bool = False, **meshing_kwargs
meshing_args: dict, **meshing_kwargs
) -> tuple[pp.MixedDimensionalGrid, FractureNetwork2d]:
"""
Create a grid bucket for a domain containing the network introduced as example 2 of
Berre et al. 2018: Benchmarks for single-phase flow in fractured porous media.
Create a MixedDimensionalGrid for a domain containing the network introduced as
example 2 of Berre et al. 2018: Benchmarks for single-phase flow in fractured porous
media.

Parameters:
meshing_args: Dictionary containing at least "mesh_size_frac". If the optional
values of "mesh_size_bound" and "mesh_size_min" are not provided, these are
set by utils.set_mesh_sizes.
is_coarse: If True, coarsen the grid by volume.
**meshing_kwargs: Keyword arguments for meshing as used by
:meth:`~porepy.grids.mdg_generation.create_mdg`.

Expand All @@ -281,8 +281,6 @@ def benchmark_regular_2d(
)
mdg = pp.create_mdg("simplex", meshing_args, fracture_network, **meshing_kwargs)

if is_coarse:
pp.coarsening.coarsen(mdg, "by_volume")
return mdg, fracture_network


Expand Down
97 changes: 0 additions & 97 deletions src/porepy/fracs/fracture_network_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,27 +151,6 @@ def __init__(

"""

def add(self, fracture: pp.PlaneFracture) -> None:
"""Add a fracture to the network.

The fracture will be assigned a new index, higher than the maximum value
currently found in the network.

Parameters:
fracture: Plane fracture to be added.

"""
msg = "This functionality is deprecated and will be removed in a future version"
warnings.warn(msg, DeprecationWarning)

ind = np.array([f.index for f in self.fractures])

if ind.size > 0:
fracture.set_index(np.max(ind) + 1)
else:
fracture.set_index(0)
self.fractures.append(fracture)

def copy(self) -> FractureNetwork3d:
"""Create a deep copy of the fracture network.

Expand Down Expand Up @@ -1291,82 +1270,6 @@ def _remove_edge_intersections(
all_p, edges, edges_2_frac, is_boundary_edge
)

def fractures_of_points(self, pts: np.ndarray) -> list[np.ndarray]:
"""For a given point, find all fractures that refer to it.

The point can be either a vertex or an internal point.

Parameters:
pts: ``shape=(3, num_points)``

Coordinates of the points for which fractures should be found.

Returns:
List of numpy arrays of integers. Each item, contains the indices of the
fractures associated to each point.

"""
msg = "This functionality is deprecated and will be removed in a future version"
warnings.warn(msg, DeprecationWarning)

fracs_of_points = []
pts = np.atleast_1d(np.asarray(pts))
for i in pts:
fracs_loc = []

# First identify edges that refer to the point
edge_ind = np.argwhere(
np.any(self.decomposition["edges"][:2] == i, axis=0)
).ravel("F")
edges_loc = self.decomposition["edges"][:, edge_ind]
# Loop over all polygons. If their edges are found in edges_loc,
# store the corresponding fracture index
for poly_ind, poly in enumerate(self.decomposition["polygons"]):
ismem, _ = pp.array_operations.ismember_columns(edges_loc, poly)
if any(ismem):
fracs_loc.append(self.decomposition["polygon_frac"][poly_ind])
fracs_of_points.append(list(np.unique(fracs_loc)))

# Prepare for returning
fracs_of_points_out = [np.asarray(item) for item in fracs_of_points]

return fracs_of_points_out

def close_points(self, dist: float) -> list[tuple[int, int, float]]:
"""Find pairs that are closer than the specified distance.

In the set of points used to describe the fractures (after decomposition),
find pairs that are closer than a certain distance.

This function is intended for debugging purposes.

Parameters:
dist: Threshold distance. All points closer than this will be reported.

Returns:
List of tuples, where each tuple contains indices of a set of close
points, and the distance between the points.

The list is not symmetric.
If ``(a, b)`` is a member, ``(b, a)`` will not be.

"""
msg = "This functionality is deprecated and will be removed in a future version"
warnings.warn(msg, DeprecationWarning)

c_points = []

pt = self.decomposition["points"]
for pi in range(pt.shape[1]):
d = pp.distances.point_pointset(pt[:, pi], pt[:, pi + 1 :])
ind = np.argwhere(d < dist).ravel("F")
for i in ind:
# Indices of close points, with an offset to compensate for slicing
# of the point cloud.
c_points.append((pi, i + pi + 1, d[i]))

return c_points

def _verify_fractures_in_plane(
self,
p: np.ndarray,
Expand Down
Loading
Loading