Skip to content

Commit 9fc39d8

Browse files
committed
DOC: Minor clarification in documentations
Applies to split_grid (fracs) and geometry_property_checks
1 parent fd0a7d3 commit 9fc39d8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/porepy/fracs/split_grid.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,17 +1029,20 @@ def _sort_sub_list(
10291029
10301030
"""
10311031
ix = np.zeros(indices.size, dtype=int)
1032-
# Loop over all rows (if the matrix is CSR) or columns (if the matrix is CSC).
1032+
# NOTE: Comments below are given for a CSR matrix. If the matrix is CSC, the roles
1033+
# of rows and columns are reversed.
1034+
# Loop over all rows.
10331035
for i in range(indptr.size - 1):
1034-
# Indices of the current row/column (will be respectively colunms/rows).
1036+
# Indices in the sparse storage associated with the current row.
10351037
sub_ind = slice(indptr[i], indptr[i + 1])
1036-
# Find the sorting indices of the current row/column. This will be 0-offset.
1038+
# Find the sorting indices of the columns that are non-zero for this row. This
1039+
# will be a 0-offset array.
10371040
loc_ix = np.argsort(indices[sub_ind])
10381041
# Update the global index array. Adding indptr[i] ensures that the indices have
10391042
# the right offset (i.e., they start at the right place in the global index
10401043
# array, and not on 0).
10411044
ix[sub_ind] = loc_ix + indptr[i]
1042-
# Rearrange the indices to be sorted in each row (column).
1045+
# Rearrange the indices to be sorted in each row.
10431046
indices = indices[ix]
10441047
# Create a mapping from the sorted indices to the original indices.
10451048
iv = np.zeros(indices.size, dtype=int)

src/porepy/geometry/geometry_property_checks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ def is_ccw_polyline(
130130
p3 = p3.reshape((-1, 1))
131131
num_points = p3.shape[1]
132132

133-
# Compute cross product between p1-p2 and p1-p3. The right-hand rule implies that p3
134-
# is to the left if the cross product is positive.
133+
# Compute cross product between the vectors running from p1 to, respectively, p2 and
134+
# p3. The right-hand rule implies that if the cross product is positive, p3 is to
135+
# the left of the line p1-p2.
135136
cross_product = (p2[0] - p1[0]) * (p3[1] - p1[1]) - (p2[1] - p1[1]) * (
136137
p3[0] - p1[0]
137138
)

0 commit comments

Comments
 (0)