pysdic.IntegrationPoints.filter_elements#
- IntegrationPoints.filter_elements(mask, *, propagate_properties=True)[source]#
Update the integration points after the elements of their mesh are filtered with a boolean mask (see
pysdic.Mesh.filter_connectivity()).The points of the removed elements are unlocated (element index
-1and natural coordinatesnumpy.nan) but not removed, and the element indices of the other points are renumbered like the elements of the filtered mesh.- Parameters:
mask (ArrayLike) – A boolean array of shape \((N_e,)\), with \(N_e\) the number of elements of the mesh, True for the elements to keep.
propagate_properties (bool, optional (default:
True)) – If False, the new integration points have no properties.
- Returns:
The integration points consistent with the filtered mesh.
- Return type:
- Raises:
TypeError – If the mask is not a boolean array.
IndexError – If a point refers to an element \(\geq N_e\).
Examples
1from pysdic import IntegrationPoints 2 3integration_points = IntegrationPoints([[0.2], [0.5], [0.1]], [0, 1, 2]) 4filtered = integration_points.filter_elements([True, False, True]) 5print(filtered.element_indices) # [ 0 -1 1]