pysdic.Mesh.compute_elements_neighborhood#

Mesh.compute_elements_neighborhood(*, max_distance=1, self_neighborhood=True)[source]#

Compute the neighborhood of each element of the mesh, i.e. the elements within a given distance (two elements are at distance 1 if they share a vertex).

Shortcut for pysdic.fem.compute_elements_neighborhood() with the connectivity of the mesh.

Parameters:
  • max_distance (Integral, optional (default: 1)) – The maximum distance of the elements in the neighborhood.

  • self_neighborhood (bool, optional (default: True)) – If True, the neighborhood of each element includes the element itself.

Returns:

A symmetric boolean sparse matrix of shape \((N_e, N_e)\), where the neighborhood of element \(i\) is neighborhood[i].indices (sorted).

Return type:

scipy.sparse.csr_matrix