priority_flow.get_border ======================== .. py:module:: priority_flow.get_border .. autoapi-nested-parse:: Get Border functions for PriorityFlow. This module provides functions to identify border cells by reading in a mask and returning a mask of the border cells for irregular boundaries. Functions --------- .. autoapisummary:: priority_flow.get_border.get_border Module Contents --------------- .. py:function:: get_border(mask_mat: numpy.ndarray) -> numpy.ndarray Identify border cells. Function that reads in a mask and returns a mask of the border cells for the irregular boundary. Border cells are identified as cells that have fewer than 4 valid neighbors within the domain. :param mask_mat: Matrix mask with values of 0 for cells outside the domain and 1 for cells inside the domain :type mask_mat: np.ndarray :returns: Matrix mask where 1 indicates border cells and 0 indicates non-border cells :rtype: np.ndarray .. rubric:: Notes This function implements a border detection algorithm that: 1. Identifies cells at the domain boundary 2. Counts valid neighbors for each cell 3. Classifies cells with fewer than 4 neighbors as border cells 4. Handles irregular domain boundaries The algorithm uses D4 connectivity (4-directional) to identify border cells: - Cells with 4 valid neighbors are interior cells (not borders) - Cells with fewer than 4 valid neighbors are border cells - Only cells within the domain mask are considered Border cells are typically: - Domain edge cells - Cells adjacent to masked areas - Cells in irregular boundary regions - Cells with incomplete neighbor connectivity