Skip to content

Commit

Permalink
Updated _FM_utils.py
Browse files Browse the repository at this point in the history
ruff extension in VS Code is used to format the code
  • Loading branch information
abja-dhi committed Nov 7, 2024
1 parent e92857c commit 12348f4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mikeio/spatial/_FM_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,9 @@ def _to_polygons(node_coordinates: np.ndarray, element_table: np.ndarray) -> lis
return polygons


def _create_node_element_matrix(element_table: np.ndarray, num_nodes: int) -> csr_matrix:
def _create_node_element_matrix(
element_table: np.ndarray, num_nodes: int
) -> csr_matrix:
"""Creates a sparse node-element connectivity matrix from a given element table.
Parameters
Expand All @@ -654,12 +656,13 @@ def _create_node_element_matrix(element_table: np.ndarray, num_nodes: int) -> cs
column corresponds to a node index involved in the element.)
num_nodes : int
The total number of nodes in the mesh.
Returns
-------
scipy.sparse.csr_matrix
A sparse matrix of shape (num_nodes, number of elements), where the entry
(i, j) is 1 if node i is part of element j, and 0 otherwise.
"""
row_ind = element_table.ravel()
col_ind = np.repeat(np.arange(element_table.shape[0]), element_table.shape[1])
Expand Down

0 comments on commit 12348f4

Please sign in to comment.