pysdic.Connectivity.filter_elements#
- Connectivity.filter_elements(mask, *, propagate_properties=True)[source]#
Keep only the elements selected by a boolean mask (the element type is kept).
- Parameters:
mask (ArrayLike) – A boolean array of shape \((N_e,)\). The elements with a True value are kept. A mask with only False values gives an empty connectivity.
propagate_properties (bool, optional (default:
True)) – If False, the new connectivity has no properties.
- Returns:
The filtered connectivity.
- Return type:
- Raises:
TypeError – If the mask is not a boolean array (an integer array is rejected: use
keep_elements_by_index()for indices).ValueError – If the mask does not have the shape \((N_e,)\).