pysdic.Mesh.add_connectivity#
- Mesh.add_connectivity(new_connectivity, *, propagate_properties=True)[source]#
Return a new mesh with additional elements (appended after the current ones).
The new elements must refer to the existing vertices. See
pysdic.Connectivity.concatenate()for the element type and the properties.- Parameters:
new_connectivity (Union[
pysdic.Connectivity, ArrayLike]) – The new elements, as apysdic.Connectivityor an integer array of shape \((R, N_{vpe})\). An array takes the element type of the mesh.propagate_properties (bool, optional (default:
True)) – If False, the new mesh has no element properties. The vertex properties are always copied.
- Returns:
A new mesh with \(N_e + R\) elements.
- Return type:
Examples
1import numpy 2from pysdic import Mesh 3 4mesh = Mesh([[0, 0, 0], [1, 0, 0], [0, 1, 0], [1, 1, 0]], [[0, 1, 2]], element_type="triangle_3") 5mesh.connectivity["material"] = [10.0] 6 7mesh = mesh.add_connectivity([[1, 3, 2]]) 8print(mesh.connectivity["material"]) # [[10.] [nan]]